Mercurial > hg > octave-lojdl > gnulib-hg
comparison tests/test-vasprintf-posix.c @ 17360:e2ab31f19799
vasprintf-posix-tests: allow rounding 1.5 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.5 to 1 here.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
author | Gary V. Vaughan <gary@gnu.org> |
---|---|
date | Sat, 09 Mar 2013 11:07:30 +0700 |
parents | e542fd46ad6f |
children | 35650a3443e8 |
comparison
equal
deleted
inserted
replaced
17359:012da8067470 | 17360:e2ab31f19799 |
---|---|
230 { /* Rounding near the decimal point. */ | 230 { /* Rounding near the decimal point. */ |
231 char *result; | 231 char *result; |
232 int retval = | 232 int retval = |
233 my_asprintf (&result, "%.0a %d", 1.5, 33, 44, 55); | 233 my_asprintf (&result, "%.0a %d", 1.5, 33, 44, 55); |
234 ASSERT (result != NULL); | 234 ASSERT (result != NULL); |
235 ASSERT (strcmp (result, "0x2p+0 33") == 0 | 235 ASSERT (strcmp (result, "0x1p+0 33") == 0 |
236 || strcmp (result, "0x2p+0 33") == 0 | |
236 || strcmp (result, "0x3p-1 33") == 0 | 237 || strcmp (result, "0x3p-1 33") == 0 |
237 || strcmp (result, "0x6p-2 33") == 0 | 238 || strcmp (result, "0x6p-2 33") == 0 |
238 || strcmp (result, "0xcp-3 33") == 0); | 239 || strcmp (result, "0xcp-3 33") == 0); |
239 ASSERT (retval == strlen (result)); | 240 ASSERT (retval == strlen (result)); |
240 free (result); | 241 free (result); |