Added more tests of StaticJsonBuffer

This commit is contained in:
Benoit Blanchon
2014-11-05 21:07:36 +01:00
parent 08de76e2ba
commit 01949f7da0
2 changed files with 58 additions and 0 deletions

View File

@ -39,3 +39,13 @@ TEST(StaticJsonBuffer_Object_Tests, FailsWhenTooSmall) {
JsonObject &object = json.createObject();
ASSERT_FALSE(object.success());
}
TEST(StaticJsonBuffer_Object_Tests, ObjectDoesntGrowWhenFull) {
StaticJsonBuffer<JSON_OBJECT_SIZE(1)> json;
JsonObject &obj = json.createObject();
obj["hello"];
obj["world"];
ASSERT_EQ(JSON_OBJECT_SIZE(1), json.size());
}