X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-ldexp.c;h=6e04e50829f3a001f1e2ddc5cd2f9acf23398a54;hb=80a029602f5b2707ca8d2487843ecb9e0df74a6a;hp=9eb6e5e32e47092226d130b0b6c6f97fd2e9d948;hpb=d60f3b0c6b0f93a601acd1cfd3923f94ca05abb0;p=gnulib.git
diff --git a/tests/test-ldexp.c b/tests/test-ldexp.c
index 9eb6e5e32..6e04e5082 100644
--- a/tests/test-ldexp.c
+++ b/tests/test-ldexp.c
@@ -1,5 +1,5 @@
/* Test of ldexp() function.
- Copyright (C) 2010-2011 Free Software Foundation, Inc.
+ Copyright (C) 2007-2012 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
-/* Written by Bruno Haible , 2010. */
+/* Written by Bruno Haible , 2007, 2010. */
#include
@@ -23,26 +23,33 @@
#include "signature.h"
SIGNATURE_CHECK (ldexp, double, (double, int));
+#include
+
+#include "isnand-nolibm.h"
+#include "minus-zero.h"
+#include "infinity.h"
+#include "nan.h"
#include "macros.h"
-volatile double x;
-double y;
+#undef INFINITY
+#undef NAN
+
+#define DOUBLE double
+#define ISNAN isnand
+#define INFINITY Infinityd ()
+#define NAN NaNd ()
+#define L_(literal) literal
+#define MINUS_ZERO minus_zerod
+#define MIN_EXP DBL_MIN_EXP
+#define MAX_EXP DBL_MAX_EXP
+#define LDEXP ldexp
+#define RANDOM randomd
+#include "test-ldexp.h"
int
main ()
{
- /* A particular value. */
- x = 0.6;
- y = ldexp (x, 0);
- ASSERT (y >= 0.5999999999 && y <= 0.6000000001);
-
- x = 0.6;
- y = ldexp (x, 1);
- ASSERT (y >= 1.199999999 && y <= 1.200000001);
-
- x = 0.6;
- y = ldexp (x, -1);
- ASSERT (y >= 0.2999999999 && y <= 0.3000000001);
+ test_function ();
return 0;
}