mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-17 20:42:24 +02:00
Decouple MemoryPool
from VariantSlot
This commit is contained in:
@ -4,6 +4,7 @@
|
||||
|
||||
#include <ArduinoJson/Memory/MemoryPool.hpp>
|
||||
#include <ArduinoJson/Strings/StringAdapters.hpp>
|
||||
#include <ArduinoJson/Variant/VariantSlot.hpp>
|
||||
#include <catch.hpp>
|
||||
|
||||
using namespace ArduinoJson::detail;
|
||||
@ -14,7 +15,7 @@ TEST_CASE("MemoryPool::clear()") {
|
||||
MemoryPool pool(poolCapacity);
|
||||
|
||||
SECTION("Discards allocated variants") {
|
||||
pool.allocVariant();
|
||||
new (&pool) VariantSlot();
|
||||
|
||||
pool.clear();
|
||||
REQUIRE(pool.size() == 0);
|
||||
|
Reference in New Issue
Block a user