From: Sven Eden Date: Thu, 25 Jan 2018 06:40:28 +0000 (+0100) Subject: test/test-parse-util.c: Masked the test of strtod() with set german X-Git-Tag: v235.3~17 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=7739c87f49c9a17cfecc288289c5ca91cb242607;p=elogind.git test/test-parse-util.c: Masked the test of strtod() with set german locale to be only used with __GLIBC__. It seems that the strtod() function in stdlib.h from musl_libc does not heed the set locale. It fails with a german floating point number. --- diff --git a/src/test/test-parse-util.c b/src/test/test-parse-util.c index 0175f3c19..120a8b103 100644 --- a/src/test/test-parse-util.c +++ b/src/test/test-parse-util.c @@ -526,7 +526,10 @@ static void test_safe_atod(void) { assert_se(r == -EINVAL); errno = 0; +/// elogind supports musl_libc, and their strtod doesn't seem to use the set locale. +#if defined(__GLIBC__) assert_se(fabs(strtod("0,5", &e) - 0.5) < 0.00001); +#endif // __GLIBC__ } /* And check again, reset */