From 7739c87f49c9a17cfecc288289c5ca91cb242607 Mon Sep 17 00:00:00 2001 From: Sven Eden Date: Thu, 25 Jan 2018 07:40:28 +0100 Subject: [PATCH] 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. --- src/test/test-parse-util.c | 3 +++ 1 file changed, 3 insertions(+) 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 */ -- 2.30.2