doc: use ASCII in .texi files where UTF-8 isn't needed
[gnulib.git] / tests / test-hypotl.c
index 52bd72d..66769ae 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of hypotl() 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
@@ -25,38 +25,36 @@ SIGNATURE_CHECK (hypotl, long double, (long double, long double));
 
 #include <float.h>
 
+#include "fpucw.h"
 #include "macros.h"
 
-volatile long double x;
-volatile long double y;
-long double z;
+#undef MIN
+#undef MAX
+
+#define DOUBLE long double
+#define HUGEVAL HUGE_VALL
+#define L_(literal) literal##L
+#define MANT_DIG LDBL_MANT_DIG
+#define MIN LDBL_MIN
+#define MAX LDBL_MAX
+#define HYPOT hypotl
+#define RANDOM randoml
+#include "test-hypot.h"
 
 int
 main ()
 {
+  DECL_LONG_DOUBLE_ROUNDING
+
+  BEGIN_LONG_DOUBLE_ROUNDING ();
+
   /* A particular value.  */
   x = 0.4L;
   y = 0.6L;
   z = hypotl (x, y);
   ASSERT (z >= 0.7211102550L && z <= 0.7211102551L);
 
-  /* Overflow.  */
-  x = LDBL_MAX;
-  y = LDBL_MAX * 0.5L;
-  z = hypotl (x, y);
-  ASSERT (z == HUGE_VALL);
-
-  /* No underflow.  */
-  x = LDBL_MIN;
-  y = 0.0L;
-  z = hypotl (x, y);
-  ASSERT (z == LDBL_MIN);
-
-  /* No underflow.  */
-  x = LDBL_MIN * 2.0L;
-  y = LDBL_MIN * 3.0L;
-  z = hypotl (x, y);
-  ASSERT (z >= LDBL_MIN * 2.0L && z <= LDBL_MIN * 4.0L);
+  test_function ();
 
   return 0;
 }