diff tests/test-roundf-ieee.c @ 16431:f16e87d6bf2e

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. * modules/roundf-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:27:22 +0100
parents bb182ee4a09d
children e542fd46ad6f
line wrap: on
line diff
--- a/tests/test-roundf-ieee.c
+++ b/tests/test-roundf-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"
 
 int
@@ -39,5 +42,13 @@
   ASSERT (!!signbit (roundf (-0.3f)) == !!signbit (minus_zerof));
   ASSERT (!!signbit (roundf (-0.7f)) == !!signbit (minus_zerof));
 
+  /* [MX] shaded specification in POSIX.  */
+
+  /* NaN.  */
+  ASSERT (isnanf (roundf (NaNf ())));
+  /* Infinity.  */
+  ASSERT (roundf (Infinityf ()) == Infinityf ());
+  ASSERT (roundf (- Infinityf ()) == - Infinityf ());
+
   return 0;
 }