Remove JsonDocument::data() and JsonDocument::memoryPool()

This commit is contained in:
Benoit Blanchon
2022-08-09 10:33:19 +02:00
parent 1d21027e2a
commit 62e83133cd
10 changed files with 33 additions and 37 deletions

View File

@ -12,7 +12,7 @@ TEST_CASE("StringCopier") {
SECTION("Works when buffer is big enough") {
MemoryPool pool(buffer, addPadding(JSON_STRING_SIZE(5)));
StringCopier str(pool);
StringCopier str(&pool);
str.startString();
str.append("hello");
@ -24,7 +24,7 @@ TEST_CASE("StringCopier") {
SECTION("Returns null when too small") {
MemoryPool pool(buffer, sizeof(void*));
StringCopier str(pool);
StringCopier str(&pool);
str.startString();
str.append("hello world!");
@ -35,7 +35,7 @@ TEST_CASE("StringCopier") {
SECTION("Increases size of memory pool") {
MemoryPool pool(buffer, addPadding(JSON_STRING_SIZE(6)));
StringCopier str(pool);
StringCopier str(&pool);
str.startString();
str.save();
@ -46,7 +46,7 @@ TEST_CASE("StringCopier") {
SECTION("Works when memory pool is 0 bytes") {
MemoryPool pool(buffer, 0);
StringCopier str(pool);
StringCopier str(&pool);
str.startString();
REQUIRE(str.isValid() == false);
@ -55,7 +55,7 @@ TEST_CASE("StringCopier") {
}
static const char* addStringToPool(MemoryPool& pool, const char* s) {
StringCopier str(pool);
StringCopier str(&pool);
str.startString();
str.append(s);
return str.save().c_str();