test CheckVoltage

This commit is contained in:
Janosch
2022-10-11 12:20:37 +01:00
parent 7481f0f7e8
commit e54de68605
7 changed files with 35 additions and 17 deletions
+1
View File
@@ -23,6 +23,7 @@ int main() {
(TestCase){"test_check_timeout", test_check_timeout},
(TestCase){"test_evse_read", test_evse_read},
(TestCase){"test_check_start_condition", test_check_start_condition},
(TestCase){"test_check_voltage", test_check_voltage},
// Example:
//(TestCase){"Your tests name", function_name_without_brackets}
//...
BIN
View File
Binary file not shown.
+16
View File
@@ -129,3 +129,19 @@ void test_check_start_condition()
res = CheckStartCondition();
assert(!res);
}
void test_check_voltage(){
bool res;
Param::SetInt(Param::udc, 400);
Param::SetInt(Param::udclim, 390);
// tolerate up to ten one off spikes
res = CheckVoltage();
assert(!res);
// drop out if received more than ten
for(int i =0; i < 15;i++){
res = CheckVoltage();
}
assert(res);
}