summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2013-03-08 09:45:29 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2013-03-08 09:45:52 -0800
commit167b9ca0ded4e13d5d4559809a4d01f1eddba11e (patch)
treeea5d6c25a5206e1e9eb09e6a8f25e6fdf63c039a
parent26c4b323bf8508a942acb521566c3a0c4309fbff (diff)
downloadgnulib-167b9ca0ded4e13d5d4559809a4d01f1eddba11e.tar.gz
vasnprintf-posix-tests: allow rounding 1.5 to 1
* tests/test-vasnprintf-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.5 to 1 here. Reported by Gary V. Vaughan in <http://lists.gnu.org/archive/html/bug-gnulib/2013-03/msg00019.html>.
-rw-r--r--ChangeLog6
-rw-r--r--tests/test-vasnprintf-posix.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 537ae9372f..ef49445322 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
+ vasnprintf-posix-tests: allow rounding 1.5 to 1
+ * tests/test-vasnprintf-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.5 to 1 here. Reported by Gary V. Vaughan in
+ <http://lists.gnu.org/archive/html/bug-gnulib/2013-03/msg00019.html>.
+
bootstrap: port to FreeBSD
* build-aux/bootstrap (bootstrap_sync): Port sh -c usage to shells
that treat '--' differently. Reported by Mats Erik Andersson in
diff --git a/tests/test-vasnprintf-posix.c b/tests/test-vasnprintf-posix.c
index 7043988832..70582b7122 100644
--- a/tests/test-vasnprintf-posix.c
+++ b/tests/test-vasnprintf-posix.c
@@ -252,7 +252,8 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...))
char *result =
my_asnprintf (NULL, &length, "%.0a %d", 1.5, 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);