Compilation fix for VsnprintfTestCase with Catch

Rewrite an assert using "||" as 2 asserts to allow it compile with Catch
(this wasn't detected before as this code is only compiled when using
our own vsnprintf() implementation, which is usually not the case).
This commit is contained in:
Vadim Zeitlin
2017-11-22 13:52:48 +01:00
parent 166f754973
commit a50541795c

View File

@@ -552,8 +552,10 @@ void VsnprintfTestCase::DoMisc(
std::string errMsg(errStr.mb_str()); std::string errMsg(errStr.mb_str());
std::string overflowMsg(overflowStr.mb_str()); std::string overflowMsg(overflowStr.mb_str());
CPPUNIT_ASSERT_MESSAGE(errMsg, if ( size_t(n) < max )
(expectedLen == -1 && size_t(n) >= max) || expectedLen == n); CPPUNIT_ASSERT_MESSAGE(errMsg, expectedLen == n);
else
CPPUNIT_ASSERT_MESSAGE(errMsg, expectedLen == -1);
CPPUNIT_ASSERT_MESSAGE(errMsg, expectedString == buf); CPPUNIT_ASSERT_MESSAGE(errMsg, expectedString == buf);