Test that size can't go above capacity

This commit is contained in:
Benoit Blanchon
2014-09-27 11:33:18 +02:00
parent bb887f94e7
commit 890e811e80
2 changed files with 17 additions and 1 deletions

View File

@ -14,7 +14,12 @@ public:
virtual ~StaticJsonBuffer() {}
/*JsonObject*/void createObject() { _size++; }
/*JsonObject*/
void createObject()
{
if (_size < CAPACITY)
_size++;
}
int capacity()
{