forked from bblanchon/ArduinoJson
Extracted VariantData and CollectionData classes
This commit is contained in:
1 parent
1ad97ebf85
commit
b77b203935
45 files changed
+1129
-1007
No files matched your search
@@ -11,21 +11,21 @@ static const size_t poolCapacity = 512;
|
||||
|
||||
TEST_CASE("MemoryPool::clear()") {
|
||||
char buffer[poolCapacity];
|
||||
MemoryPool memoryPool(buffer, sizeof(buffer));
|
||||
MemoryPool pool(buffer, sizeof(buffer));
|
||||
|
||||
SECTION("Discards allocated variants") {
|
||||
memoryPool.allocVariant();
|
||||
pool.allocVariant();
|
||||
|
||||
memoryPool.clear();
|
||||
REQUIRE(memoryPool.size() == 0);
|
||||
pool.clear();
|
||||
REQUIRE(pool.size() == 0);
|
||||
}
|
||||
|
||||
SECTION("Discards allocated strings") {
|
||||
memoryPool.allocFrozenString(10);
|
||||
REQUIRE(memoryPool.size() > 0);
|
||||
pool.allocFrozenString(10);
|
||||
REQUIRE(pool.size() > 0);
|
||||
|
||||
memoryPool.clear();
|
||||
pool.clear();
|
||||
|
||||
REQUIRE(memoryPool.size() == 0);
|
||||
REQUIRE(pool.size() == 0);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user