diff options
author | Bruno Haible <bruno@clisp.org> | 2023-04-24 10:57:16 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2023-04-24 10:57:16 +0200 |
commit | ebdce3b64e3ff04daafb742fde8823de4b6ce80f (patch) | |
tree | 3d08fd29229761817d88ca18d6dba41f43233f40 /tests | |
parent | f187e34f8874dc0e14d0c79fe5f92e59f4d03a63 (diff) | |
download | gnulib-ebdce3b64e3ff04daafb742fde8823de4b6ce80f.tar.gz |
*sprintf tests: Avoid test failures on mingw 10.
* tests/test-vasnprintf-posix.c (test_function): On newer mingw, expect
the de-facto standard result.
* tests/test-vasprintf-posix.c (test_function): Likewise.
* tests/test-snprintf-posix.h (test_function): Likewise.
* tests/test-sprintf-posix.h (test_function): Likewise.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-snprintf-posix.h | 6 | ||||
-rw-r--r-- | tests/test-sprintf-posix.h | 6 | ||||
-rw-r--r-- | tests/test-vasnprintf-posix.c | 6 | ||||
-rw-r--r-- | tests/test-vasprintf-posix.c | 6 |
4 files changed, 16 insertions, 8 deletions
diff --git a/tests/test-snprintf-posix.h b/tests/test-snprintf-posix.h index 90fcf61c5a..5b81910ec3 100644 --- a/tests/test-snprintf-posix.h +++ b/tests/test-snprintf-posix.h @@ -3190,7 +3190,8 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) /* 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); + ASSERT (strcmp (result, "00000000000303c 33") == 0 /* mingw 5 */ + || strcmp (result, " 000000303c 33") == 0 /* mingw 10 */); #else ASSERT (strcmp (result, " 000000303c 33") == 0); #endif @@ -3252,7 +3253,8 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) /* 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); + ASSERT (strcmp (result, "0x000000000303c 33") == 0 /* mingw 5 */ + || strcmp (result, " 0x000000303c 33") == 0 /* mingw 10 */); #else ASSERT (strcmp (result, " 0x000000303c 33") == 0); #endif diff --git a/tests/test-sprintf-posix.h b/tests/test-sprintf-posix.h index 6ea2052186..a0b5eb3391 100644 --- a/tests/test-sprintf-posix.h +++ b/tests/test-sprintf-posix.h @@ -3166,7 +3166,8 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) /* 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); + ASSERT (strcmp (result, "00000000000303c 33") == 0 /* mingw 5 */ + || strcmp (result, " 000000303c 33") == 0 /* mingw 10 */); #else ASSERT (strcmp (result, " 000000303c 33") == 0); #endif @@ -3228,7 +3229,8 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) /* 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); + ASSERT (strcmp (result, "0x000000000303c 33") == 0 /* mingw 5 */ + || strcmp (result, " 0x000000303c 33") == 0 /* mingw 10 */); #else ASSERT (strcmp (result, " 0x000000303c 33") == 0); #endif diff --git a/tests/test-vasnprintf-posix.c b/tests/test-vasnprintf-posix.c index 9eb042c552..51b1d26a33 100644 --- a/tests/test-vasnprintf-posix.c +++ b/tests/test-vasnprintf-posix.c @@ -4148,7 +4148,8 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) /* 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); + ASSERT (strcmp (result, "00000000000303c 33") == 0 /* mingw 5 */ + || strcmp (result, " 000000303c 33") == 0 /* mingw 10 */); #else ASSERT (strcmp (result, " 000000303c 33") == 0); #endif @@ -4234,7 +4235,8 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) /* 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); + ASSERT (strcmp (result, "0x000000000303c 33") == 0 /* mingw 5 */ + || strcmp (result, " 0x000000303c 33") == 0 /* mingw 10 */); #else ASSERT (strcmp (result, " 0x000000303c 33") == 0); #endif diff --git a/tests/test-vasprintf-posix.c b/tests/test-vasprintf-posix.c index e4cc0fb983..858a477a43 100644 --- a/tests/test-vasprintf-posix.c +++ b/tests/test-vasprintf-posix.c @@ -4089,7 +4089,8 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) /* 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); + ASSERT (strcmp (result, "00000000000303c 33") == 0 /* mingw 5 */ + || strcmp (result, " 000000303c 33") == 0 /* mingw 10 */); #else ASSERT (strcmp (result, " 000000303c 33") == 0); #endif @@ -4175,7 +4176,8 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) /* 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); + ASSERT (strcmp (result, "0x000000000303c 33") == 0 /* mingw 5 */ + || strcmp (result, " 0x000000303c 33") == 0 /* mingw 10 */); #else ASSERT (strcmp (result, " 0x000000303c 33") == 0); #endif |