diff options
Diffstat (limited to 'tests/test-sprintf-posix.h')
-rw-r--r-- | tests/test-sprintf-posix.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test-sprintf-posix.h b/tests/test-sprintf-posix.h index d2f0e579ea..6ea2052186 100644 --- a/tests/test-sprintf-posix.h +++ b/tests/test-sprintf-posix.h @@ -3067,6 +3067,22 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) ASSERT (memcmp (result, "az 33\0", 5 + 1) == 0); ASSERT (retval == 5); } + + static wint_t L_invalid = (wchar_t) 0x76543210; + + { /* Invalid wide character. + The conversion may succeed or may fail, but it should not abort. */ + int retval = + my_sprintf (result, "%lc %d", L_invalid, 33, 44, 55); + (void) retval; + } + + { /* Invalid wide character and width. + The conversion may succeed or may fail, but it should not abort. */ + int retval = + my_sprintf (result, "%10lc %d", L_invalid, 33, 44, 55); + (void) retval; + } #endif /* Test the support of the 'x' conversion specifier for hexadecimal output of |