X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-ldexp.c;h=93574531d7d87de149123519d833904ae35e2cb8;hb=69770559f5bf198928150ac8162734d7f6b99c82;hp=4d0339eac66cb9fd55e20f5a1b4a1d0ff61c2fd7;hpb=692679fcbebba0095bae0f1f1a99bd1f0f5a0476;p=gnulib.git diff --git a/tests/test-ldexp.c b/tests/test-ldexp.c index 4d0339eac..93574531d 100644 --- a/tests/test-ldexp.c +++ b/tests/test-ldexp.c @@ -1,5 +1,5 @@ /* Test of ldexp() function. - Copyright (C) 2010 Free Software Foundation, Inc. + Copyright (C) 2007-2013 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; }