Add overload JsonObjectSuscript::set(value, decimals) (issue #143)

This commit is contained in:
Benoit Blanchon committed 2015-10-30 22:29:47 +01:00
1 parent b9e3255c9e
commit 9f3ce18f06
6 files changed
+48 -18

No files matched your search

+8
View File
@@ -46,6 +46,14 @@ TEST_(StoreDouble) {
EXPECT_FALSE(_object["hello"].is<long>());
}
TEST_(StoreDoubleWithDigits) {
_object.set("hello", 123.45, 2);
EXPECT_EQ(123.45, _object["hello"].as<double>());
EXPECT_TRUE(_object["hello"].is<double>());
EXPECT_FALSE(_object["hello"].is<long>());
}
TEST_(StoreBoolean) {
_object.set("hello", true);
+8
View File
@@ -46,6 +46,14 @@ TEST_(StoreDouble) {
EXPECT_EQ(123.45, _object["hello"].as<double>());
}
TEST_(StoreDoubleWithDigits) {
_object["hello"].set(123.45, 2);
EXPECT_TRUE(_object["hello"].is<double>());
EXPECT_FALSE(_object["hello"].is<long>());
EXPECT_EQ(123.45, _object["hello"].as<double>());
}
TEST_(StoreBoolean) {
_object["hello"] = true;