Fix testings (#2783)

* fix all tests and more description

* The decimal point offset. -3 corresponds to x.yyy

---------

Co-authored-by: jomjol <30766535+jomjol@users.noreply.github.com>
This commit is contained in:
Frank Haverland
2023-12-31 14:43:08 +01:00
committed by GitHub
parent b5a4cfed96
commit 4f3f3d9af2
5 changed files with 57 additions and 13 deletions

View File

@@ -113,28 +113,28 @@ void test_doFlowPP1() {
// https://github.com/jomjol/AI-on-the-edge-device/issues/942#issuecomment-1226966346
std::vector<float> digits = { 0.0, 2.9, 3.0, 2.9, 3.5, 9.5};
std::vector<float> analogs = { };
const char* expected = "33330";
const char* expected = "33339";
std::string result = process_doFlow(analogs, digits);
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
// https://github.com/jomjol/AI-on-the-edge-device/issues/942#issuecomment-1226966346
digits = { 9.9, 2.8, 2.9, 2.9, 3.7, 9.7};
analogs = { };
expected = "33340";
expected = "33339";
result = process_doFlow(analogs, digits);
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
// https://github.com/jomjol/AI-on-the-edge-device/issues/942
digits = { 0.0, 9.9, 6.8, 9.9, 3.7, 0.8, 6.9, 8.7};
analogs = { };
expected = "704179";
expected = "704178";
result = process_doFlow(analogs, digits);
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
// https://github.com/jomjol/AI-on-the-edge-device/issues/942#issuecomment-1228343319
digits = { 9.9, 6.8, 1.1, 4.7, 2.7, 6.0, 9.0, 2.8}; // changed 3.7 --> 2.7 (see picture in issue)
analogs = { };
expected = "7153693";
expected = "7153692";
result = process_doFlow(analogs, digits);
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
@@ -184,7 +184,7 @@ void test_doFlowPP2() {
// https://github.com/jomjol/AI-on-the-edge-device/issues/921#issuecomment-1242730397
digits = { 3.0, 2.0, 2.0, 8.0, 9.0, 4.0, 1.7, 9.8}; // falscher Wert 32290.420
analogs = { };
expected = "32289.420";
expected = "32289.419";
const char* expected_extended= "32289.4198";
// FALSCH! wegen ungenügender Präzision von NUMBERS->Value
// expected_extended= "32289.4198";
@@ -229,7 +229,7 @@ void test_doFlowPP2() {
// https://github.com/jomjol/AI-on-the-edge-device/issues/994#issue-1368570945
digits = { 0.0, 0.0, 1.0, 2.0, 2.8, 1.9, 2.8, 5.6}; // 123245.6 als falsches Ergebnis
analogs = { };
expected = "123236";
expected = "123235";
expected_extended= "123235.6";
// checkConsistency=true