summaryrefslogtreecommitdiff
path: root/tests/test-strtod.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2019-02-01 02:51:20 +0100
committerBruno Haible <bruno@clisp.org>2019-02-01 02:51:20 +0100
commitcd825c6d50babc1f4fbaccfee3fff1785fe23cc3 (patch)
treefff9beea58bfc2bc70a9c642956937165b9020d1 /tests/test-strtod.c
parent376b353f9dd93e843e9cf264ec192783a23ab21c (diff)
downloadgnulib-cd825c6d50babc1f4fbaccfee3fff1785fe23cc3.tar.gz
strtod, strtold tests: Simplify tests.
* tests/test-strtod.c (main): Assume no rounding errors for 0.5. * tests/test-strtold.c (main): Likewise.
Diffstat (limited to 'tests/test-strtod.c')
-rw-r--r--tests/test-strtod.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/tests/test-strtod.c b/tests/test-strtod.c
index c2297b5b4f..69eb9742e0 100644
--- a/tests/test-strtod.c
+++ b/tests/test-strtod.c
@@ -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);
}