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);