mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-16 12:02:14 +02:00
Fixed DynamicJsonBuffer::clear()
not resetting allocation size (fixes #561)
This commit is contained in:
@ -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") {
|
||||
|
Reference in New Issue
Block a user