Mercurial > hg > octave-jordi > gnulib-hg
diff tests/test-frexpf-ieee.c @ 16441:2e6429c58643
Refactor frexp*-ieee tests.
* tests/test-frexp-ieee.h: New file.
* tests/test-frexpf-ieee.c: Include test-frexp-ieee.h.
(main): Just call test_function.
* tests/test-frexp-ieee.c: Include test-frexp-ieee.h.
(main): Just call test_function.
* tests/test-frexpl-ieee.c: Include test-frexp-ieee.h.
(main): Just call test_function.
* modules/frexpf-ieee-tests (Files): Add tests/test-frexp-ieee.h.
* modules/frexp-ieee-tests (Files): Likewise.
* modules/frexpl-ieee-tests (Files): Likewise.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 26 Feb 2012 16:19:59 +0100 (2012-02-26) |
parents | 43b148942038 |
children | e542fd46ad6f |
line wrap: on
line diff
--- a/tests/test-frexpf-ieee.c +++ b/tests/test-frexpf-ieee.c @@ -24,50 +24,22 @@ #include "nan.h" #include "macros.h" +#undef INFINITY +#undef NAN + +#define DOUBLE float +#define ISNAN isnanf +#define INFINITY Infinityf () +#define NAN NaNf () +#define L_(literal) literal##f +#define MINUS_ZERO minus_zerof +#define FREXP frexpf +#include "test-frexp-ieee.h" + int main () { - /* [MX] shaded specification in POSIX. */ - - /* NaN. */ - { - int exp = -9999; - float mantissa; - mantissa = frexpf (NaNf (), &exp); - ASSERT (isnanf (mantissa)); - } - - /* Signed zero. */ - { - int exp = -9999; - float mantissa; - mantissa = frexpf (0.0f, &exp); - ASSERT (mantissa == 0.0f); - ASSERT (!signbit (mantissa)); - ASSERT (exp == 0); - } - { - int exp = -9999; - float mantissa; - mantissa = frexpf (minus_zerof, &exp); - ASSERT (mantissa == 0.0f); - ASSERT (!!signbit (mantissa) == !!signbit (minus_zerof)); - ASSERT (exp == 0); - } - - /* Infinity. */ - { - int exp = -9999; - float mantissa; - mantissa = frexpf (Infinityf (), &exp); - ASSERT (mantissa == Infinityf ()); - } - { - int exp = -9999; - float mantissa; - mantissa = frexpf (- Infinityf (), &exp); - ASSERT (mantissa == - Infinityf ()); - } + test_function (); return 0; }