summaryrefslogtreecommitdiff
path: root/tests/test-strtod1.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2019-12-13 00:19:56 +0100
committerBruno Haible <bruno@clisp.org>2019-12-13 00:21:07 +0100
commit1fabf601fa87579a9eaed42c92c6bb9a97922c1d (patch)
tree80c9498d7725553abc6978723613225ebf6b1390 /tests/test-strtod1.c
parent73de34d3b440d5d3d9786b954cedab96dbbdfecf (diff)
downloadgnulib-1fabf601fa87579a9eaed42c92c6bb9a97922c1d.tar.gz
strtod, strtold tests: Avoid test failure on AIX 7.2.
* tests/test-strtod1.c (main): Allow implementations in which ',' and '.' both are radix characters. * tests/test-strtold1.c (main): Likewise.
Diffstat (limited to 'tests/test-strtod1.c')
-rw-r--r--tests/test-strtod1.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/test-strtod1.c b/tests/test-strtod1.c
index 75200ccfea..26b96beaa0 100644
--- a/tests/test-strtod1.c
+++ b/tests/test-strtod1.c
@@ -68,8 +68,10 @@ main (int argc, char *argv[])
double result;
errno = 0;
result = strtod (input, &ptr);
- ASSERT (result == 1.0);
- ASSERT (ptr == input + 1);
+ /* On AIX 7.2, in the French locale, '.' is recognized as an alternate
+ radix character. */
+ ASSERT ((ptr == input + 1 && result == 1.0)
+ || (ptr == input + 3 && result == 1.5));
ASSERT (errno == 0);
}
{
@@ -78,8 +80,10 @@ main (int argc, char *argv[])
double result;
errno = 0;
result = strtod (input, &ptr);
- ASSERT (result == 123.0);
- ASSERT (ptr == input + 3);
+ /* On AIX 7.2, in the French locale, '.' is recognized as an alternate
+ radix character. */
+ ASSERT ((ptr == input + 3 && result == 123.0)
+ || (ptr == input + 7 && result > 123.45 && result < 123.46));
ASSERT (errno == 0);
}
{