Test that string can be stored in JsonObject

This commit is contained in:
Benoit Blanchon
2014-09-27 15:24:16 +02:00
parent 0495297c6c
commit a9a51ec1e2
4 changed files with 27 additions and 1 deletions

View File

@ -50,7 +50,6 @@ TEST_F(JsonObjectTests, CanStoreDoubles)
EXPECT_EQ(456.78, (double) object["world"]);
}
TEST_F(JsonObjectTests, CanStoreBooleans)
{
object["hello"] = true;
@ -58,4 +57,13 @@ TEST_F(JsonObjectTests, CanStoreBooleans)
EXPECT_TRUE((bool) object["hello"]);
EXPECT_FALSE((bool) object["world"]);
}
TEST_F(JsonObjectTests, CanStoreStrings)
{
object["hello"] = "h3110";
object["world"] = "w0r1d";
EXPECT_STREQ("h3110", (const char*) object["hello"]);
EXPECT_STREQ("w0r1d", (const char*) object["world"]);
}