X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-frexp.c;h=9ce989b06db40540d786b5636ca73c4477abe3e7;hb=373c44dc1d48bf58b7b46ce04bc87d437d20eb5e;hp=96c640f7fcfb0bf2f26437d6e6de833ab39b6b21;hpb=076e99e2af11eb12b976dd1d936c6ebab6ece27f;p=gnulib.git diff --git a/tests/test-frexp.c b/tests/test-frexp.c index 96c640f7f..9ce989b06 100644 --- a/tests/test-frexp.c +++ b/tests/test-frexp.c @@ -22,11 +22,21 @@ #include #include +#include #include #include "isnan.h" -#define ASSERT(expr) if (!(expr)) abort (); +#define ASSERT(expr) \ + do \ + { \ + if (!(expr)) \ + { \ + fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \ + abort (); \ + } \ + } \ + while (0) /* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0. */ #ifdef __DECC @@ -92,6 +102,7 @@ main () mantissa = frexp (x, &exp); ASSERT (exp == 0); ASSERT (mantissa == x); + ASSERT (!signbit (mantissa)); } { /* Negative zero. */ @@ -101,6 +112,7 @@ main () mantissa = frexp (x, &exp); ASSERT (exp == 0); ASSERT (mantissa == x); + ASSERT (signbit (mantissa)); } for (i = 1, x = 1.0; i <= DBL_MAX_EXP; i++, x *= 2.0)