From: David Herrmann Date: Fri, 15 Aug 2014 08:44:43 +0000 (+0200) Subject: test: fix strtod() test X-Git-Tag: v216~97 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=ce049dcda4a9d0c9a44667ca82bc9e21d7ea7748 test: fix strtod() test One strtod() test is broken since: commit 8e211000025940b770794abf5754de61b4add0af Author: Thomas Hindoe Paaboel Andersen 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 69e3f5d3a..1850f9772 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");