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
This commit is contained in:
Vadim Zeitlin 2010-09-30 14:30:23 +00:00
parent 32f6c515fd
commit cdd233ef81

View File

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