Mercurial > hg > octave-lyh > gnulib-hg
changeset 16433:ddc2bee9e4f8
roundl-ieee tests: More tests.
* tests/test-roundl-ieee.c: Include isnanl-nolibm.h, infinity.h, nan.h.
(main): Add tests for [MX] shaded specification in POSIX.
* modules/roundl-ieee-tests (Files): Add tests/infinity.h, tests/nan.h.
(Depends-on): Add isnanl-nolibm.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 26 Feb 2012 14:27:44 +0100 |
parents | 56e33fed83b4 |
children | 4f9beada6ccb |
files | ChangeLog modules/roundl-ieee-tests tests/test-roundl-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> + roundl-ieee tests: More tests. + * tests/test-roundl-ieee.c: Include isnanl-nolibm.h, infinity.h, nan.h. + (main): Add tests for [MX] shaded specification in POSIX. + * modules/roundl-ieee-tests (Files): Add tests/infinity.h, tests/nan.h. + (Depends-on): Add isnanl-nolibm. + 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.
--- a/modules/roundl-ieee-tests +++ b/modules/roundl-ieee-tests @@ -1,9 +1,12 @@ Files: tests/test-roundl-ieee.c tests/minus-zero.h +tests/infinity.h +tests/nan.h tests/macros.h Depends-on: +isnanl-nolibm float signbit
--- a/tests/test-roundl-ieee.c +++ b/tests/test-roundl-ieee.c @@ -19,7 +19,10 @@ #include <math.h> #include "fpucw.h" +#include "isnanl-nolibm.h" #include "minus-zero.h" +#include "infinity.h" +#include "nan.h" #include "macros.h" int @@ -44,5 +47,13 @@ ASSERT (!!signbit (roundl (-0.3L)) == !!signbit (minus_zerol)); ASSERT (!!signbit (roundl (-0.7L)) == !!signbit (minus_zerol)); + /* [MX] shaded specification in POSIX. */ + + /* NaN. */ + ASSERT (isnanl (roundl (NaNl ()))); + /* Infinity. */ + ASSERT (roundl (Infinityl ()) == Infinityl ()); + ASSERT (roundl (- Infinityl ()) == - Infinityl ()); + return 0; }