Commit 4bc67045 authored by Sujin Philip's avatar Sujin Philip Committed by Kitware Robot

Merge topic 'fix-UnitTestError'

5ca9a4bd Fix UnitTestError
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard's avatarRobert Maynard <robert.maynard@kitware.com>
Merge-request: !1897
parents 5c131984 5ca9a4bd
......@@ -47,14 +47,14 @@ void ValidateError(const vtkm::cont::Error& error)
}
else
{
std::string assert_msg = "StackTrace did not recurse: (" + std::to_string(count) + " <= 5)";
#if defined(NDEBUG)
VTKM_TEST_ASSERT(count > 5, assert_msg);
#else
// The compiler can optimize out the recursive function and any other functions in release
// mode, but the backtrace should contain atleast one entry
// The compiler can optimize out the recursion and other function calls in release
// mode, but the backtrace should contain atleast one entry.
std::string assert_msg = "No entries in the stack frame\n" + stackTrace;
VTKM_TEST_ASSERT(count >= 1, assert_msg);
#else
std::string assert_msg = "Expected more entries in the stack frame\n" + stackTrace;
VTKM_TEST_ASSERT(count > 5, assert_msg);
#endif
}
VTKM_TEST_ASSERT(test_equal(message, error.GetMessage()), "Message was incorrect");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment