| 24 | } |
| 25 | |
| 26 | void checkFloatInf(const char* input, bool negative) { |
| 27 | CAPTURE(input); |
| 28 | float x = parseNumber<float>(input); |
| 29 | if (negative) |
| 30 | REQUIRE(x < 0); |
| 31 | else |
| 32 | REQUIRE(x > 0); |
| 33 | REQUIRE(x == x); // not a NaN |
| 34 | REQUIRE(x * 2 == x); // a property of infinity |
| 35 | } |
| 36 | |
| 37 | TEST_CASE("parseNumber<float>()") { |
| 38 | SECTION("Float_Short_NoExponent") { |