mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2026-01-31 06:40:49 +03:00
fix testcase creation if analog has no pointers
This commit is contained in:
@@ -866,8 +866,6 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
|
|||||||
|
|
||||||
void ClassFlowPostProcessing::WriteDataLog(int _index)
|
void ClassFlowPostProcessing::WriteDataLog(int _index)
|
||||||
{
|
{
|
||||||
LogFile.WriteToFile(ESP_LOG_WARN, "Data file writing temporarily disabled, see https://github.com/jomjol/AI-on-the-edge-device/issues/1225");
|
|
||||||
return;
|
|
||||||
string analog = "";
|
string analog = "";
|
||||||
string digital = "";
|
string digital = "";
|
||||||
string timezw = "";
|
string timezw = "";
|
||||||
|
|||||||
@@ -82,6 +82,8 @@ UnderTestPost* init_do_flow(std::vector<float> analog, std::vector<float> digits
|
|||||||
anaROI->result_float = analog[i];
|
anaROI->result_float = analog[i];
|
||||||
gen_analog->ROI.push_back(anaROI);
|
gen_analog->ROI.push_back(anaROI);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
_undertestPost->flowAnalog = NULL;
|
||||||
}
|
}
|
||||||
ESP_LOGD(TAG, "Setting up of ROIs completed.");
|
ESP_LOGD(TAG, "Setting up of ROIs completed.");
|
||||||
|
|
||||||
|
|||||||
@@ -108,11 +108,14 @@ void test_doFlowPP() {
|
|||||||
result = process_doFlow(analogs, digits);
|
result = process_doFlow(analogs, digits);
|
||||||
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_doFlowPP1() {
|
||||||
// https://github.com/jomjol/AI-on-the-edge-device/issues/942#issuecomment-1226966346
|
// https://github.com/jomjol/AI-on-the-edge-device/issues/942#issuecomment-1226966346
|
||||||
digits = { 0.0, 2.9, 3.0, 2.9, 3.5, 9.5};
|
std::vector<float> digits = { 0.0, 2.9, 3.0, 2.9, 3.5, 9.5};
|
||||||
analogs = { };
|
std::vector<float> analogs = { };
|
||||||
expected = "33330";
|
const char* expected = "33330";
|
||||||
result = process_doFlow(analogs, digits);
|
std::string result = process_doFlow(analogs, digits);
|
||||||
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
||||||
|
|
||||||
// https://github.com/jomjol/AI-on-the-edge-device/issues/942#issuecomment-1226966346
|
// https://github.com/jomjol/AI-on-the-edge-device/issues/942#issuecomment-1226966346
|
||||||
@@ -151,15 +154,13 @@ void test_doFlowPP() {
|
|||||||
expected = "377988.4";
|
expected = "377988.4";
|
||||||
result = process_doFlow(analogs, digits);
|
result = process_doFlow(analogs, digits);
|
||||||
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
||||||
}
|
|
||||||
|
|
||||||
void test_doFlowPP1() {
|
|
||||||
// Fehler bei V11.2.0
|
// Fehler bei V11.2.0
|
||||||
// https://github.com/jomjol/AI-on-the-edge-device/issues/921#issuecomment-1233149877
|
// https://github.com/jomjol/AI-on-the-edge-device/issues/921#issuecomment-1233149877
|
||||||
std::vector<float> digits = { 0.0, 0.0, 7.0, 8.9}; // 79.9999(6) als falsches Ergebnis
|
digits = { 0.0, 0.0, 7.0, 8.9}; // 79.9999(6) als falsches Ergebnis
|
||||||
std::vector<float> analogs = { 0.1, 0.1, 0.1, 9.6};
|
analogs = { 0.1, 0.1, 0.1, 9.6};
|
||||||
const char* expected = "78.9999";
|
expected = "78.9999";
|
||||||
std::string result = process_doFlow(analogs, digits);
|
result = process_doFlow(analogs, digits);
|
||||||
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
||||||
|
|
||||||
// Fehler bei V11.2.0
|
// Fehler bei V11.2.0
|
||||||
|
|||||||
Reference in New Issue
Block a user