NEWS.stable: log cherry-pick [e446f25]->[c092018] relocatable-shell: Update suggested...
[gnulib.git] / tests / test-rint.c
index 0a8a010..f49294b 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of rint() function.
-   Copyright (C) 2010-2011 Free Software Foundation, Inc.
+   Copyright (C) 2010-2014 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -32,6 +32,18 @@ SIGNATURE_CHECK (rint, double, (double));
 #include "nan.h"
 #include "macros.h"
 
+#undef INFINITY
+#undef NAN
+
+#define DOUBLE double
+#define ISNAN isnand
+#define INFINITY Infinityd ()
+#define NAN NaNd ()
+#define L_(literal) literal
+#define RINT rint
+#define RANDOM randomd
+#include "test-rint.h"
+
 int
 main ()
 {
@@ -75,11 +87,8 @@ main ()
       ASSERT (rint (-65536.0) == -65536.0);
       ASSERT (rint (-65536.001) == -65536.0);
       ASSERT (rint (-2.341e31) == -2.341e31);
-      /* Infinite numbers.  */
-      ASSERT (rint (Infinityd ()) == Infinityd ());
-      ASSERT (rint (- Infinityd ()) == - Infinityd ());
-      /* NaNs.  */
-      ASSERT (isnand (rint (NaNd ())));
+
+      test_function ();
 
       return 0;
     }