forked from bblanchon/ArduinoJson
Added many tests storing values in JsonValue
This commit is contained in:
@ -19,42 +19,6 @@ class JsonValueTests : public ::testing::Test {
|
||||
JsonValue jsonValue2;
|
||||
};
|
||||
|
||||
TEST_F(JsonValueTests, CanStoreInteger) {
|
||||
jsonValue1 = 123;
|
||||
|
||||
EXPECT_EQ(123, jsonValue1.as<int>());
|
||||
}
|
||||
|
||||
TEST_F(JsonValueTests, CanStoreDouble) {
|
||||
jsonValue1 = 123.45;
|
||||
|
||||
EXPECT_EQ(123.45, jsonValue1.as<double>());
|
||||
}
|
||||
|
||||
TEST_F(JsonValueTests, CanStoreTrue) {
|
||||
jsonValue1 = true;
|
||||
EXPECT_TRUE(jsonValue1.as<bool>());
|
||||
}
|
||||
|
||||
TEST_F(JsonValueTests, CanStoreFalse) {
|
||||
jsonValue1 = false;
|
||||
EXPECT_FALSE(jsonValue1.as<bool>());
|
||||
}
|
||||
|
||||
TEST_F(JsonValueTests, CanStoreString) {
|
||||
jsonValue1 = "hello";
|
||||
|
||||
EXPECT_STREQ("hello", jsonValue1.as<const char *>());
|
||||
}
|
||||
|
||||
TEST_F(JsonValueTests, CanStoreObject) {
|
||||
JsonObject &innerObject1 = json.createObject();
|
||||
|
||||
jsonValue1 = innerObject1;
|
||||
|
||||
EXPECT_EQ(innerObject1, jsonValue1.asObject());
|
||||
}
|
||||
|
||||
TEST_F(JsonValueTests, IntegersAreCopiedByValue) {
|
||||
jsonValue1 = 123;
|
||||
jsonValue2 = jsonValue1;
|
||||
|
Reference in New Issue
Block a user