changeset 16422:62527036e51c

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.
author Bruno Haible <bruno@clisp.org>
date Sun, 26 Feb 2012 14:23:35 +0100
parents 8305194b98c1
children 81d79089d6a0
files ChangeLog modules/floorf-ieee-tests tests/test-floorf-ieee.c
diffstat 3 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2012-02-26  Bruno Haible  <bruno@clisp.org>
+
+	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  <bruno@clisp.org>
 
 	fpieee: More comments.
--- 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
 
--- a/tests/test-floorf-ieee.c
+++ b/tests/test-floorf-ieee.c
@@ -18,7 +18,10 @@
 
 #include <math.h>
 
+#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 @@
   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;
 }