test reset values
This commit is contained in:
@@ -11,4 +11,5 @@ void DisableAll();
|
||||
void EvseRead();
|
||||
bool CheckStartCondition();
|
||||
bool CheckVoltage();
|
||||
void ResetValuesInOffMode();
|
||||
#endif
|
||||
|
||||
Binary file not shown.
@@ -166,3 +166,14 @@ void EvseRead()
|
||||
}
|
||||
}
|
||||
|
||||
void ResetValuesInOffMode()
|
||||
{
|
||||
if (Param::GetInt(Param::state) == OFF)
|
||||
{
|
||||
for (int i = Param::c1stt; i <= Param::c3idc; i++)
|
||||
{
|
||||
Param::SetInt((Param::PARAM_NUM)i, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -241,17 +241,6 @@ static void CalcEnable()
|
||||
Param::SetInt(Param::enable, enable);
|
||||
}
|
||||
|
||||
static void ResetValuesInOffMode()
|
||||
{
|
||||
if (Param::GetInt(Param::state) == OFF)
|
||||
{
|
||||
for (int i = Param::c1stt; i <= Param::c3idc; i++)
|
||||
{
|
||||
Param::SetInt((Param::PARAM_NUM)i, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//sample 100ms task
|
||||
static void Ms100Task(void)
|
||||
{
|
||||
|
||||
@@ -25,6 +25,7 @@ int main() {
|
||||
(TestCase){"test_evse_read", test_evse_read},
|
||||
(TestCase){"test_check_start_condition", test_check_start_condition},
|
||||
(TestCase){"test_check_voltage", test_check_voltage},
|
||||
(TestCase){"test_reset_values_in_off_mode", test_reset_values_in_off_mode},
|
||||
// Example:
|
||||
//(TestCase){"Your tests name", function_name_without_brackets}
|
||||
//...
|
||||
|
||||
Binary file not shown.
@@ -168,3 +168,16 @@ void test_check_voltage(){
|
||||
}
|
||||
assert(res);
|
||||
}
|
||||
|
||||
void test_reset_values_in_off_mode(){
|
||||
Param::SetInt(Param::c1flag, 1);
|
||||
Param::SetInt(Param::c2tmp2, 15);
|
||||
Param::SetInt(Param::c3stt, 15);
|
||||
Param::SetInt(Param::c3uac, 239);
|
||||
assert(1 == Param::GetInt(Param::c1flag));
|
||||
ResetValuesInOffMode();
|
||||
assert(0 == Param::GetInt(Param::c1flag));
|
||||
assert(0 == Param::GetInt(Param::c2tmp2));
|
||||
assert(0 == Param::GetInt(Param::c3stt));
|
||||
assert(0 == Param::GetInt(Param::c3uac));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user