Disable test of format string with "%n" for MSVC 8+.

MSVC 8 and later disables support for "%n" in printf() by default. And
although it provides a function to re-enable support for it, it doesn't seem
to work for the functions we use.

Just disable the test which results in CRT assert when using this compiler.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64920 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2010-07-12 22:50:32 +00:00
parent 4193a1a4a4
commit 013078210b

View File

@ -196,8 +196,14 @@ void VarArgTestCase::ArgsValidation()
wxString::Format("a string(%s,%s), ptr %p, int %i",
wxString(), "foo", "char* as pointer", 1);
#if !wxCHECK_VISUALC_VERSION(8)
// Microsoft has helpfully disabled support for "%n" in their CRT by
// default starting from VC8 and somehow even calling
// _set_printf_count_output() doesn't help here, so just disable this test
// for it.
wxString::Format("foo%i%n", 42, &written);
CPPUNIT_ASSERT_EQUAL( 5, written );
#endif // VC8+
// but these are not:
WX_ASSERT_FAILS_WITH_ASSERT( wxString::Format("%i: too many arguments", 42, 1, 2, 3) );