mocked timer test, EvseRead

This commit is contained in:
Janosch
2022-10-11 00:05:01 +01:00
parent 52877fb3ea
commit 7b038d5243
10 changed files with 133 additions and 79 deletions
+23
View File
@@ -50,3 +50,26 @@ void test_check_timeout()
res = CheckTimeout();
assert(res);
}
void test_evse_read()
{
// INP_MANUAL
Param::SetInt(Param::inputype, INP_MANUAL);
EvseRead();
assert(0 == Param::GetInt(Param::proximity));
assert(32 == Param::GetInt(Param::cablelim));
// INP_TYPE1
//under threshold
Param::SetInt(Param::inputype, INP_TYPE1);
EvseRead();
assert(1 == Param::GetInt(Param::proximity));
assert(40 == Param::GetInt(Param::cablelim));
//above
Param::SetInt(Param::inputype, INP_TYPE1);
AnaIn::cablelim.Set(2222);
EvseRead();
assert(0 == Param::GetInt(Param::proximity));
assert(0 == Param::GetInt(Param::cablelim));
}