bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Test failure on Mac OS 10.8.2


From: Paul Eggert
Subject: Re: Test failure on Mac OS 10.8.2
Date: Fri, 08 Mar 2013 09:47:29 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130221 Thunderbird/17.0.3

On 03/08/2013 09:15 AM, Gary V. Vaughan wrote:

> ../../tests/test-xvasprintf.c: In function 'test_xasprintf':                  
>                  
> ../../tests/test-xvasprintf.c:98: warning: format not a string literal and no 
> format arguments 

That looks like a bogus warning.  Hope you can ignore it.

> stdout has this extra line:
> 
> 0x1p+0 33

OK, thanks, it looks like the gnulib test is being too picky:
it's insisting on round-to-even but POSIX says the rounding
is implementation-defined.  Mac OS should probably be rounding
to even but that's not our job.  I pushed the following patch.

>From 542b625e5a59a143d682b7b8ea0ef3fe03fbfc90 Mon Sep 17 00:00:00 2001
From: Paul Eggert <address@hidden>
Date: Fri, 8 Mar 2013 09:45:29 -0800
Subject: [PATCH] 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>.
---
 ChangeLog                     | 6 ++++++
 tests/test-vasnprintf-posix.c | 3 ++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 537ae93..ef49445 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2013-03-08  Paul Eggert  <address@hidden>
 
+       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 7043988..70582b7 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);
-- 
1.7.11.7





reply via email to

[Prev in Thread] Current Thread [Next in Thread]