From 013078210b5618a35563c83fe37979d962690d22 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 12 Jul 2010 22:50:32 +0000 Subject: [PATCH] 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 --- tests/strings/vararg.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/strings/vararg.cpp b/tests/strings/vararg.cpp index c40ebf4..1aae2d1 100644 --- a/tests/strings/vararg.cpp +++ b/tests/strings/vararg.cpp @@ -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) ); -- 2.7.4