chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
554c6b4
)
test/test-parse-util.c: Masked the test of strtod() with set german
author
Sven Eden
<yamakuzure@gmx.net>
Thu, 25 Jan 2018 06:40:28 +0000
(07:40 +0100)
committer
Sven Eden
<yamakuzure@gmx.net>
Thu, 25 Jan 2018 22:04:04 +0000
(23:04 +0100)
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
patch
|
blob
|
history
diff --git
a/src/test/test-parse-util.c
b/src/test/test-parse-util.c
index 0175f3c19a72becab7c7346a09e8108193217292..120a8b103ed0730548a8097b109961154de9b6f9 100644
(file)
--- 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 */