summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary V. Vaughan <gary@gnu.org>2013-03-09 12:30:56 +0700
committerGary V. Vaughan <gary@gnu.org>2013-03-09 12:30:56 +0700
commit068a8246f0e583a5f0a6943ac2db1a437136a998 (patch)
treede121e76ce4029ebc98f835cdbd5038dd677974c
parent0fe13d91e3815a6b84686114d89fbc93a82d4997 (diff)
downloadgnulib-068a8246f0e583a5f0a6943ac2db1a437136a998.tar.gz
vasprintf-posix-tests: allow rounding 1.51 to 1.
* tests/test-vasprintf-posix.c (test_function): Don't insist on round-to-even, since POSIX says rounding is implementation-defined and OS X 10.8.2 rounds 1.51 to 1 here.
-rw-r--r--ChangeLog6
-rw-r--r--tests/test-vasprintf-posix.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 3308526f4c..805b153068 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2013-03-09 Gary V. Vaughan <gary@gnu.org>
+ vasprintf-posix-tests: allow rounding 1.51 to 1, per the previous
+ changesets, but for the 'precision 0' test.
+ * tests/test-vasprintf-posix.c (test_function): Don't insist on
+ round-to-even, since POSIX says rounding is implementation-defined
+ and OS X 10.8.2 rounds 1.51 to 1 here.
+
vasprintf-posix-tests: allow rounding 1.5 to 1, per the previous
changeset.
* tests/test-vasprintf-posix.c (test_function): Don't insist on
diff --git a/tests/test-vasprintf-posix.c b/tests/test-vasprintf-posix.c
index fc38bc3dbb..c730948d05 100644
--- a/tests/test-vasprintf-posix.c
+++ b/tests/test-vasprintf-posix.c
@@ -246,7 +246,8 @@ test_function (int (*my_asprintf) (char **, const char *, ...))
int retval =
my_asprintf (&result, "%.0a %d", 1.51, 33, 44, 55);
ASSERT (result != NULL);
- ASSERT (strcmp (result, "0x2p+0 33") == 0
+ ASSERT (strcmp (result, "0x1p+0 33") == 0
+ || strcmp (result, "0x2p+0 33") == 0
|| strcmp (result, "0x3p-1 33") == 0
|| strcmp (result, "0x6p-2 33") == 0
|| strcmp (result, "0xcp-3 33") == 0);