Extracted VariantData and CollectionData classes

This commit is contained in:
Benoit Blanchon
2018-12-07 09:16:58 +01:00
parent 1ad97ebf85
commit b77b203935
45 changed files with 1129 additions and 1007 deletions

View File

@ -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);
}
}