From: Bruno Haible <bruno@clisp.org>
Date: Sun, 26 Feb 2012 13:26:44 +0000 (+0100)
Subject: trunc-ieee tests: More tests.
X-Git-Tag: v0.1~1097
X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=0248e75ce939a386964b243089f3b8a49159715f;p=gnulib.git

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.
* modules/trunc-ieee-tests (Files): Add tests/infinity.h, tests/nan.h.
(Depends-on): Add isnand-nolibm.
---

diff --git a/ChangeLog b/ChangeLog
index eb9f783aee..d1679b34a8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2012-02-26  Bruno Haible  <bruno@clisp.org>
 
+	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.
+	* modules/trunc-ieee-tests (Files): Add tests/infinity.h, tests/nan.h.
+	(Depends-on): Add isnand-nolibm.
+
 	truncf-ieee tests: More tests.
 	* tests/test-truncf-ieee.c: Include isnanf-nolibm.h, infinity.h, nan.h.
 	(main): Add tests for [MX] shaded specification in POSIX.
diff --git a/modules/trunc-ieee-tests b/modules/trunc-ieee-tests
index 80bafef887..3299a7bbf0 100644
--- a/modules/trunc-ieee-tests
+++ b/modules/trunc-ieee-tests
@@ -1,9 +1,12 @@
 Files:
 tests/test-trunc-ieee.c
 tests/minus-zero.h
+tests/infinity.h
+tests/nan.h
 tests/macros.h
 
 Depends-on:
+isnand-nolibm
 float
 signbit
 
diff --git a/tests/test-trunc-ieee.c b/tests/test-trunc-ieee.c
index e40289fd4e..b6b90c10f6 100644
--- a/tests/test-trunc-ieee.c
+++ b/tests/test-trunc-ieee.c
@@ -18,7 +18,10 @@
 
 #include <math.h>
 
+#include "isnand-nolibm.h"
 #include "minus-zero.h"
+#include "infinity.h"
+#include "nan.h"
 #include "macros.h"
 
 int
@@ -39,5 +42,13 @@ main ()
   ASSERT (!!signbit (trunc (-0.3)) == !!signbit (minus_zerod));
   ASSERT (!!signbit (trunc (-0.7)) == !!signbit (minus_zerod));
 
+  /* [MX] shaded specification in POSIX.  */
+
+  /* NaN.  */
+  ASSERT (isnand (trunc (NaNd ())));
+  /* Infinity.  */
+  ASSERT (trunc (Infinityd ()) == Infinityd ());
+  ASSERT (trunc (- Infinityd ()) == - Infinityd ());
+
   return 0;
 }