[systemd-commits] src/test

David Herrmann dvdhrm at kemper.freedesktop.org
Fri Aug 15 01:46:46 PDT 2014


 src/test/test-util.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ce049dcda4a9d0c9a44667ca82bc9e21d7ea7748
Author: David Herrmann <dh.herrmann at gmail.com>
Date:   Fri Aug 15 10:44:43 2014 +0200

    test: fix strtod() test
    
    One strtod() test is broken since:
    
    commit 8e211000025940b770794abf5754de61b4add0af
    Author: Thomas Hindoe Paaboel Andersen <phomes at gmail.com>
    Date:   Mon Aug 4 23:13:31 2014 +0200
    
        test: use fabs on doubles
    
    The commit was right, so no reason to revert it, but the test was broken
    before and only worked by coincidence. Convert "0,5" to "0.5" so we don't
    depend on locales for double conversion (or well, we depend on "C" which
    seems reasonable).

diff --git a/src/test/test-util.c b/src/test/test-util.c
index 69e3f5d..1850f97 100644
--- a/src/test/test-util.c
+++ b/src/test/test-util.c
@@ -212,7 +212,7 @@ static void test_safe_atod(void) {
         assert_se(r == -EINVAL);
 
         errno = 0;
-        assert_se(fabs(strtod("0,5", &e) - 0.5) < 0.00001);
+        assert_se(fabs(strtod("0.5", &e) - 0.5) < 0.00001);
 
         /* And check again, reset */
         setlocale(LC_NUMERIC, "C");



More information about the systemd-commits mailing list