-void VsnprintfTestCase::Misc(wxChar *buffer, int size)
-{
- // NB: remember that wx*printf could be mapped either to system
- // implementation or to wx implementation.
- // In the first case, when the output buffer is too small, the returned
- // value can be the number of characters required for the output buffer
- // (conforming to ISO C99; implemented in e.g. GNU libc >= 2.1), or
- // just a negative number, usually -1; (this is how e.g. MSVC's
- // *printf() behaves). Luckily, in all implementations, when the
- // output buffer is too small, it's nonetheless filled up to its max
- // size.
- //
- // Note that in the second case (i.e. when we're using our own implementation),
- // wxVsnprintf() will always return the number of characters which
-
- // test without positionals
- CMPTOSIZE(buffer, size, "123 444444444 - test - 555 -0.666",
- "%i %li - test - %d %.3f",
- 123, (long int)444444444, 555, -0.666);
-
-#if wxUSE_PRINTF_POS_PARAMS
- // test with positional
- CMPTOSIZE(buffer, size, "-0.666 123 - test - 444444444 555",
- "%4$.3f %1$i - test - %2$li %3$d",
- 123, (long int)444444444, 555, -0.666);
-#endif
-
- // test unicode/ansi conversion specifiers
- // NB: this line will output two warnings like these, on GCC:
- // warning: use of 'h' length modifier with 's' type character (i.e.
- // GCC warns you that 'h' is not legal on 's' conv spec) but they must
- // be ignored as here we explicitely want to test the wxSnprintf()
- // behaviour in such case
-
- CMPTOSIZE(buffer, size,
- "unicode string: unicode!! W - ansi string: ansi!! w\n\n",
- "unicode string: %ls %lc - ansi string: %hs %hc\n\n",
- L"unicode!!", L'W', "ansi!!", 'w');
-}