From 3a14bf086ac904cd02e99025aed903e5f0f062e4 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 26 Feb 2012 14:23:35 +0100 Subject: [PATCH] floorf-ieee tests: More tests. * tests/test-floorf-ieee.c: Include isnanf-nolibm.h, infinity.h, nan.h. (main): Add tests for [MX] shaded specification in POSIX. * modules/floorf-ieee-tests (Files): Add tests/infinity.h, tests/nan.h. (Depends-on): Add isnanf-nolibm. --- ChangeLog | 8 ++++++++ modules/floorf-ieee-tests | 3 +++ tests/test-floorf-ieee.c | 11 +++++++++++ 3 files changed, 22 insertions(+) diff --git a/ChangeLog b/ChangeLog index 9a5bc3f08..b733d26df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2012-02-26 Bruno Haible + floorf-ieee tests: More tests. + * tests/test-floorf-ieee.c: Include isnanf-nolibm.h, infinity.h, nan.h. + (main): Add tests for [MX] shaded specification in POSIX. + * modules/floorf-ieee-tests (Files): Add tests/infinity.h, tests/nan.h. + (Depends-on): Add isnanf-nolibm. + +2012-02-26 Bruno Haible + fpieee: More comments. * m4/fpieee.m4 (gl_FP_IEEE): Add more comments. diff --git a/modules/floorf-ieee-tests b/modules/floorf-ieee-tests index def689146..3f84817d8 100644 --- a/modules/floorf-ieee-tests +++ b/modules/floorf-ieee-tests @@ -1,9 +1,12 @@ Files: tests/test-floorf-ieee.c tests/minus-zero.h +tests/infinity.h +tests/nan.h tests/macros.h Depends-on: +isnanf-nolibm float signbit diff --git a/tests/test-floorf-ieee.c b/tests/test-floorf-ieee.c index bb6eae84a..88b5c6e3f 100644 --- a/tests/test-floorf-ieee.c +++ b/tests/test-floorf-ieee.c @@ -18,7 +18,10 @@ #include +#include "isnanf-nolibm.h" #include "minus-zero.h" +#include "infinity.h" +#include "nan.h" #include "macros.h" /* If IEEE compliance was not requested, the ICC compiler inlines its @@ -52,5 +55,13 @@ main (int argc, char **argv _GL_UNUSED) ASSERT (!!signbit (my_floorf (-0.3f)) == !!signbit (minus_zerof)); ASSERT (!!signbit (my_floorf (-0.7f)) == !!signbit (minus_zerof)); + /* [MX] shaded specification in POSIX. */ + + /* NaN. */ + ASSERT (isnanf (floorf (NaNf ()))); + /* Infinity. */ + ASSERT (floorf (Infinityf ()) == Infinityf ()); + ASSERT (floorf (- Infinityf ()) == - Infinityf ()); + return 0; } -- 2.11.0