Test that nested JsonObject can be stored

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

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"]);
}