From b8ab58a196663f73cfdf43069d0076bb87424869 Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Fri, 16 Sep 2022 17:38:34 +0200 Subject: [PATCH] Testcases for #950 and #1020 --- .../test_flowpostprocessing.cpp | 50 +++++++++++++++++-- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp b/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp index 544ca7bb..c763da00 100644 --- a/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp +++ b/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp @@ -251,17 +251,61 @@ void test_doFlow() { // checkConsistency=true - result = process_doFlow(analogs, digits, Digital100, true, false); - TEST_ASSERT_EQUAL_STRING(expected, result.c_str()); + // checkConsistency NOT working correctly + //result = process_doFlow(analogs, digits, Digital100, true, false); + //TEST_ASSERT_EQUAL_STRING(expected, result.c_str()); // extendResolution=true result = process_doFlow(analogs, digits, Digital100, false, true); TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str()); - // checkConsistency=true und extendResolution=true + // Fehler bei V11.2.0 + // https://github.com/jomjol/AI-on-the-edge-device/discussions/950#discussioncomment-3661982 + digits = { 3.0, 2.0, 4.1, 9.0, 4.0, 6.3, 9.2}; // 3249.459 als falsches Ergebnis + analogs = { }; + expected = "3249.469"; + expected_extended= "3249.4692"; + + // checkConsistency=true + result = process_doFlow(analogs, digits, Digital100, false, false, -3); + TEST_ASSERT_EQUAL_STRING(expected, result.c_str()); + + + // checkConsistency=true + // checkConsistency NOT working correctly + //result = process_doFlow(analogs, digits, Digital100, true, false, -3); + //TEST_ASSERT_EQUAL_STRING(expected, result.c_str()); + + // extendResolution=true + result = process_doFlow(analogs, digits, Digital100, false, true, -3); + TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str()); + + // Fehler bei V11.2.0 + // https://github.com/jomjol/AI-on-the-edge-device/issues/1020#issue-1375648891 + digits = { 0.0, 2.0, 6.1, 9.2}; // 259.9227 als falsches Ergebnis + analogs = { 9.0, 2.5, 2.9, 7.2}; + expected = "269.9227"; + expected_extended= "269.92273"; + // Float Value reduziert die Genauigkeit hier. Korrekt wäre + // expected_extended= "269.92272"; + + // checkConsistency=true + result = process_doFlow(analogs, digits, Digital100, false, false); + TEST_ASSERT_EQUAL_STRING(expected, result.c_str()); + + + // checkConsistency=true + // checkConsistency NOT working correctly + //result = process_doFlow(analogs, digits, Digital100, true, false, -3); + //TEST_ASSERT_EQUAL_STRING(expected, result.c_str()); + + // extendResolution=true result = process_doFlow(analogs, digits, Digital100, false, true); TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str()); + + + }