X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-floorl.c;h=6263cc5b1a92aa15ee9c24f321ccbe142c5e856b;hb=e7086a9a301ffcfef17edbcba9e7c0312c33f7a8;hp=5baf36230b6bf8e083a05a827664e62bfe57cc94;hpb=3b63293b88852539e9df5eab6e4e056878cfb650;p=gnulib.git
diff --git a/tests/test-floorl.c b/tests/test-floorl.c
index 5baf36230..6263cc5b1 100644
--- a/tests/test-floorl.c
+++ b/tests/test-floorl.c
@@ -1,10 +1,10 @@
/* Test of rounding towards negative infinity.
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007-2013 Free Software Foundation, Inc.
- This program is free software; you can redistribute it and/or modify
+ 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
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -12,8 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+ along with this program. If not, see . */
/* Written by Bruno Haible , 2007. */
@@ -21,22 +20,17 @@
#include
-#include
-#include
+#include "signature.h"
+SIGNATURE_CHECK (floorl, long double, (long double));
+
+#include
#include "fpucw.h"
#include "isnanl-nolibm.h"
-
-#define ASSERT(expr) \
- do \
- { \
- if (!(expr)) \
- { \
- fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
- abort (); \
- } \
- } \
- while (0)
+#include "minus-zero.h"
+#include "infinity.h"
+#include "nan.h"
+#include "macros.h"
int
main ()
@@ -47,7 +41,7 @@ main ()
/* Zero. */
ASSERT (floorl (0.0L) == 0.0L);
- ASSERT (floorl (-0.0L) == 0.0L);
+ ASSERT (floorl (minus_zerol) == 0.0L);
/* Positive numbers. */
ASSERT (floorl (0.3L) == 0.0L);
ASSERT (floorl (0.7L) == 0.0L);
@@ -70,10 +64,10 @@ main ()
ASSERT (floorl (-65536.0L) == -65536.0L);
ASSERT (floorl (-2.341e31L) == -2.341e31L);
/* Infinite numbers. */
- ASSERT (floorl (1.0L / 0.0L) == 1.0L / 0.0L);
- ASSERT (floorl (-1.0L / 0.0L) == -1.0L / 0.0L);
+ ASSERT (floorl (Infinityl ()) == Infinityl ());
+ ASSERT (floorl (- Infinityl ()) == - Infinityl ());
/* NaNs. */
- ASSERT (isnanl (floorl (0.0L / 0.0L)));
+ ASSERT (isnanl (floorl (NaNl ())));
return 0;
}