mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-10 21:46:55 +03:00
added transistion tests.
This commit is contained in:
@@ -584,3 +584,52 @@ void test_doFlowPP_rainman110() {
|
|||||||
Digital100, false, false, 0).c_str());
|
Digital100, false, false, 0).c_str());
|
||||||
delete undertestPost;
|
delete undertestPost;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void test_doFlowPP_rainman110_transition() {
|
||||||
|
|
||||||
|
// https://github.com/jomjol/AI-on-the-edge-device/pull/2887
|
||||||
|
// Edge cases
|
||||||
|
std::vector<float> digits = {4.0, 1.0, 7.9};
|
||||||
|
std::vector<float> analogs = {1.4, 5.8, 7.7, 9.0};
|
||||||
|
|
||||||
|
UnderTestPost* undertestPost = init_do_flow(analogs, digits, Digital100, false, false, 0);
|
||||||
|
setAnalogdigitTransistionStart(undertestPost, 3.5);
|
||||||
|
std::string result = process_doFlow(undertestPost);
|
||||||
|
TEST_ASSERT_EQUAL_STRING("418.1579", result.c_str());
|
||||||
|
delete undertestPost;
|
||||||
|
|
||||||
|
// https://github.com/jomjol/AI-on-the-edge-device/pull/2887
|
||||||
|
// Edge cases
|
||||||
|
digits = {4.0, 1.0, 7.9};
|
||||||
|
analogs = {3.4, 5.8, 7.7, 9.0};
|
||||||
|
|
||||||
|
undertestPost = init_do_flow(analogs, digits, Digital100, false, false, 0);
|
||||||
|
setAnalogdigitTransistionStart(undertestPost, 3.5);
|
||||||
|
result = process_doFlow(undertestPost);
|
||||||
|
TEST_ASSERT_EQUAL_STRING("418.3579", result.c_str());
|
||||||
|
delete undertestPost;
|
||||||
|
|
||||||
|
// https://github.com/jomjol/AI-on-the-edge-device/pull/2887
|
||||||
|
// Edge cases
|
||||||
|
digits = {4.0, 1.0, 8.5};
|
||||||
|
analogs = {3.7, 5.8, 7.7, 9.0};
|
||||||
|
|
||||||
|
undertestPost = init_do_flow(analogs, digits, Digital100, false, false, 0);
|
||||||
|
setAnalogdigitTransistionStart(undertestPost, 3.5);
|
||||||
|
result = process_doFlow(undertestPost);
|
||||||
|
TEST_ASSERT_EQUAL_STRING("418.3579", result.c_str());
|
||||||
|
delete undertestPost;
|
||||||
|
|
||||||
|
// https://github.com/jomjol/AI-on-the-edge-device/pull/2887
|
||||||
|
// Edge cases
|
||||||
|
digits = {4.0, 1.0, 8.9};
|
||||||
|
analogs = {4.0, 5.8, 7.7, 9.0};
|
||||||
|
|
||||||
|
undertestPost = init_do_flow(analogs, digits, Digital100, false, false, 0);
|
||||||
|
setAnalogdigitTransistionStart(undertestPost, 3.5);
|
||||||
|
result = process_doFlow(undertestPost);
|
||||||
|
TEST_ASSERT_EQUAL_STRING("418.4579", result.c_str());
|
||||||
|
delete undertestPost;
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -140,6 +140,8 @@ void task_UnityTesting(void *pvParameter)
|
|||||||
RUN_TEST(test_doFlowPP4);
|
RUN_TEST(test_doFlowPP4);
|
||||||
printf("---------------------------------------------------------------------------\n");
|
printf("---------------------------------------------------------------------------\n");
|
||||||
RUN_TEST(test_doFlowPP_rainman110);
|
RUN_TEST(test_doFlowPP_rainman110);
|
||||||
|
printf("---------------------------------------------------------------------------\n");
|
||||||
|
RUN_TEST(test_doFlowPP_rainman110_transition);
|
||||||
UNITY_END();
|
UNITY_END();
|
||||||
|
|
||||||
while(1);
|
while(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user