[IE TESTS] Fix issue with assert (Failed tests are reported as ) (#4794)

This commit is contained in:
Irina Efode 2021-03-16 12:59:45 +03:00 committed by GitHub
parent 9df8502bc8
commit 72c66b1a91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -180,10 +180,11 @@ public:
const auto max = std::max(CommonTestUtils::ie_abs(res), CommonTestUtils::ie_abs(ref));
float diff = static_cast<float>(absoluteDifference) / static_cast<float>(max);
ASSERT_TRUE(max != 0 && (diff <= static_cast<float>(threshold)))
<< "Relative comparison of values expected: " << ref << " and actual: " << res
<< " at index " << i << " with threshold " << threshold
<< " failed";
if (max == 0 || (diff > static_cast<float>(threshold))) {
THROW_IE_EXCEPTION << "Relative comparison of values expected: " << ref << " and actual: " << res
<< " at index " << i << " with threshold " << threshold
<< " failed";
}
}
}