Skip to content
Snippets Groups Projects
Commit 3c58d9a2 authored by Martin Christoph Hierholzer's avatar Martin Christoph Hierholzer
Browse files

help debugging in case of test errors

parent 0929c190
No related branches found
No related tags found
No related merge requests found
......@@ -30,11 +30,17 @@ static bool testArrayContent(std::string const& propertyName, T testStartValue,
auto array = DoocsServerTestHelper::doocsGetArray<T>(propertyName);
bool isOK = true;
T currentTestValue = testStartValue;
size_t index = 0;
for(auto val : array) {
if(std::fabs(val - currentTestValue) > 0.001) {
if(isOK) {
std::cout << "Array " << propertyName << " does not contain expected values. First mismatching data at index "
<< index << ": " << val << " != " << currentTestValue << std::endl;
}
isOK = false;
}
currentTestValue += delta;
++index;
}
return isOK;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment