Mercurial > hg > octave-lyh > gnulib-hg
changeset 16430:5fcf24990a0b
truncl-ieee tests: More tests.
* tests/test-truncl-ieee.c: Include isnanl-nolibm.h, infinity.h, nan.h.
(main): Add tests for [MX] shaded specification in POSIX.
* modules/truncl-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:26:56 +0100 |
parents | 559c3676b8af |
children | f16e87d6bf2e |
files | ChangeLog modules/truncl-ieee-tests tests/test-truncl-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> + truncl-ieee tests: More tests. + * tests/test-truncl-ieee.c: Include isnanl-nolibm.h, infinity.h, nan.h. + (main): Add tests for [MX] shaded specification in POSIX. + * modules/truncl-ieee-tests (Files): Add tests/infinity.h, tests/nan.h. + (Depends-on): Add isnanl-nolibm. + trunc-ieee tests: More tests. * tests/test-trunc-ieee.c: Include isnand-nolibm.h, infinity.h, nan.h. (main): Add tests for [MX] shaded specification in POSIX.
--- a/modules/truncl-ieee-tests +++ b/modules/truncl-ieee-tests @@ -1,10 +1,13 @@ Files: tests/test-truncl-ieee.c tests/minus-zero.h +tests/infinity.h +tests/nan.h tests/macros.h Depends-on: fpucw +isnanl-nolibm float signbit
--- a/tests/test-truncl-ieee.c +++ b/tests/test-truncl-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 (truncl (-0.3L)) == !!signbit (minus_zerol)); ASSERT (!!signbit (truncl (-0.7L)) == !!signbit (minus_zerol)); + /* [MX] shaded specification in POSIX. */ + + /* NaN. */ + ASSERT (isnanl (truncl (NaNl ()))); + /* Infinity. */ + ASSERT (truncl (Infinityl ()) == Infinityl ()); + ASSERT (truncl (- Infinityl ()) == - Infinityl ()); + return 0; }