X-Git-Url: https://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-hypot.c;h=efa81aceda519ca0cbce95fc1beeee4e87ddad4b;hb=25a6731afb775d2fe8ab53ea944158137d458462;hp=d8cf7faaffb9aa508f9a2116bf4d62bae69c65c7;hpb=260aec2c20bc33e0a8117efe9435939caded3747;p=gnulib.git diff --git a/tests/test-hypot.c b/tests/test-hypot.c index d8cf7faaf..efa81aced 100644 --- a/tests/test-hypot.c +++ b/tests/test-hypot.c @@ -1,5 +1,5 @@ /* Test of hypot() function. - Copyright (C) 2010-2012 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 @@ -27,9 +27,18 @@ SIGNATURE_CHECK (hypot, double, (double, double)); #include "macros.h" -volatile double x; -volatile double y; -double z; +#undef MIN +#undef MAX + +#define DOUBLE double +#define HUGEVAL HUGE_VAL +#define L_(literal) literal +#define MANT_DIG DBL_MANT_DIG +#define MIN DBL_MIN +#define MAX DBL_MAX +#define HYPOT hypot +#define RANDOM randomd +#include "test-hypot.h" int main () @@ -40,23 +49,7 @@ main () z = hypot (x, y); ASSERT (z >= 0.7211102550 && z <= 0.7211102551); - /* Overflow. */ - x = DBL_MAX; - y = DBL_MAX * 0.5; - z = hypot (x, y); - ASSERT (z == HUGE_VAL); - - /* No underflow. */ - x = DBL_MIN; - y = 0.0; - z = hypot (x, y); - ASSERT (z == DBL_MIN); - - /* No underflow. */ - x = DBL_MIN * 2.0; - y = DBL_MIN * 3.0; - z = hypot (x, y); - ASSERT (z >= DBL_MIN * 2.0 && z <= DBL_MIN * 4.0); + test_function (); return 0; }