fix kernel panic (vector out of range) in getReadoutRawString

This commit is contained in:
Frank Haverland
2022-10-31 20:44:55 +01:00
parent b6b7587f0a
commit 2265563b23
4 changed files with 33 additions and 2 deletions

View File

@@ -0,0 +1,27 @@
#include "test_flow_postrocess_helper.h"
void test_getReadoutRawString() {
// no ROIs setted up
UnderTestPost* _undertestPost = setUpClassFlowPostprocessing(Digital100, Analogue100);
string result = _undertestPost->flowAnalog->getReadoutRawString(0);
TEST_ASSERT_EQUAL_STRING("", result.c_str());
// setted value
general* gen_analog = _undertestPost->flowAnalog->GetGENERAL("default", true);
gen_analog->ROI.clear();
roi* anaROI = new roi();
string name = "ana_1";
anaROI->name = name;
anaROI->result_float = 5.5;
gen_analog->ROI.push_back(anaROI);
result = _undertestPost->flowAnalog->getReadoutRawString(0);
TEST_ASSERT_EQUAL_STRING("\t5.5", result.c_str());
}