initial commit for tests

This commit is contained in:
Janosch
2022-10-10 11:46:30 +01:00
commit 0e8e1e4db6
20 changed files with 1515 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
#ifndef TEST_STATE_H
#define TEST_STATE_H
#endif
#include <assert.h>
#include "test_common.h"
#include "functions.h"
void test_is_evse_input()
{
bool res = false;
res = IsEvseInput();
assert(res);
Param::SetInt(Param::inputype, INP_MANUAL);
res = IsEvseInput();
assert(!res);
}
void test_check_unplugged()
{
bool res = false;
Param::SetInt(Param::inputype, INP_TYPE1);
//TODO: surprising behaviour with Param::Set(Param::proximity, true); // as it expects s32fp
Param::SetInt(Param::proximity, 1);
res = CheckUnplugged();
assert(!res);
Param::SetInt(Param::proximity, 0);
res = CheckUnplugged();
assert(res);
}