]> Savannah Git Hosting - gnulib.git/commitdiff
strtod, strtold tests: Simplify tests.
authorBruno Haible <bruno@clisp.org>
Fri, 1 Feb 2019 01:51:20 +0000 (02:51 +0100)
committerBruno Haible <bruno@clisp.org>
Fri, 1 Feb 2019 01:51:20 +0000 (02:51 +0100)
* tests/test-strtod.c (main): Assume no rounding errors for 0.5.
* tests/test-strtold.c (main): Likewise.

ChangeLog
tests/test-strtod.c
tests/test-strtold.c

index d4cf812b9779b31c7a20ad3872df889593953bb1..37c92029696e37ebf4ceda591450939eff9540ee 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2019-01-31  Bruno Haible  <bruno@clisp.org>
+
+       strtod, strtold tests: Simplify tests.
+       * tests/test-strtod.c (main): Assume no rounding errors for 0.5.
+       * tests/test-strtold.c (main): Likewise.
+
 2019-01-31  Bruno Haible  <bruno@clisp.org>
 
        strtod, strtold: Avoid unnecessary rounding errors.
index c2297b5b4f6fb9f70ae21c8ceda088a46812985f..69eb9742e0b6e281d772eaf6f7551278bc1411f6 100644 (file)
@@ -155,10 +155,7 @@ main (void)
     double result;
     errno = 0;
     result = strtod (input, &ptr);
-    /* FIXME - gnulib's version is rather inaccurate.  It would be
-       nice to guarantee an exact result, but for now, we settle for a
-       1-ulp error.  */
-    ASSERT (FABS (result - 0.5) < DBL_EPSILON);
+    ASSERT (result == 0.5);
     ASSERT (ptr == input + 2);
     ASSERT (errno == 0);
   }
@@ -238,10 +235,7 @@ main (void)
     double result;
     errno = 0;
     result = strtod (input, &ptr);
-    /* FIXME - gnulib's version is rather inaccurate.  It would be
-       nice to guarantee an exact result, but for now, we settle for a
-       1-ulp error.  */
-    ASSERT (FABS (result - 0.5) < DBL_EPSILON);
+    ASSERT (result == 0.5);
     ASSERT (ptr == input + 4);
     ASSERT (errno == 0);
   }
index cd317875b96395e87c6b30fc0c95160669df0055..9815e7ae2bfc67d903f349a5dc6edc83ac5cecd9 100644 (file)
@@ -155,10 +155,7 @@ main (void)
     long double result;
     errno = 0;
     result = strtold (input, &ptr);
-    /* FIXME - gnulib's version is rather inaccurate.  It would be
-       nice to guarantee an exact result, but for now, we settle for a
-       1-ulp error.  */
-    ASSERT (FABSL (result - 0.5L) < LDBL_EPSILON);
+    ASSERT (result == 0.5L);
     ASSERT (ptr == input + 2);
     ASSERT (errno == 0);
   }
@@ -238,10 +235,7 @@ main (void)
     long double result;
     errno = 0;
     result = strtold (input, &ptr);
-    /* FIXME - gnulib's version is rather inaccurate.  It would be
-       nice to guarantee an exact result, but for now, we settle for a
-       1-ulp error.  */
-    ASSERT (FABSL (result - 0.5L) < LDBL_EPSILON);
+    ASSERT (result == 0.5L);
     ASSERT (ptr == input + 4);
     ASSERT (errno == 0);
   }