Mercurial > hg > octave-lyh > gnulib-hg
changeset 8851:0863989438fc
Avoid test failures on IRIX 6.5.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sat, 19 May 2007 22:30:24 +0000 |
parents | d1fe16dfbfee |
children | df0b5e8ea770 |
files | tests/test-fprintf-posix.h tests/test-printf-posix.h tests/test-printf-posix.output |
diffstat | 3 files changed, 0 insertions(+), 76 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test-fprintf-posix.h +++ b/tests/test-fprintf-posix.h @@ -17,18 +17,6 @@ /* Written by Bruno Haible <bruno@clisp.org>, 2007. */ -/* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0. */ -#ifdef __DECC -static double -NaN () -{ - static double zero = 0.0; - return zero / zero; -} -#else -# define NaN() (0.0 / 0.0) -#endif - static void test_function (int (*my_fprintf) (FILE *, const char *, ...)) { @@ -58,15 +46,9 @@ /* Negative infinity. */ my_fprintf (stdout, "%a %d\n", -1.0 / 0.0, 33, 44, 55); - /* NaN. */ - my_fprintf (stdout, "%a %d\n", NaN (), 33, 44, 55); - /* FLAG_ZERO with infinite number. */ my_fprintf (stdout, "%010a %d\n", 1.0 / 0.0, 33, 44, 55); - /* FLAG_ZERO with NaN. */ - my_fprintf (stdout, "%010a %d\n", NaN (), 33, 44, 55); - /* Test the support of the %f format directive. */ /* A positive number. */ @@ -84,9 +66,6 @@ /* Negative zero. */ my_fprintf (stdout, "%f %d\n", -0.0, 33, 44, 55); - /* NaN. */ - my_fprintf (stdout, "%f %d\n", NaN (), 33, 44, 55); - /* FLAG_ZERO. */ my_fprintf (stdout, "%015f %d\n", 1234.0, 33, 44, 55); @@ -108,11 +87,6 @@ /* Negative zero. */ my_fprintf (stdout, "%Lf %d\n", -0.0L, 33, 44, 55); - { /* NaN. */ - static long double zero = 0.0L; - my_fprintf (stdout, "%Lf %d\n", zero / zero, 33, 44, 55); - } - /* FLAG_ZERO. */ my_fprintf (stdout, "%015Lf %d\n", 1234.0L, 33, 44, 55); @@ -136,9 +110,6 @@ /* Negative zero. */ my_fprintf (stdout, "%F %d\n", -0.0, 33, 44, 55); - /* NaN. */ - my_fprintf (stdout, "%F %d\n", NaN (), 33, 44, 55); - /* FLAG_ZERO. */ my_fprintf (stdout, "%015F %d\n", 1234.0, 33, 44, 55); @@ -160,11 +131,6 @@ /* Negative zero. */ my_fprintf (stdout, "%LF %d\n", -0.0L, 33, 44, 55); - { /* NaN. */ - static long double zero = 0.0L; - my_fprintf (stdout, "%LF %d\n", zero / zero, 33, 44, 55); - } - /* FLAG_ZERO. */ my_fprintf (stdout, "%015LF %d\n", 1234.0L, 33, 44, 55);
--- a/tests/test-printf-posix.h +++ b/tests/test-printf-posix.h @@ -17,18 +17,6 @@ /* Written by Bruno Haible <bruno@clisp.org>, 2007. */ -/* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0. */ -#ifdef __DECC -static double -NaN () -{ - static double zero = 0.0; - return zero / zero; -} -#else -# define NaN() (0.0 / 0.0) -#endif - static void test_function (int (*my_printf) (const char *, ...)) { @@ -58,19 +46,11 @@ /* Negative infinity. */ my_printf ("%a %d\n", -1.0 / 0.0, 33, 44, 55); - /* NaN. */ - my_printf ("%a %d\n", NaN (), 33, 44, 55); - /* FLAG_ZERO with infinite number. */ /* "0000000inf 33" is not a valid result; see <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html> */ my_printf ("%010a %d\n", 1.0 / 0.0, 33, 44, 55); - /* FLAG_ZERO with NaN. */ - /* "0000000nan 33" is not a valid result; see - <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html> */ - my_printf ("%010a %d\n", NaN (), 33, 44, 55); - /* Test the support of the %f format directive. */ /* A positive number. */ @@ -88,9 +68,6 @@ /* Negative zero. */ my_printf ("%f %d\n", -0.0, 33, 44, 55); - /* NaN. */ - my_printf ("%f %d\n", NaN (), 33, 44, 55); - /* FLAG_ZERO. */ my_printf ("%015f %d\n", 1234.0, 33, 44, 55); @@ -112,11 +89,6 @@ /* Negative zero. */ my_printf ("%Lf %d\n", -0.0L, 33, 44, 55); - { /* NaN. */ - static long double zero = 0.0L; - my_printf ("%Lf %d\n", zero / zero, 33, 44, 55); - } - /* FLAG_ZERO. */ my_printf ("%015Lf %d\n", 1234.0L, 33, 44, 55); @@ -140,9 +112,6 @@ /* Negative zero. */ my_printf ("%F %d\n", -0.0, 33, 44, 55); - /* NaN. */ - my_printf ("%F %d\n", NaN (), 33, 44, 55); - /* FLAG_ZERO. */ my_printf ("%015F %d\n", 1234.0, 33, 44, 55); @@ -164,11 +133,6 @@ /* Negative zero. */ my_printf ("%LF %d\n", -0.0L, 33, 44, 55); - { /* NaN. */ - static long double zero = 0.0L; - my_printf ("%LF %d\n", zero / zero, 33, 44, 55); - } - /* FLAG_ZERO. */ my_printf ("%015LF %d\n", 1234.0L, 33, 44, 55);
--- a/tests/test-printf-posix.output +++ b/tests/test-printf-posix.output @@ -5,15 +5,12 @@ -0x0p+0 33 inf 33 -inf 33 -nan 33 inf 33 - nan 33 12.750000 33 1234567.000000 33 -0.031250 33 0.000000 33 -0.000000 33 -nan 33 00001234.000000 33 1234 33 12.750000 33 @@ -21,7 +18,6 @@ -0.031250 33 0.000000 33 -0.000000 33 -nan 33 00001234.000000 33 1234 33 12.750000 33 @@ -29,7 +25,6 @@ -0.031250 33 0.000000 33 -0.000000 33 -NAN 33 00001234.000000 33 1234 33 12.750000 33 @@ -37,7 +32,6 @@ -0.031250 33 0.000000 33 -0.000000 33 -NAN 33 00001234.000000 33 1234 33 55 33