mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-15 11:36:36 +02:00
Redesigned JsonVariant to leverage converting constructors instead of assignment operators
This commit is contained in:
@ -13,12 +13,12 @@ TEST(DynamicJsonBuffer_Object_Tests, GrowsWithObject) {
|
||||
JsonObject &obj = json.createObject();
|
||||
ASSERT_EQ(JSON_OBJECT_SIZE(0), json.size());
|
||||
|
||||
obj["hello"];
|
||||
obj["hello"] = 1;
|
||||
ASSERT_EQ(JSON_OBJECT_SIZE(1), json.size());
|
||||
|
||||
obj["world"];
|
||||
obj["world"] = 2;
|
||||
ASSERT_EQ(JSON_OBJECT_SIZE(2), json.size());
|
||||
|
||||
obj["world"]; // <- same value, should not grow
|
||||
obj["world"] = 3; // <- same key, should not grow
|
||||
ASSERT_EQ(JSON_OBJECT_SIZE(2), json.size());
|
||||
}
|
||||
|
Reference in New Issue
Block a user