5 #include <ArduinoJson/Memory/MemoryPool.hpp>
8 using namespace ARDUINOJSON_NAMESPACE;
10 TEST_CASE(
"MemoryPool::capacity()") {
12 const size_t capacity = 64;
14 REQUIRE(capacity == pool.capacity());
17 TEST_CASE(
"MemoryPool::size()") {
21 SECTION(
"Initial size is 0") {
22 REQUIRE(0 == pool.size());
25 SECTION(
"Doesn't grow when memory pool is full") {
26 const size_t variantCount =
sizeof(buffer) /
sizeof(
VariantSlot);
28 for (
size_t i = 0; i < variantCount; i++) pool.allocVariant();
29 size_t size = pool.size();
33 REQUIRE(size == pool.size());