X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-hypotf.c;h=ff86aef05ea04c5b7c51140ee10651fc0f14b254;hb=fa1db0dd22768f09a507674a30beb5b8a87bb35f;hp=f1b0c17a36d3281cabb19d5bcb9b568f95d7124b;hpb=cecd5115b408a0c0d04af38206d897a627bded76;p=gnulib.git diff --git a/tests/test-hypotf.c b/tests/test-hypotf.c index f1b0c17a3..ff86aef05 100644 --- a/tests/test-hypotf.c +++ b/tests/test-hypotf.c @@ -1,5 +1,5 @@ /* Test of hypotf() function. - Copyright (C) 2010-2012 Free Software Foundation, Inc. + Copyright (C) 2010-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 @@ -27,9 +27,18 @@ SIGNATURE_CHECK (hypotf, float, (float, float)); #include "macros.h" -volatile float x; -volatile float y; -float z; +#undef MIN +#undef MAX + +#define DOUBLE float +#define HUGEVAL HUGE_VALF +#define L_(literal) literal##f +#define MANT_DIG FLT_MANT_DIG +#define MIN FLT_MIN +#define MAX FLT_MAX +#define HYPOT hypotf +#define RANDOM randomf +#include "test-hypot.h" int main () @@ -40,23 +49,7 @@ main () z = hypot (x, y); ASSERT (z >= 0.7211102f && z <= 0.7211103f); - /* Overflow. */ - x = FLT_MAX; - y = FLT_MAX * 0.5f; - z = hypotf (x, y); - ASSERT (z == HUGE_VALF); - - /* No underflow. */ - x = FLT_MIN; - y = 0.0f; - z = hypotf (x, y); - ASSERT (z == FLT_MIN); - - /* No underflow. */ - x = FLT_MIN * 2.0f; - y = FLT_MIN * 3.0f; - z = hypotf (x, y); - ASSERT (z >= FLT_MIN * 2.0f && z <= FLT_MIN * 4.0f); + test_function (); return 0; }