+void VsnprintfTestCase::C()
+{
+ CMP5("hi!", "%c%c%c", wxT('h'), wxT('i'), wxT('!'));
+
+ // NOTE:
+ // the NULL characters _can_ be passed to %c to e.g. create strings
+ // with embedded NULs (because strings are not always supposed to be
+ // NUL-terminated).
+
+ DoMisc(14, wxT("Hello \0 World!"), 16, wxT("Hello %c World!"), wxT('\0'));
+}
+
+void VsnprintfTestCase::D()
+{
+ CMP3("+123456", "%+d", 123456);
+ CMP3("-123456", "%d", -123456);
+ CMP3(" 123456", "% d", 123456);
+ CMP3(" 123456", "%10d", 123456);
+ CMP3("0000123456", "%010d", 123456);
+ CMP3("-123456 ", "%-10d", -123456);
+}
+
+void VsnprintfTestCase::X()
+{
+ CMP3("ABCD", "%X", 0xABCD);
+ CMP3("0XABCD", "%#X", 0xABCD);
+ CMP3("0xabcd", "%#x", 0xABCD);
+}
+
+void VsnprintfTestCase::O()
+{
+ CMP3("1234567", "%o", 01234567);
+ CMP3("01234567", "%#o", 01234567);
+}
+
+void VsnprintfTestCase::P()
+{
+ // WARNING: printing of pointers is not fully standard.
+ // GNU prints them as %#x except for NULL pointers which are
+ // printed as '(nil)'.
+ // MSVC always print them as %8X on 32 bit systems and as %16X
+ // on 64 bit systems
+#ifdef __VISUALC__
+ #if SIZEOF_VOID_P == 4
+ CMP3("00ABCDEF", "%p", (void*)0xABCDEF);
+ CMP3("00000000", "%p", (void*)NULL);
+ #elif SIZEOF_VOID_P == 8
+ CMP3("0000ABCDEFABCDEF", "%p", (void*)0xABCDEFABCDEF);
+ CMP3("0000000000000000", "%p", (void*)NULL);
+ #endif
+#elif defined(__GNUG__)
+ CMP3("0xabcdef", "%p", (void*)0xABCDEF);
+ CMP3("(nil)", "%p", (void*)NULL);
+#endif
+}
+
+void VsnprintfTestCase::N()
+{
+ int nchar;
+
+ wxSnprintf(buf, MAX_TEST_LEN, _T("%d %s%n\n"), 3, _T("bears"), &nchar);
+ CPPUNIT_ASSERT_EQUAL( 7, nchar );
+}
+