mirror of
https://https.git.savannah.gnu.org/git/gnulib.git
synced 2026-09-01 02:34:55 +00:00
*printf-posix tests: Fix for platforms where 'long double' == 'double'.
* modules/snprintf-posix-tests (configure.ac): Require gl_LONG_DOUBLE_VS_DOUBLE. * modules/sprintf-posix-tests (configure.ac): Likewise. * modules/vasnprintf-posix-tests (configure.ac): Likewise. * modules/vasprintf-posix-tests (configure.ac): Likewise. * modules/vsnprintf-posix-tests (configure.ac): Likewise. * modules/vsprintf-posix-tests (configure.ac): Likewise. * tests/test-snprintf-posix.h (test_function): Avoid 80-bit long double tests on platforms where 'long double' is the same as 'double'. * tests/test-sprintf-posix.h (test_function): Likewise. * tests/test-vasnprintf-posix.c (test_function): Likewise. * tests/test-vasprintf-posix.c (test_function): Likewise.
This commit is contained in:
@@ -1,5 +1,19 @@
|
||||
2011-10-09 Bruno Haible <bruno@clisp.org>
|
||||
|
||||
*printf-posix tests: Fix for platforms where 'long double' == 'double'.
|
||||
* modules/snprintf-posix-tests (configure.ac): Require
|
||||
gl_LONG_DOUBLE_VS_DOUBLE.
|
||||
* modules/sprintf-posix-tests (configure.ac): Likewise.
|
||||
* modules/vasnprintf-posix-tests (configure.ac): Likewise.
|
||||
* modules/vasprintf-posix-tests (configure.ac): Likewise.
|
||||
* modules/vsnprintf-posix-tests (configure.ac): Likewise.
|
||||
* modules/vsprintf-posix-tests (configure.ac): Likewise.
|
||||
* tests/test-snprintf-posix.h (test_function): Avoid 80-bit long double
|
||||
tests on platforms where 'long double' is the same as 'double'.
|
||||
* tests/test-sprintf-posix.h (test_function): Likewise.
|
||||
* tests/test-vasnprintf-posix.c (test_function): Likewise.
|
||||
* tests/test-vasprintf-posix.c (test_function): Likewise.
|
||||
|
||||
*printf: Fix for platforms where 'long double' == 'double'.
|
||||
* m4/printf.m4 (gl_PRINTF_INFINITE_LONG_DOUBLE): Require
|
||||
gl_LONG_DOUBLE_VS_DOUBLE. Don't blindly assume 80-bit 'long double'.
|
||||
|
||||
@@ -13,6 +13,7 @@ stdint
|
||||
float
|
||||
|
||||
configure.ac:
|
||||
AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
|
||||
AC_DEFINE([CHECK_SNPRINTF_POSIX], 1,
|
||||
[Define to 1 for strict checking in test-snprintf.c.])
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ stdint
|
||||
float
|
||||
|
||||
configure.ac:
|
||||
AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
|
||||
|
||||
Makefile.am:
|
||||
TESTS += test-sprintf-posix
|
||||
|
||||
@@ -16,6 +16,7 @@ float
|
||||
setlocale
|
||||
|
||||
configure.ac:
|
||||
AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
|
||||
gt_LOCALE_FR
|
||||
gt_LOCALE_FR_UTF8
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ stdint
|
||||
float
|
||||
|
||||
configure.ac:
|
||||
AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
|
||||
|
||||
Makefile.am:
|
||||
TESTS += test-vasprintf-posix
|
||||
|
||||
@@ -13,6 +13,7 @@ stdint
|
||||
float
|
||||
|
||||
configure.ac:
|
||||
AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
|
||||
AC_DEFINE([CHECK_VSNPRINTF_POSIX], 1,
|
||||
[Define to 1 for strict checking in test-vsnprintf.c.])
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ stdint
|
||||
float
|
||||
|
||||
configure.ac:
|
||||
AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
|
||||
|
||||
Makefile.am:
|
||||
TESTS += test-vsprintf-posix
|
||||
|
||||
@@ -469,7 +469,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...))
|
||||
&& strcmp (result + strlen (result) - 3, " 33") == 0);
|
||||
ASSERT (retval == strlen (result));
|
||||
}
|
||||
#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_))
|
||||
#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 =
|
||||
{ LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
|
||||
@@ -1173,7 +1173,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...))
|
||||
&& strcmp (result + strlen (result) - 3, " 33") == 0);
|
||||
ASSERT (retval == strlen (result));
|
||||
}
|
||||
#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_))
|
||||
#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 =
|
||||
{ LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
|
||||
@@ -2043,7 +2043,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...))
|
||||
&& strcmp (result + strlen (result) - 3, " 33") == 0);
|
||||
ASSERT (retval == strlen (result));
|
||||
}
|
||||
#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_))
|
||||
#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 =
|
||||
{ LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
|
||||
@@ -2695,7 +2695,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...))
|
||||
&& strcmp (result + strlen (result) - 3, " 33") == 0);
|
||||
ASSERT (retval == strlen (result));
|
||||
}
|
||||
#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_))
|
||||
#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 =
|
||||
{ LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
|
||||
|
||||
@@ -455,7 +455,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...))
|
||||
&& strcmp (result + strlen (result) - 3, " 33") == 0);
|
||||
ASSERT (retval == strlen (result));
|
||||
}
|
||||
#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_))
|
||||
#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 =
|
||||
{ LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
|
||||
@@ -1159,7 +1159,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...))
|
||||
&& strcmp (result + strlen (result) - 3, " 33") == 0);
|
||||
ASSERT (retval == strlen (result));
|
||||
}
|
||||
#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_))
|
||||
#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 =
|
||||
{ LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
|
||||
@@ -2029,7 +2029,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...))
|
||||
&& strcmp (result + strlen (result) - 3, " 33") == 0);
|
||||
ASSERT (retval == strlen (result));
|
||||
}
|
||||
#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_))
|
||||
#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 =
|
||||
{ LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
|
||||
@@ -2681,7 +2681,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...))
|
||||
&& strcmp (result + strlen (result) - 3, " 33") == 0);
|
||||
ASSERT (retval == strlen (result));
|
||||
}
|
||||
#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_))
|
||||
#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 =
|
||||
{ LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
|
||||
|
||||
@@ -560,7 +560,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...))
|
||||
ASSERT (length == strlen (result));
|
||||
free (result);
|
||||
}
|
||||
#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_))
|
||||
#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 =
|
||||
{ LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
|
||||
@@ -1374,7 +1374,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...))
|
||||
ASSERT (length == strlen (result));
|
||||
free (result);
|
||||
}
|
||||
#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_))
|
||||
#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 =
|
||||
{ LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
|
||||
@@ -2396,7 +2396,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...))
|
||||
ASSERT (length == strlen (result));
|
||||
free (result);
|
||||
}
|
||||
#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_))
|
||||
#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 =
|
||||
{ LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
|
||||
@@ -3150,7 +3150,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...))
|
||||
ASSERT (length == strlen (result));
|
||||
free (result);
|
||||
}
|
||||
#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_))
|
||||
#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 =
|
||||
{ LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
|
||||
|
||||
@@ -540,7 +540,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...))
|
||||
ASSERT (retval == strlen (result));
|
||||
free (result);
|
||||
}
|
||||
#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_))
|
||||
#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 =
|
||||
{ LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
|
||||
@@ -1354,7 +1354,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...))
|
||||
ASSERT (retval == strlen (result));
|
||||
free (result);
|
||||
}
|
||||
#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_))
|
||||
#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 =
|
||||
{ LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
|
||||
@@ -2376,7 +2376,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...))
|
||||
ASSERT (retval == strlen (result));
|
||||
free (result);
|
||||
}
|
||||
#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_))
|
||||
#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 =
|
||||
{ LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
|
||||
@@ -3130,7 +3130,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...))
|
||||
ASSERT (retval == strlen (result));
|
||||
free (result);
|
||||
}
|
||||
#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_))
|
||||
#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 =
|
||||
{ LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
|
||||
|
||||
Reference in New Issue
Block a user