Removed configurable number of decimal places (issues #288, #427 and #506)

This commit is contained in:
Benoit Blanchon
2017-05-20 09:06:53 +02:00
parent 639286f8b6
commit cda05aec04
33 changed files with 447 additions and 391 deletions

View File

@ -29,48 +29,8 @@ TEST_CASE("JsonVariant::printTo()") {
check("hello", "\"hello\"");
}
SECTION("DoubleZero") {
check(0.0, "0.00");
}
SECTION("DoubleDefaultDigits") {
check(3.14159265358979323846, "3.14");
}
SECTION("DoubleFourDigits") {
check(JsonVariant(3.14159265358979323846, 4), "3.1416");
}
SECTION("Infinity") {
check(std::numeric_limits<double>::infinity(), "Infinity");
}
SECTION("MinusInfinity") {
check(-std::numeric_limits<double>::infinity(), "-Infinity");
}
SECTION("SignalingNaN") {
check(std::numeric_limits<double>::signaling_NaN(), "NaN");
}
SECTION("QuietNaN") {
check(std::numeric_limits<double>::quiet_NaN(), "NaN");
}
SECTION("VeryBigPositiveDouble") {
check(JsonVariant(3.14159265358979323846e42, 4), "3.1416e42");
}
SECTION("VeryBigNegativeDouble") {
check(JsonVariant(-3.14159265358979323846e42, 4), "-3.1416e42");
}
SECTION("VerySmallPositiveDouble") {
check(JsonVariant(3.14159265358979323846e-42, 4), "3.1416e-42");
}
SECTION("VerySmallNegativeDouble") {
check(JsonVariant(-3.14159265358979323846e-42, 4), "-3.1416e-42");
SECTION("Double") {
check(3.1415927, "3.1415927");
}
SECTION("Integer") {