forked from bblanchon/ArduinoJson
Tests: add SpyingAllocator::clearLog()
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user