tests: add signature checks
[gnulib.git] / tests / test-truncl.c
index aad677d..3b36ea7 100644 (file)
 
 #include <math.h>
 
+#include "signature.h"
+SIGNATURE_CHECK (truncl, long double, (long double));
+
 #include <float.h>
 #include <stdio.h>
 #include <stdlib.h>
 
 #include "fpucw.h"
 #include "isnanl-nolibm.h"
+#include "nan.h"
 
 #define ASSERT(expr) \
-  do                                                                        \
-    {                                                                       \
-      if (!(expr))                                                          \
-        {                                                                   \
+  do                                                                         \
+    {                                                                        \
+      if (!(expr))                                                           \
+        {                                                                    \
           fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
-          fflush (stderr);                                                  \
-          abort ();                                                         \
-        }                                                                   \
-    }                                                                       \
+          fflush (stderr);                                                   \
+          abort ();                                                          \
+        }                                                                    \
+    }                                                                        \
   while (0)
 
 /* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
@@ -89,7 +93,7 @@ main ()
   ASSERT (truncl (1.0L / 0.0L) == 1.0L / 0.0L);
   ASSERT (truncl (-1.0L / 0.0L) == -1.0L / 0.0L);
   /* NaNs.  */
-  ASSERT (isnanl (truncl (0.0L / 0.0L)));
+  ASSERT (isnanl (truncl (NaNl ())));
 
   return 0;
 }