forked from bblanchon/ArduinoJson
Test that size can't go above capacity
This commit is contained in:
1 parent
bb887f94e7
commit
890e811e80
2 files changed
+17
-1
No files matched your search
@@ -22,4 +22,15 @@ TEST(StaticJsonBuffer, WhenCreateObjectIsCalled_ThenSizeIsIncreasedByOne)
|
||||
|
||||
json.createObject();
|
||||
EXPECT_EQ(2, json.size());
|
||||
}
|
||||
|
||||
TEST(StaticJsonBuffer, GivenBufferIsFull_WhenCreateObjectIsCalled_ThenSizeDoesNotChange)
|
||||
{
|
||||
StaticJsonBuffer<1> json;
|
||||
|
||||
json.createObject();
|
||||
EXPECT_EQ(1, json.size());
|
||||
|
||||
json.createObject();
|
||||
EXPECT_EQ(1, json.size());
|
||||
}
|
||||
Reference in new issue
Block a user