Added JSON_PROXY to copy arrays and objects by reference

This commit is contained in:
Benoit Blanchon committed 2014-10-09 18:20:40 +02:00
1 parent bf2d726746
commit 35eaa55b3a
12 files changed
+138 -66

No files matched your search

+2 -6
View File
@@ -101,12 +101,10 @@ TEST_F(JsonValueTests, ObjectsAreCopiedByReference)
JsonObject object = json.createObject();
jsonValue1 = object;
jsonValue2 = jsonValue1;
object["hello"] = "world";
jsonValue1 = 0;
EXPECT_EQ(1, ((JsonObject) jsonValue2).size());
EXPECT_EQ(1, ((JsonObject) jsonValue1).size());
}
TEST_F(JsonValueTests, ArraysAreCopiedByReference)
@@ -114,10 +112,8 @@ TEST_F(JsonValueTests, ArraysAreCopiedByReference)
JsonArray array = json.createArray();
jsonValue1 = array;
jsonValue2 = jsonValue1;
jsonValue1 = 0;
array.add("world");
EXPECT_EQ(1, ((JsonObject) jsonValue2).size());
EXPECT_EQ(1, ((JsonObject) jsonValue1).size());
}