From a50541795c0d223119daff75d42a0333fe590d6c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 22 Nov 2017 13:52:48 +0100 Subject: [PATCH] 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). --- tests/strings/vsnprintf.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/strings/vsnprintf.cpp b/tests/strings/vsnprintf.cpp index f1ae32e8cd..3b082c53aa 100644 --- a/tests/strings/vsnprintf.cpp +++ b/tests/strings/vsnprintf.cpp @@ -552,8 +552,10 @@ void VsnprintfTestCase::DoMisc( std::string errMsg(errStr.mb_str()); std::string overflowMsg(overflowStr.mb_str()); - CPPUNIT_ASSERT_MESSAGE(errMsg, - (expectedLen == -1 && size_t(n) >= max) || expectedLen == n); + if ( size_t(n) < max ) + CPPUNIT_ASSERT_MESSAGE(errMsg, expectedLen == n); + else + CPPUNIT_ASSERT_MESSAGE(errMsg, expectedLen == -1); CPPUNIT_ASSERT_MESSAGE(errMsg, expectedString == buf);