diff options
Diffstat (limited to 'tests/test-vasnprintf-posix.c')
-rw-r--r-- | tests/test-vasnprintf-posix.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/tests/test-vasnprintf-posix.c b/tests/test-vasnprintf-posix.c index 51b1d26a33..33387c32e7 100644 --- a/tests/test-vasnprintf-posix.c +++ b/tests/test-vasnprintf-posix.c @@ -4145,14 +4145,9 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) char *result = my_asnprintf (NULL, &length, "%015.10x %d", 12348, 33, 44, 55); ASSERT (result != NULL); - /* 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 (length == strlen (result)); free (result); } @@ -4232,14 +4227,9 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) char *result = my_asnprintf (NULL, &length, "%0#15.10x %d", 12348, 33, 44, 55); ASSERT (result != NULL); - /* 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 (length == strlen (result)); free (result); } |