diff --git a/extras/tests/Helpers/Allocators.hpp b/extras/tests/Helpers/Allocators.hpp index ab4bbea1..ba648794 100644 --- a/extras/tests/Helpers/Allocators.hpp +++ b/extras/tests/Helpers/Allocators.hpp @@ -120,6 +120,7 @@ class SpyingAllocator : public ArduinoJson::Allocator { _upstream->reallocate(block, sizeof(AllocatedBlock) + n - 1)); if (block) { _log << AllocatorLog::Reallocate(oldSize, n); + ARDUINOJSON_ASSERT(block->size == oldSize); block->size = n; return block->payload; } else { @@ -128,6 +129,10 @@ class SpyingAllocator : public ArduinoJson::Allocator { } } + void clearLog() { + _log = AllocatorLog(); + } + const AllocatorLog& log() const { return _log; }