Commit 9c8d0a21 authored by Niklas Haas's avatar Niklas Haas
Browse files

tests/string: make float tests non-exact

These fail on 32-bit platforms otherwise.
parent a22da272
Pipeline #85024 passed with stages
in 8 minutes and 3 seconds
......@@ -79,11 +79,11 @@ int main()
float f;
int i;
REQUIRE(pl_str_parse_float(pl_str0("1.3984"), &f) && f == 1.3984f);
REQUIRE(pl_str_parse_float(pl_str0("-8.9100083"), &f) && f == -8.9100083f);
REQUIRE(pl_str_parse_float(pl_str0("-0"), &f) && f == 0.0f);
REQUIRE(pl_str_parse_float(pl_str0("-3.14e20"), &f) && f == -3.14e20f);
REQUIRE(pl_str_parse_float(pl_str0("0.5e-5"), &f) && f == 0.5e-5f);
REQUIRE(pl_str_parse_float(pl_str0("1.3984"), &f) && feq(f, 1.3984f, 1e-8));
REQUIRE(pl_str_parse_float(pl_str0("-8.9100083"), &f) && feq(f, -8.9100083f, 1e-8));
REQUIRE(pl_str_parse_float(pl_str0("-0"), &f) && feq(f, 0.0f, 1e-8));
REQUIRE(pl_str_parse_float(pl_str0("-3.14e20"), &f) && feq(f, -3.14e20f, 1e-8));
REQUIRE(pl_str_parse_float(pl_str0("0.5e-5"), &f) && feq(f, 0.5e-5f, 1e-8));
REQUIRE(pl_str_parse_int(pl_str0("64239"), &i) && i == 64239);
REQUIRE(pl_str_parse_int(pl_str0("-102"), &i) && i == -102);
REQUIRE(pl_str_parse_int(pl_str0("-0"), &i) && i == 0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment