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
CPPUNIT_ASSERT(r != -1);
#endif
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);
// positional and non-positionals in the same format string:
r = wxSnprintf(buf, MAX_TEST_LEN, wxT("%1$d %d %3$d"), 1, 2, 3);