forked from bblanchon/ArduinoJson
Test size() after calling CreateObject
This commit is contained in:
@ -14,6 +14,8 @@ public:
|
|||||||
|
|
||||||
virtual ~StaticJsonBuffer() {}
|
virtual ~StaticJsonBuffer() {}
|
||||||
|
|
||||||
|
/*JsonObject*/void createObject() { _size++; }
|
||||||
|
|
||||||
int capacity()
|
int capacity()
|
||||||
{
|
{
|
||||||
return CAPACITY;
|
return CAPACITY;
|
||||||
|
@ -12,3 +12,14 @@ TEST(StaticJsonBuffer, InitialSizeIsZero)
|
|||||||
StaticJsonBuffer<42> json;
|
StaticJsonBuffer<42> json;
|
||||||
EXPECT_EQ(0, json.size());
|
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());
|
||||||
|
}
|
@ -42,9 +42,13 @@
|
|||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<LinkIncremental>true</LinkIncremental>
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
<OutDir>$(ProjectDir)\bin\$(Configuration)\</OutDir>
|
||||||
|
<IntDir>$(ProjectDir)\obj\$(Configuration)\</IntDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<LinkIncremental>false</LinkIncremental>
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<OutDir>$(ProjectDir)\bin\$(Configuration)\</OutDir>
|
||||||
|
<IntDir>$(ProjectDir)\obj\$(Configuration)\</IntDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
|
Reference in New Issue
Block a user