From cdd233ef81ca2bb104347080ba1e4c2d40fead45 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 30 Sep 2010 14:30:23 +0000 Subject: [PATCH] Expect an assert in wxVsnprintf() test with too many parameters. The call to wxPrintf() should provoke an assert if there are too many parameters, so update the test to expect it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65688 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- tests/strings/vsnprintf.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/strings/vsnprintf.cpp b/tests/strings/vsnprintf.cpp index 142884e66f..59e5ea60ab 100644 --- a/tests/strings/vsnprintf.cpp +++ b/tests/strings/vsnprintf.cpp @@ -447,10 +447,9 @@ void VsnprintfTestCase::WrongFormatStrings() CPPUNIT_ASSERT(r != -1); #endif - // a missing positional arg: this should result in an error but not all - // implementations detect it (e.g. glibc doesn't) - r = wxSnprintf(buf, MAX_TEST_LEN, wxT("%1$d %3$d"), 1, 2, 3); - CPPUNIT_ASSERT_EQUAL(-1, r); + // a missing positional arg should result in an assert + WX_ASSERT_FAILS_WITH_ASSERT( + wxSnprintf(buf, MAX_TEST_LEN, wxT("%1$d %3$d"), 1, 2, 3) ); // positional and non-positionals in the same format string: r = wxSnprintf(buf, MAX_TEST_LEN, wxT("%1$d %d %3$d"), 1, 2, 3); -- 2.47.2