Test size() after calling CreateObject

This commit is contained in:
Benoit Blanchon
2014-09-27 10:16:30 +02:00
parent 6e45f7c790
commit bb887f94e7
3 changed files with 17 additions and 0 deletions

View File

@ -11,4 +11,15 @@ TEST(StaticJsonBuffer, InitialSizeIsZero)
{
StaticJsonBuffer<42> json;
EXPECT_EQ(0, json.size());
}
TEST(StaticJsonBuffer, WhenCreateObjectIsCalled_ThenSizeIsIncreasedByOne)
{
StaticJsonBuffer<42> json;
json.createObject();
EXPECT_EQ(1, json.size());
json.createObject();
EXPECT_EQ(2, json.size());
}