]> git.saurik.com Git - wxWidgets.git/commitdiff
Disable test of format string with "%n" for MSVC 8+.
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 12 Jul 2010 22:50:32 +0000 (22:50 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 12 Jul 2010 22:50:32 +0000 (22:50 +0000)
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

tests/strings/vararg.cpp

index c40ebf4c58059532ed33cb73abd2f75e4a1454f6..1aae2d1434892e8a8b14957bcbb30506049c6ff6 100644 (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) );