Remove JSON_ARRAY_SIZE(), JSON_OBJECT_SIZE(), and JSON_STRING_SIZE()

This commit is contained in:
Benoit Blanchon
2023-03-29 19:18:06 +02:00
parent 0328f66340
commit 3f43c2b816
36 changed files with 395 additions and 340 deletions

View File

@ -8,6 +8,8 @@
#define ARDUINOJSON_ENABLE_ARDUINO_STREAM 1
#include <ArduinoJson.h>
using ArduinoJson::detail::sizeofArray;
struct PrintOneCharacterAtATime {
static size_t printStringTo(const std::string& s, Print& p) {
size_t result = 0;
@ -139,6 +141,6 @@ TEST_CASE("Printable") {
REQUIRE(doc.size() == 2);
CHECK(doc[0] == "Hello World!");
CHECK(doc[1] == "Hello World!");
CHECK(doc.memoryUsage() == JSON_ARRAY_SIZE(2) + 13);
CHECK(doc.memoryUsage() == sizeofArray(2) + 13);
}
}