Test that adding values to the JsonObject increase the size of the buffer

This commit is contained in:
Benoit Blanchon committed 2014-09-27 12:16:53 +02:00
1 parent 4d4119e589
commit 166bdd6919
8 files changed
+74 -17

No files matched your search

+8 -10
View File
@@ -4,8 +4,10 @@
#include "JsonObject.h"
template<int CAPACITY>
class StaticJsonBuffer //: public JsonBuffer
class StaticJsonBuffer : public JsonBuffer
{
friend JsonObject;
public:
explicit StaticJsonBuffer()
@@ -15,14 +17,6 @@ public:
virtual ~StaticJsonBuffer() {}
JsonObject createObject()
{
if (_size < CAPACITY)
_size++;
return JsonObject();
}
int capacity()
{
return CAPACITY;
@@ -34,7 +28,11 @@ public:
}
protected:
//virtual JsonNode& allocateNode();
virtual /*JsonNode&*/void allocateNode()
{
if (_size < CAPACITY)
_size++;
}
private:
//JsonNode _buffer[CAPACITY];