diff options
Diffstat (limited to 'tests/test-sprintf-posix.h')
-rw-r--r-- | tests/test-sprintf-posix.h | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/tests/test-sprintf-posix.h b/tests/test-sprintf-posix.h index a0b5eb3391..c0957a6967 100644 --- a/tests/test-sprintf-posix.h +++ b/tests/test-sprintf-posix.h @@ -3163,14 +3163,9 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) { /* Padding and precision. */ int retval = my_sprintf (result, "%015.10x %d", 12348, 33, 44, 55); - /* Neither ISO C nor POSIX specify that the '0' flag is ignored when a width - and a precision are both present. But most implementations do so. */ - #ifdef __MINGW32__ - ASSERT (strcmp (result, "00000000000303c 33") == 0 /* mingw 5 */ - || strcmp (result, " 000000303c 33") == 0 /* mingw 10 */); - #else + /* ISO C 99 § 7.19.6.1.(6) says: "For d, i, o, u, x, and X conversions, if a + precision is specified, the 0 flag is ignored." */ ASSERT (strcmp (result, " 000000303c 33") == 0); - #endif ASSERT (retval == strlen (result)); } @@ -3226,14 +3221,9 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) { /* FLAG_ALT with a positive number and padding and precision. */ int retval = my_sprintf (result, "%0#15.10x %d", 12348, 33, 44, 55); - /* Neither ISO C nor POSIX specify that the '0' flag is ignored when a width - and a precision are both present. But most implementations do so. */ - #ifdef __MINGW32__ - ASSERT (strcmp (result, "0x000000000303c 33") == 0 /* mingw 5 */ - || strcmp (result, " 0x000000303c 33") == 0 /* mingw 10 */); - #else + /* ISO C 99 § 7.19.6.1.(6) says: "For d, i, o, u, x, and X conversions, if a + precision is specified, the 0 flag is ignored." */ ASSERT (strcmp (result, " 0x000000303c 33") == 0); - #endif ASSERT (retval == strlen (result)); } |