timer mocking

This commit is contained in:
Janosch
2022-10-10 22:34:56 +01:00
parent 5c8f5694f0
commit d7673cd292
11 changed files with 53 additions and 15 deletions
+20
View File
@@ -27,3 +27,23 @@ void test_calc_totals()
s32fp udcmax = Param::Get(Param::udc);
assert(366 == FP_TOINT(udcmax));
}
// TIMER NEEDED
void test_check_timeout()
{
bool res;
startTime = 11;
Param::SetInt(Param::test_time, 14 * 60);
Param::SetInt(Param::timelim, 13);
res = CheckTimeout();
assert(res);
Param::SetInt(Param::test_time, 12 * 60);
res = CheckTimeout();
assert(!res);
startTime = 1100;
res = CheckTimeout();
assert(res);
}