forked from bblanchon/ArduinoJson
Test that integers can be stored in a JsonObject
This commit is contained in:
@ -26,4 +26,17 @@ TEST(JsonObjectTests, WhenTheSameValueIsAddedTwice_ThenSizeIsOnlyIncreasedByOne)
|
||||
|
||||
object["hello"];
|
||||
EXPECT_EQ(1, object.size());
|
||||
}
|
||||
|
||||
TEST(JsonObjectTests, WhenAnIntegerIsStore_TheSameIntegerIsRetreived)
|
||||
{
|
||||
StaticJsonBuffer<42> json;
|
||||
|
||||
JsonObject object = json.createObject();
|
||||
|
||||
object["hello"] = 123;
|
||||
object["world"] = 456;
|
||||
|
||||
EXPECT_EQ(123, (int) object["hello"]);
|
||||
EXPECT_EQ(456, (int) object["world"]);
|
||||
}
|
Reference in New Issue
Block a user