Test that nested JsonObject can be stored

This commit is contained in:
Benoit Blanchon committed 2014-09-27 16:18:40 +02:00
1 parent bcc8cece24
commit bc44c36385
9 files changed
+114 -5

No files matched your search

+12
View File
@@ -66,4 +66,16 @@ TEST_F(JsonObjectTests, CanStoreStrings)
EXPECT_STREQ("h3110", (const char*) object["hello"]);
EXPECT_STREQ("w0r1d", (const char*) object["world"]);
}
TEST_F(JsonObjectTests, CanStoreInnerObjects)
{
JsonObject innerObject1 = json.createObject();
JsonObject innerObject2 = json.createObject();
object["hello"] = innerObject1;
object["world"] = innerObject2;
EXPECT_EQ(innerObject1, (JsonObject) object["hello"]);
EXPECT_EQ(innerObject2, (JsonObject) object["world"]);
}