You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the "actual" value passed into CHECK_EQUAL is NULL, std::strcmp() will throw an exception in CheckStringsEqual(). Here's is my simple workaround:
voidCheckStringsEqual(TestResults& results, charconst* expected, charconst* actual, TestDetails const& details)
{
// WAS: if (std::strcmp(expected, actual))if (actual == NULL || std::strcmp(expected, actual))
{
UnitTest::MemoryOutStream stream;
// WAS: stream << "Expected " << expected << " but was " << actual;
stream << "Expected " << expected << " but was " << (actual ? actual : "(null)");
results.OnTestFailure(details, stream.GetText());
}
}
There are a few possible patches in the comments of the original bug to consider for incorporation. It should be noted, though, that the test does correctly fail on the CHECK_EQUAL invocation, so I marked this as an enhancement, as opposed to a bug.
The text was updated successfully, but these errors were encountered:
Copied from https://sourceforge.net/tracker/?func=detail&aid=1844387&group_id=158151&atid=806684
If the "actual" value passed into CHECK_EQUAL is NULL, std::strcmp() will throw an exception in CheckStringsEqual(). Here's is my simple workaround:
There are a few possible patches in the comments of the original bug to consider for incorporation. It should be noted, though, that the test does correctly fail on the CHECK_EQUAL invocation, so I marked this as an enhancement, as opposed to a bug.
The text was updated successfully, but these errors were encountered: