diff options
Diffstat (limited to 'tests/test-vasprintf-posix.c')
-rw-r--r-- | tests/test-vasprintf-posix.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/tests/test-vasprintf-posix.c b/tests/test-vasprintf-posix.c index 858a477a43..897109537f 100644 --- a/tests/test-vasprintf-posix.c +++ b/tests/test-vasprintf-posix.c @@ -4086,14 +4086,9 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) int retval = my_asprintf (&result, "%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 (retval == strlen (result)); free (result); } @@ -4173,14 +4168,9 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) int retval = my_asprintf (&result, "%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 (retval == strlen (result)); free (result); } |