mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-17 20:42:24 +02:00
Test size() after calling CreateObject
This commit is contained in:
@ -14,6 +14,8 @@ public:
|
||||
|
||||
virtual ~StaticJsonBuffer() {}
|
||||
|
||||
/*JsonObject*/void createObject() { _size++; }
|
||||
|
||||
int capacity()
|
||||
{
|
||||
return CAPACITY;
|
||||
|
@ -12,3 +12,14 @@ 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());
|
||||
}
|
@ -42,9 +42,13 @@
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(ProjectDir)\bin\$(Configuration)\</OutDir>
|
||||
<IntDir>$(ProjectDir)\obj\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(ProjectDir)\bin\$(Configuration)\</OutDir>
|
||||
<IntDir>$(ProjectDir)\obj\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
|
Reference in New Issue
Block a user