Commit 5ca9a4bd authored by Sujin Philip's avatar Sujin Philip

Fix UnitTestError

The previous changes were incorrect and did not fix the problem.
parent 5c131984
......@@ -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