Skip to content

Commit

Permalink
Increased coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
bblanchon committed May 14, 2017
1 parent cffee6e commit e938b4c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/JsonWriter/writeFloat.cpp
Expand Up @@ -24,9 +24,7 @@ void check(double input, const std::string& expected) {
}

TEST_CASE("JsonWriter::writeFloat()") {
SECTION("Pi") {
check(3.14159265359, "3.141592654");
}
SECTION("Pi") { check(3.14159265359, "3.141592654"); }

SECTION("Signaling NaN") {
double nan = std::numeric_limits<double>::signaling_NaN();
Expand Down Expand Up @@ -59,6 +57,12 @@ TEST_CASE("JsonWriter::writeFloat()") {
check(-1.7976931348623157E+308, "-1.797693135e308");
}

SECTION("Big exponent") {
// this test increases coverage of normalize()
check(1e200, "1e200");
check(1e-200, "1e-200");
}

SECTION("Exponentation when <= 1e-5") {
check(1e-4, "0.0001");
check(1e-5, "1e-5");
Expand Down

0 comments on commit e938b4c

Please sign in to comment.