test: fix strtod() test
One strtod() test is broken since:
commit 8e21100002
Author: Thomas Hindoe Paaboel Andersen <phomes@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).
This commit is contained in:
parent
2301cb9fdb
commit
ce049dcda4
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue