Mercurial > hg > octave-lyh > gnulib-hg
changeset 16432:56e33fed83b4
round-ieee tests: More tests.
* tests/test-round-ieee.c: Include isnand-nolibm.h, infinity.h, nan.h.
(main): Add tests for [MX] shaded specification in POSIX.
* modules/round-ieee-tests (Files): Add tests/infinity.h, tests/nan.h.
(Depends-on): Add isnand-nolibm.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 26 Feb 2012 14:27:32 +0100 |
parents | f16e87d6bf2e |
children | ddc2bee9e4f8 |
files | ChangeLog modules/round-ieee-tests tests/test-round-ieee.c |
diffstat | 3 files changed, 20 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2012-02-26 Bruno Haible <bruno@clisp.org> + round-ieee tests: More tests. + * tests/test-round-ieee.c: Include isnand-nolibm.h, infinity.h, nan.h. + (main): Add tests for [MX] shaded specification in POSIX. + * modules/round-ieee-tests (Files): Add tests/infinity.h, tests/nan.h. + (Depends-on): Add isnand-nolibm. + roundf-ieee tests: More tests. * tests/test-roundf-ieee.c: Include isnanf-nolibm.h, infinity.h, nan.h. (main): Add tests for [MX] shaded specification in POSIX.
--- a/modules/round-ieee-tests +++ b/modules/round-ieee-tests @@ -1,9 +1,12 @@ Files: tests/test-round-ieee.c tests/minus-zero.h +tests/infinity.h +tests/nan.h tests/macros.h Depends-on: +isnand-nolibm float signbit
--- a/tests/test-round-ieee.c +++ b/tests/test-round-ieee.c @@ -18,7 +18,10 @@ #include <math.h> +#include "isnand-nolibm.h" #include "minus-zero.h" +#include "infinity.h" +#include "nan.h" #include "macros.h" int @@ -39,5 +42,13 @@ ASSERT (!!signbit (round (-0.3)) == !!signbit (minus_zerod)); ASSERT (!!signbit (round (-0.7)) == !!signbit (minus_zerod)); + /* [MX] shaded specification in POSIX. */ + + /* NaN. */ + ASSERT (isnand (round (NaNd ()))); + /* Infinity. */ + ASSERT (round (Infinityd ()) == Infinityd ()); + ASSERT (round (- Infinityd ()) == - Infinityd ()); + return 0; }