fish_tests: Use std::isnan

Fixes the tests on Ubuntu 16.04 "xenial".
This commit is contained in:
Fabian Homborg 2019-01-05 12:31:24 +01:00
parent 4548f4f4b0
commit b8b0c39c77

View File

@ -29,6 +29,7 @@
#include <algorithm>
#include <array>
#include <atomic>
#include <cmath>
#include <functional>
#include <memory>
#include <set>
@ -2302,7 +2303,7 @@ static void test_wcstod() {
wchar_t *wide_end = nullptr;
double val1 = wcstod(a, &wide_end);
double val2 = strtod(b, &narrow_end);
do_test((isnan(val1) && isnan(val2)) || fabs(val1 - val2) <= __DBL_EPSILON__);
do_test((std::isnan(val1) && std::isnan(val2)) || fabs(val1 - val2) <= __DBL_EPSILON__);
do_test(wide_end - a == narrow_end - b);
};
tod_test(L"", "");