test_check_delay

This commit is contained in:
Janosch
2022-10-11 13:28:13 +01:00
parent e54de68605
commit 8e61ddd188
7 changed files with 34 additions and 8 deletions
+1
View File
@@ -21,6 +21,7 @@ int main() {
(TestCase){"test_disable_all", test_disable_all},
(TestCase){"test_calc_totals", test_calc_totals},
(TestCase){"test_check_timeout", test_check_timeout},
(TestCase){"test_check_delay", test_check_delay},
(TestCase){"test_evse_read", test_evse_read},
(TestCase){"test_check_start_condition", test_check_start_condition},
(TestCase){"test_check_voltage", test_check_voltage},
BIN
View File
Binary file not shown.
+23
View File
@@ -52,6 +52,29 @@ void test_check_timeout()
assert(res);
}
void test_check_delay()
{
bool res;
startTime = 11;
//after delay
Param::SetInt(Param::test_time, 14 * 60);
Param::SetInt(Param::timedly, 13);
res = CheckDelay();
assert(res);
//before delay
Param::SetInt(Param::test_time, 12 * 60);
res = CheckDelay();
assert(!res);
//start time changes result
startTime = 1100;
res = CheckDelay();
assert(res);
}
void test_evse_read()
{
// INP_MANUAL