Fixed DynamicJsonBuffer::clear() not resetting allocation size (fixes #561)

This commit is contained in:
Benoit Blanchon
2017-08-30 21:51:10 +02:00
parent ac5a2676e7
commit 57defe00ee
3 changed files with 15 additions and 14 deletions

View File

@ -46,7 +46,7 @@ TEST_CASE("DynamicJsonBuffer::alloc()") {
REQUIRE(allocatorLog.str() == "A1A2FF");
}
SECTION("Keeps increasing allocation size after clear") {
SECTION("Resets allocation size after clear()") {
allocatorLog.str("");
{
DynamicJsonBufferBase<SpyingAllocator> buffer(1);
@ -55,7 +55,7 @@ TEST_CASE("DynamicJsonBuffer::alloc()") {
buffer.clear();
buffer.alloc(1);
}
REQUIRE(allocatorLog.str() == "A1A2FFA4F");
REQUIRE(allocatorLog.str() == "A1A2FFA1F");
}
SECTION("Makes a big allocation when needed") {