From 94c7aff8c173175ba0ca6347c6567e66857a49f0 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 13 Oct 2023 02:39:05 +0200 Subject: [PATCH] *printf tests: Test printing of signalling NaNs. These tests run without sigfpe_on_invalid(), therefore they won't crash. * tests/test-vasnprintf-posix.c: Include snan.h. (test_function): For each test case that uses NaNd or NaNl, add a test case with SNaNd or SNaNl, respectively. * tests/test-vasprintf-posix.c: Likewise. * tests/test-snprintf-posix.h: Likewise. * tests/test-sprintf-posix.h: Likewise. * tests/test-vasnwprintf-posix.c: Likewise. * modules/vasnprintf-posix-tests (Depends-on): Add snan. * modules/vasprintf-posix-tests (Depends-on): Likewise. * modules/vsnprintf-posix-tests (Depends-on): Likewise. * modules/snprintf-posix-tests (Depends-on): Likewise. * modules/vsprintf-posix-tests (Depends-on): Likewise. * modules/sprintf-posix-tests (Depends-on): Likewise. * modules/vasnwprintf-posix-tests (Depends-on): Likewise. * modules/pipe-filter-gi-tests (Depends-on): Likewise. * modules/pipe-filter-ii-tests (Depends-on): Likewise. --- ChangeLog | 21 +++++ modules/pipe-filter-gi-tests | 1 + modules/pipe-filter-ii-tests | 1 + modules/snprintf-posix-tests | 1 + modules/sprintf-posix-tests | 1 + modules/vasnprintf-posix-tests | 1 + modules/vasnwprintf-posix-tests | 1 + modules/vasprintf-posix-tests | 1 + modules/vsnprintf-posix-tests | 1 + modules/vsprintf-posix-tests | 1 + tests/test-snprintf-posix.h | 101 ++++++++++++++++++++++++ tests/test-sprintf-posix.h | 101 ++++++++++++++++++++++++ tests/test-vasnprintf-posix.c | 131 ++++++++++++++++++++++++++++++++ tests/test-vasnwprintf-posix.c | 131 ++++++++++++++++++++++++++++++++ tests/test-vasprintf-posix.c | 131 ++++++++++++++++++++++++++++++++ 15 files changed, 625 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7112234f8f..100179f0dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2023-10-12 Bruno Haible + + *printf tests: Test printing of signalling NaNs. + These tests run without sigfpe_on_invalid(), therefore they won't crash. + * tests/test-vasnprintf-posix.c: Include snan.h. + (test_function): For each test case that uses NaNd or NaNl, add a test + case with SNaNd or SNaNl, respectively. + * tests/test-vasprintf-posix.c: Likewise. + * tests/test-snprintf-posix.h: Likewise. + * tests/test-sprintf-posix.h: Likewise. + * tests/test-vasnwprintf-posix.c: Likewise. + * modules/vasnprintf-posix-tests (Depends-on): Add snan. + * modules/vasprintf-posix-tests (Depends-on): Likewise. + * modules/vsnprintf-posix-tests (Depends-on): Likewise. + * modules/snprintf-posix-tests (Depends-on): Likewise. + * modules/vsprintf-posix-tests (Depends-on): Likewise. + * modules/sprintf-posix-tests (Depends-on): Likewise. + * modules/vasnwprintf-posix-tests (Depends-on): Likewise. + * modules/pipe-filter-gi-tests (Depends-on): Likewise. + * modules/pipe-filter-ii-tests (Depends-on): Likewise. + 2023-10-12 Bruno Haible nan, snan tests: Avoid test failures. diff --git a/modules/pipe-filter-gi-tests b/modules/pipe-filter-gi-tests index 6cca323eed..fdbdfc8c5f 100644 --- a/modules/pipe-filter-gi-tests +++ b/modules/pipe-filter-gi-tests @@ -10,6 +10,7 @@ tests/macros.h Depends-on: binary-io c-ctype +snan read-file full-write usleep diff --git a/modules/pipe-filter-ii-tests b/modules/pipe-filter-ii-tests index 48d4674b01..ebdfe8c29f 100644 --- a/modules/pipe-filter-ii-tests +++ b/modules/pipe-filter-ii-tests @@ -10,6 +10,7 @@ tests/macros.h Depends-on: binary-io c-ctype +snan read-file full-write diff --git a/modules/snprintf-posix-tests b/modules/snprintf-posix-tests index 9369b63373..54c83ec31b 100644 --- a/modules/snprintf-posix-tests +++ b/modules/snprintf-posix-tests @@ -11,6 +11,7 @@ Depends-on: stdint float nan +snan configure.ac: AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) diff --git a/modules/sprintf-posix-tests b/modules/sprintf-posix-tests index ff6b4163cc..c8723c5c41 100644 --- a/modules/sprintf-posix-tests +++ b/modules/sprintf-posix-tests @@ -10,6 +10,7 @@ Depends-on: stdint float nan +snan configure.ac: AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) diff --git a/modules/vasnprintf-posix-tests b/modules/vasnprintf-posix-tests index 4880abff43..da38834d54 100644 --- a/modules/vasnprintf-posix-tests +++ b/modules/vasnprintf-posix-tests @@ -13,6 +13,7 @@ Depends-on: stdint float nan +snan setlocale configure.ac: diff --git a/modules/vasnwprintf-posix-tests b/modules/vasnwprintf-posix-tests index ec90686c93..47acf8d427 100644 --- a/modules/vasnwprintf-posix-tests +++ b/modules/vasnwprintf-posix-tests @@ -14,6 +14,7 @@ Depends-on: stdint float nan +snan setlocale wcscmp wcsspn diff --git a/modules/vasprintf-posix-tests b/modules/vasprintf-posix-tests index 144a192275..1353d5ca28 100644 --- a/modules/vasprintf-posix-tests +++ b/modules/vasprintf-posix-tests @@ -8,6 +8,7 @@ Depends-on: stdint float nan +snan configure.ac: AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) diff --git a/modules/vsnprintf-posix-tests b/modules/vsnprintf-posix-tests index 4e1b497b7b..336ccab037 100644 --- a/modules/vsnprintf-posix-tests +++ b/modules/vsnprintf-posix-tests @@ -11,6 +11,7 @@ Depends-on: stdint float nan +snan configure.ac: AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) diff --git a/modules/vsprintf-posix-tests b/modules/vsprintf-posix-tests index 05483d9f46..4c79b2aef1 100644 --- a/modules/vsprintf-posix-tests +++ b/modules/vsprintf-posix-tests @@ -10,6 +10,7 @@ Depends-on: stdint float nan +snan configure.ac: AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) diff --git a/tests/test-snprintf-posix.h b/tests/test-snprintf-posix.h index 482335a3ef..a71b73f050 100644 --- a/tests/test-snprintf-posix.h +++ b/tests/test-snprintf-posix.h @@ -19,6 +19,7 @@ #include "minus-zero.h" #include "infinity.h" #include "nan.h" +#include "snan.h" /* The SGI MIPS floating-point format does not distinguish 0.0 and -0.0. */ static int @@ -195,6 +196,16 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) && strcmp (result + strlen (result) - 3, " 33") == 0); ASSERT (retval == strlen (result)); } +#if HAVE_SNAND + { /* Signalling NaN. */ + int retval = + my_snprintf (result, sizeof (result), "%a %d", SNaNd (), 33, 44, 55); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (retval == strlen (result)); + } +#endif { /* Rounding near the decimal point. */ int retval = @@ -456,6 +467,16 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) && strcmp (result + strlen (result) - 3, " 33") == 0); ASSERT (retval == strlen (result)); } +#if HAVE_SNANL + { /* Signalling NaN. */ + int retval = + my_snprintf (result, sizeof (result), "%La %d", SNaNl (), 33, 44, 55); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (retval == strlen (result)); + } +#endif #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = @@ -873,6 +894,16 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) && strcmp (result + strlen (result) - 3, " 33") == 0); ASSERT (retval == strlen (result)); } +#if HAVE_SNAND + { /* Signalling NaN. */ + int retval = + my_snprintf (result, sizeof (result), "%f %d", SNaNd (), 33, 44, 55); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (retval == strlen (result)); + } +#endif { /* Width. */ int retval = @@ -1123,6 +1154,16 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) && strcmp (result + strlen (result) - 3, " 33") == 0); ASSERT (retval == strlen (result)); } +#if HAVE_SNANL + { /* Signalling NaN. */ + int retval = + my_snprintf (result, sizeof (result), "%Lf %d", SNaNl (), 33, 44, 55); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (retval == strlen (result)); + } +#endif #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = @@ -1351,6 +1392,16 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) && strcmp (result + strlen (result) - 3, " 33") == 0); ASSERT (retval == strlen (result)); } +#if HAVE_SNAND + { /* Signalling NaN. */ + int retval = + my_snprintf (result, sizeof (result), "%F %d", SNaNd (), 33, 44, 55); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 1) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (retval == strlen (result)); + } +#endif { /* FLAG_ZERO. */ int retval = @@ -1448,6 +1499,16 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) && strcmp (result + strlen (result) - 3, " 33") == 0); ASSERT (retval == strlen (result)); } +#if HAVE_SNANL + { /* Signalling NaN. */ + int retval = + my_snprintf (result, sizeof (result), "%LF %d", SNaNl (), 33, 44, 55); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 1) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (retval == strlen (result)); + } +#endif { /* FLAG_ZERO. */ int retval = @@ -1648,6 +1709,16 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) && strcmp (result + strlen (result) - 3, " 33") == 0); ASSERT (retval == strlen (result)); } +#if HAVE_SNAND + { /* Signalling NaN. */ + int retval = + my_snprintf (result, sizeof (result), "%e %d", SNaNd (), 33, 44, 55); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (retval == strlen (result)); + } +#endif { /* Width. */ int retval = @@ -1931,6 +2002,16 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) && strcmp (result + strlen (result) - 3, " 33") == 0); ASSERT (retval == strlen (result)); } +#if HAVE_SNANL + { /* Signalling NaN. */ + int retval = + my_snprintf (result, sizeof (result), "%Le %d", SNaNl (), 33, 44, 55); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (retval == strlen (result)); + } +#endif #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = @@ -2277,6 +2358,16 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) && strcmp (result + strlen (result) - 3, " 33") == 0); ASSERT (retval == strlen (result)); } +#if HAVE_SNAND + { /* Signalling NaN. */ + int retval = + my_snprintf (result, sizeof (result), "%g %d", SNaNd (), 33, 44, 55); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (retval == strlen (result)); + } +#endif { /* Width. */ int retval = @@ -2546,6 +2637,16 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) && strcmp (result + strlen (result) - 3, " 33") == 0); ASSERT (retval == strlen (result)); } +#if HAVE_SNANL + { /* Signalling NaN. */ + int retval = + my_snprintf (result, sizeof (result), "%Lg %d", SNaNl (), 33, 44, 55); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (retval == strlen (result)); + } +#endif #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = diff --git a/tests/test-sprintf-posix.h b/tests/test-sprintf-posix.h index c0957a6967..15404d9fae 100644 --- a/tests/test-sprintf-posix.h +++ b/tests/test-sprintf-posix.h @@ -19,6 +19,7 @@ #include "minus-zero.h" #include "infinity.h" #include "nan.h" +#include "snan.h" /* The SGI MIPS floating-point format does not distinguish 0.0 and -0.0. */ static int @@ -181,6 +182,16 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) && strcmp (result + strlen (result) - 3, " 33") == 0); ASSERT (retval == strlen (result)); } +#if HAVE_SNAND + { /* Signalling NaN. */ + int retval = + my_sprintf (result, "%a %d", SNaNd (), 33, 44, 55); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (retval == strlen (result)); + } +#endif { /* Rounding near the decimal point. */ int retval = @@ -442,6 +453,16 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) && strcmp (result + strlen (result) - 3, " 33") == 0); ASSERT (retval == strlen (result)); } +#if HAVE_SNANL + { /* Signalling NaN. */ + int retval = + my_sprintf (result, "%La %d", SNaNl (), 33, 44, 55); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (retval == strlen (result)); + } +#endif #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = @@ -859,6 +880,16 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) && strcmp (result + strlen (result) - 3, " 33") == 0); ASSERT (retval == strlen (result)); } +#if HAVE_SNAND + { /* Signalling NaN. */ + int retval = + my_sprintf (result, "%f %d", SNaNd (), 33, 44, 55); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (retval == strlen (result)); + } +#endif { /* Width. */ int retval = @@ -1109,6 +1140,16 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) && strcmp (result + strlen (result) - 3, " 33") == 0); ASSERT (retval == strlen (result)); } +#if HAVE_SNANL + { /* Signalling NaN. */ + int retval = + my_sprintf (result, "%Lf %d", SNaNl (), 33, 44, 55); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (retval == strlen (result)); + } +#endif #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = @@ -1337,6 +1378,16 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) && strcmp (result + strlen (result) - 3, " 33") == 0); ASSERT (retval == strlen (result)); } +#if HAVE_SNAND + { /* Signalling NaN. */ + int retval = + my_sprintf (result, "%F %d", SNaNd (), 33, 44, 55); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 1) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (retval == strlen (result)); + } +#endif { /* FLAG_ZERO. */ int retval = @@ -1434,6 +1485,16 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) && strcmp (result + strlen (result) - 3, " 33") == 0); ASSERT (retval == strlen (result)); } +#if HAVE_SNANL + { /* Signalling NaN. */ + int retval = + my_sprintf (result, "%LF %d", SNaNl (), 33, 44, 55); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 1) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (retval == strlen (result)); + } +#endif { /* FLAG_ZERO. */ int retval = @@ -1634,6 +1695,16 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) && strcmp (result + strlen (result) - 3, " 33") == 0); ASSERT (retval == strlen (result)); } +#if HAVE_SNAND + { /* Signalling NaN. */ + int retval = + my_sprintf (result, "%e %d", SNaNd (), 33, 44, 55); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (retval == strlen (result)); + } +#endif { /* Width. */ int retval = @@ -1917,6 +1988,16 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) && strcmp (result + strlen (result) - 3, " 33") == 0); ASSERT (retval == strlen (result)); } +#if HAVE_SNANL + { /* Signalling NaN. */ + int retval = + my_sprintf (result, "%Le %d", SNaNl (), 33, 44, 55); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (retval == strlen (result)); + } +#endif #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = @@ -2263,6 +2344,16 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) && strcmp (result + strlen (result) - 3, " 33") == 0); ASSERT (retval == strlen (result)); } +#if HAVE_SNAND + { /* Signalling NaN. */ + int retval = + my_sprintf (result, "%g %d", SNaNd (), 33, 44, 55); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (retval == strlen (result)); + } +#endif { /* Width. */ int retval = @@ -2532,6 +2623,16 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) && strcmp (result + strlen (result) - 3, " 33") == 0); ASSERT (retval == strlen (result)); } +#if HAVE_SNANL + { /* Signalling NaN. */ + int retval = + my_sprintf (result, "%Lg %d", SNaNl (), 33, 44, 55); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (retval == strlen (result)); + } +#endif #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = diff --git a/tests/test-vasnprintf-posix.c b/tests/test-vasnprintf-posix.c index 33387c32e7..6848eb9aed 100644 --- a/tests/test-vasnprintf-posix.c +++ b/tests/test-vasnprintf-posix.c @@ -33,6 +33,7 @@ #include "minus-zero.h" #include "infinity.h" #include "nan.h" +#include "snan.h" /* The SGI MIPS floating-point format does not distinguish 0.0 and -0.0. */ static int @@ -247,6 +248,19 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) ASSERT (length == strlen (result)); free (result); } +#if HAVE_SNAND + { /* Signalling NaN. */ + size_t length; + char *result = + my_asnprintf (NULL, &length, "%a %d", SNaNd (), 33, 44, 55); + ASSERT (result != NULL); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (length == strlen (result)); + free (result); + } +#endif { /* Rounding near the decimal point. */ size_t length; @@ -590,6 +604,19 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) ASSERT (length == strlen (result)); free (result); } +#if HAVE_SNANL + { /* Signalling NaN. */ + size_t length; + char *result = + my_asnprintf (NULL, &length, "%La %d", SNaNl (), 33, 44, 55); + ASSERT (result != NULL); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (length == strlen (result)); + free (result); + } +#endif #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = @@ -1115,6 +1142,19 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) ASSERT (length == strlen (result)); free (result); } +#if HAVE_SNAND + { /* Signalling NaN. */ + size_t length; + char *result = + my_asnprintf (NULL, &length, "%f %d", SNaNd (), 33, 44, 55); + ASSERT (result != NULL); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (length == strlen (result)); + free (result); + } +#endif { /* Width. */ size_t length; @@ -1434,6 +1474,19 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) ASSERT (length == strlen (result)); free (result); } +#if HAVE_SNANL + { /* Signalling NaN. */ + size_t length; + char *result = + my_asnprintf (NULL, &length, "%Lf %d", SNaNl (), 33, 44, 55); + ASSERT (result != NULL); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (length == strlen (result)); + free (result); + } +#endif #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = @@ -1749,6 +1802,19 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) ASSERT (length == strlen (result)); free (result); } +#if HAVE_SNAND + { /* Signalling NaN. */ + size_t length; + char *result = + my_asnprintf (NULL, &length, "%F %d", SNaNd (), 33, 44, 55); + ASSERT (result != NULL); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 1) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (length == strlen (result)); + free (result); + } +#endif { /* FLAG_ZERO. */ size_t length; @@ -1885,6 +1951,19 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) ASSERT (length == strlen (result)); free (result); } +#if HAVE_SNANL + { /* Signalling NaN. */ + size_t length; + char *result = + my_asnprintf (NULL, &length, "%LF %d", SNaNl (), 33, 44, 55); + ASSERT (result != NULL); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 1) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (length == strlen (result)); + free (result); + } +#endif { /* FLAG_ZERO. */ size_t length; @@ -2127,6 +2206,19 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) ASSERT (length == strlen (result)); free (result); } +#if HAVE_SNAND + { /* Signalling NaN. */ + size_t length; + char *result = + my_asnprintf (NULL, &length, "%e %d", SNaNd (), 33, 44, 55); + ASSERT (result != NULL); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (length == strlen (result)); + free (result); + } +#endif { /* Width. */ size_t length; @@ -2482,6 +2574,19 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) ASSERT (length == strlen (result)); free (result); } +#if HAVE_SNANL + { /* Signalling NaN. */ + size_t length; + char *result = + my_asnprintf (NULL, &length, "%Le %d", SNaNl (), 33, 44, 55); + ASSERT (result != NULL); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (length == strlen (result)); + free (result); + } +#endif #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = @@ -2917,6 +3022,19 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) ASSERT (length == strlen (result)); free (result); } +#if HAVE_SNAND + { /* Signalling NaN. */ + size_t length; + char *result = + my_asnprintf (NULL, &length, "%g %d", SNaNd (), 33, 44, 55); + ASSERT (result != NULL); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (length == strlen (result)); + free (result); + } +#endif { /* Width. */ size_t length; @@ -3258,6 +3376,19 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) ASSERT (length == strlen (result)); free (result); } +#if HAVE_SNANL + { /* Signalling NaN. */ + size_t length; + char *result = + my_asnprintf (NULL, &length, "%Lg %d", SNaNl (), 33, 44, 55); + ASSERT (result != NULL); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (length == strlen (result)); + free (result); + } +#endif #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = diff --git a/tests/test-vasnwprintf-posix.c b/tests/test-vasnwprintf-posix.c index 351fc8b8c2..428b605577 100644 --- a/tests/test-vasnwprintf-posix.c +++ b/tests/test-vasnwprintf-posix.c @@ -33,6 +33,7 @@ #include "minus-zero.h" #include "infinity.h" #include "nan.h" +#include "snan.h" /* The SGI MIPS floating-point format does not distinguish 0.0 and -0.0. */ static int @@ -247,6 +248,19 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, ASSERT (length == wcslen (result)); free (result); } +#if HAVE_SNAND + { /* Signalling NaN. */ + size_t length; + wchar_t *result = + my_asnwprintf (NULL, &length, L"%a %d", SNaNd (), 33, 44, 55); + ASSERT (result != NULL); + ASSERT (wcslen (result) >= 3 + 3 + && wcsisnan (result, 0, wcslen (result) - 3, 0) + && wcscmp (result + wcslen (result) - 3, L" 33") == 0); + ASSERT (length == wcslen (result)); + free (result); + } +#endif { /* Rounding near the decimal point. */ size_t length; @@ -590,6 +604,19 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, ASSERT (length == wcslen (result)); free (result); } +#if HAVE_SNANL + { /* Signalling NaN. */ + size_t length; + wchar_t *result = + my_asnwprintf (NULL, &length, L"%La %d", SNaNl (), 33, 44, 55); + ASSERT (result != NULL); + ASSERT (wcslen (result) >= 3 + 3 + && wcsisnan (result, 0, wcslen (result) - 3, 0) + && wcscmp (result + wcslen (result) - 3, L" 33") == 0); + ASSERT (length == wcslen (result)); + free (result); + } +#endif #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = @@ -1115,6 +1142,19 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, ASSERT (length == wcslen (result)); free (result); } +#if HAVE_SNAND + { /* Signalling NaN. */ + size_t length; + wchar_t *result = + my_asnwprintf (NULL, &length, L"%f %d", SNaNd (), 33, 44, 55); + ASSERT (result != NULL); + ASSERT (wcslen (result) >= 3 + 3 + && wcsisnan (result, 0, wcslen (result) - 3, 0) + && wcscmp (result + wcslen (result) - 3, L" 33") == 0); + ASSERT (length == wcslen (result)); + free (result); + } +#endif { /* Width. */ size_t length; @@ -1434,6 +1474,19 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, ASSERT (length == wcslen (result)); free (result); } +#if HAVE_SNANL + { /* Signalling NaN. */ + size_t length; + wchar_t *result = + my_asnwprintf (NULL, &length, L"%Lf %d", SNaNl (), 33, 44, 55); + ASSERT (result != NULL); + ASSERT (wcslen (result) >= 3 + 3 + && wcsisnan (result, 0, wcslen (result) - 3, 0) + && wcscmp (result + wcslen (result) - 3, L" 33") == 0); + ASSERT (length == wcslen (result)); + free (result); + } +#endif #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = @@ -1749,6 +1802,19 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, ASSERT (length == wcslen (result)); free (result); } +#if HAVE_SNAND + { /* Signalling NaN. */ + size_t length; + wchar_t *result = + my_asnwprintf (NULL, &length, L"%F %d", SNaNd (), 33, 44, 55); + ASSERT (result != NULL); + ASSERT (wcslen (result) >= 3 + 3 + && wcsisnan (result, 0, wcslen (result) - 3, 1) + && wcscmp (result + wcslen (result) - 3, L" 33") == 0); + ASSERT (length == wcslen (result)); + free (result); + } +#endif { /* FLAG_ZERO. */ size_t length; @@ -1885,6 +1951,19 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, ASSERT (length == wcslen (result)); free (result); } +#if HAVE_SNANL + { /* Signalling NaN. */ + size_t length; + wchar_t *result = + my_asnwprintf (NULL, &length, L"%LF %d", SNaNl (), 33, 44, 55); + ASSERT (result != NULL); + ASSERT (wcslen (result) >= 3 + 3 + && wcsisnan (result, 0, wcslen (result) - 3, 1) + && wcscmp (result + wcslen (result) - 3, L" 33") == 0); + ASSERT (length == wcslen (result)); + free (result); + } +#endif { /* FLAG_ZERO. */ size_t length; @@ -2127,6 +2206,19 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, ASSERT (length == wcslen (result)); free (result); } +#if HAVE_SNAND + { /* Signalling NaN. */ + size_t length; + wchar_t *result = + my_asnwprintf (NULL, &length, L"%e %d", SNaNd (), 33, 44, 55); + ASSERT (result != NULL); + ASSERT (wcslen (result) >= 3 + 3 + && wcsisnan (result, 0, wcslen (result) - 3, 0) + && wcscmp (result + wcslen (result) - 3, L" 33") == 0); + ASSERT (length == wcslen (result)); + free (result); + } +#endif { /* Width. */ size_t length; @@ -2482,6 +2574,19 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, ASSERT (length == wcslen (result)); free (result); } +#if HAVE_SNANL + { /* Signalling NaN. */ + size_t length; + wchar_t *result = + my_asnwprintf (NULL, &length, L"%Le %d", SNaNl (), 33, 44, 55); + ASSERT (result != NULL); + ASSERT (wcslen (result) >= 3 + 3 + && wcsisnan (result, 0, wcslen (result) - 3, 0) + && wcscmp (result + wcslen (result) - 3, L" 33") == 0); + ASSERT (length == wcslen (result)); + free (result); + } +#endif #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = @@ -2917,6 +3022,19 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, ASSERT (length == wcslen (result)); free (result); } +#if HAVE_SNAND + { /* Signalling NaN. */ + size_t length; + wchar_t *result = + my_asnwprintf (NULL, &length, L"%g %d", SNaNd (), 33, 44, 55); + ASSERT (result != NULL); + ASSERT (wcslen (result) >= 3 + 3 + && wcsisnan (result, 0, wcslen (result) - 3, 0) + && wcscmp (result + wcslen (result) - 3, L" 33") == 0); + ASSERT (length == wcslen (result)); + free (result); + } +#endif { /* Width. */ size_t length; @@ -3258,6 +3376,19 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, ASSERT (length == wcslen (result)); free (result); } +#if HAVE_SNANL + { /* Signalling NaN. */ + size_t length; + wchar_t *result = + my_asnwprintf (NULL, &length, L"%Lg %d", SNaNl (), 33, 44, 55); + ASSERT (result != NULL); + ASSERT (wcslen (result) >= 3 + 3 + && wcsisnan (result, 0, wcslen (result) - 3, 0) + && wcscmp (result + wcslen (result) - 3, L" 33") == 0); + ASSERT (length == wcslen (result)); + free (result); + } +#endif #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = diff --git a/tests/test-vasprintf-posix.c b/tests/test-vasprintf-posix.c index 897109537f..92fe5d5558 100644 --- a/tests/test-vasprintf-posix.c +++ b/tests/test-vasprintf-posix.c @@ -32,6 +32,7 @@ #include "minus-zero.h" #include "infinity.h" #include "nan.h" +#include "snan.h" /* The SGI MIPS floating-point format does not distinguish 0.0 and -0.0. */ static int @@ -227,6 +228,19 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) ASSERT (retval == strlen (result)); free (result); } +#if HAVE_SNAND + { /* Signalling NaN. */ + char *result; + int retval = + my_asprintf (&result, "%a %d", SNaNd (), 33, 44, 55); + ASSERT (result != NULL); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (retval == strlen (result)); + free (result); + } +#endif { /* Rounding near the decimal point. */ char *result; @@ -571,6 +585,19 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) ASSERT (retval == strlen (result)); free (result); } +#if HAVE_SNANL + { /* Signalling NaN. */ + char *result; + int retval = + my_asprintf (&result, "%La %d", SNaNl (), 33, 44, 55); + ASSERT (result != NULL); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (retval == strlen (result)); + free (result); + } +#endif #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = @@ -1096,6 +1123,19 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) ASSERT (retval == strlen (result)); free (result); } +#if HAVE_SNAND + { /* Signalling NaN. */ + char *result; + int retval = + my_asprintf (&result, "%f %d", SNaNd (), 33, 44, 55); + ASSERT (result != NULL); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (retval == strlen (result)); + free (result); + } +#endif { /* Width. */ char *result; @@ -1415,6 +1455,19 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) ASSERT (retval == strlen (result)); free (result); } +#if HAVE_SNANL + { /* Signalling NaN. */ + char *result; + int retval = + my_asprintf (&result, "%Lf %d", SNaNl (), 33, 44, 55); + ASSERT (result != NULL); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (retval == strlen (result)); + free (result); + } +#endif #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = @@ -1730,6 +1783,19 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) ASSERT (retval == strlen (result)); free (result); } +#if HAVE_SNAND + { /* Signalling NaN. */ + char *result; + int retval = + my_asprintf (&result, "%F %d", SNaNd (), 33, 44, 55); + ASSERT (result != NULL); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 1) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (retval == strlen (result)); + free (result); + } +#endif { /* FLAG_ZERO. */ char *result; @@ -1866,6 +1932,19 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) ASSERT (retval == strlen (result)); free (result); } +#if HAVE_SNANL + { /* Signalling NaN. */ + char *result; + int retval = + my_asprintf (&result, "%LF %d", SNaNl (), 33, 44, 55); + ASSERT (result != NULL); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 1) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (retval == strlen (result)); + free (result); + } +#endif { /* FLAG_ZERO. */ char *result; @@ -2108,6 +2187,19 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) ASSERT (retval == strlen (result)); free (result); } +#if HAVE_SNAND + { /* Signalling NaN. */ + char *result; + int retval = + my_asprintf (&result, "%e %d", SNaNd (), 33, 44, 55); + ASSERT (result != NULL); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (retval == strlen (result)); + free (result); + } +#endif { /* Width. */ char *result; @@ -2463,6 +2555,19 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) ASSERT (retval == strlen (result)); free (result); } +#if HAVE_SNANL + { /* Signalling NaN. */ + char *result; + int retval = + my_asprintf (&result, "%Le %d", SNaNl (), 33, 44, 55); + ASSERT (result != NULL); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (retval == strlen (result)); + free (result); + } +#endif #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = @@ -2902,6 +3007,19 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) ASSERT (retval == strlen (result)); free (result); } +#if HAVE_SNAND + { /* Signalling NaN. */ + char *result; + int retval = + my_asprintf (&result, "%g %d", SNaNd (), 33, 44, 55); + ASSERT (result != NULL); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (retval == strlen (result)); + free (result); + } +#endif { /* Width. */ char *result; @@ -3243,6 +3361,19 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) ASSERT (retval == strlen (result)); free (result); } +#if HAVE_SNANL + { /* Signalling NaN. */ + char *result; + int retval = + my_asprintf (&result, "%Lg %d", SNaNl (), 33, 44, 55); + ASSERT (result != NULL); + ASSERT (strlen (result) >= 3 + 3 + && strisnan (result, 0, strlen (result) - 3, 0) + && strcmp (result + strlen (result) - 3, " 33") == 0); + ASSERT (retval == strlen (result)); + free (result); + } +#endif #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = -- 2.39.5