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

@ -5,6 +5,8 @@
#include <ArduinoJson.h>
#include <catch.hpp>
using ArduinoJson::detail::sizeofObject;
TEST_CASE("JsonObject::set()") {
JsonDocument doc1(4096);
JsonDocument doc2(4096);
@ -72,7 +74,7 @@ TEST_CASE("JsonObject::set()") {
}
SECTION("destination too small to store the key") {
JsonDocument doc3(JSON_OBJECT_SIZE(1));
JsonDocument doc3(sizeofObject(1));
JsonObject obj3 = doc3.to<JsonObject>();
obj1[std::string("hello")] = "world";
@ -84,7 +86,7 @@ TEST_CASE("JsonObject::set()") {
}
SECTION("destination too small to store the value") {
JsonDocument doc3(JSON_OBJECT_SIZE(1));
JsonDocument doc3(sizeofObject(1));
JsonObject obj3 = doc3.to<JsonObject>();
obj1["hello"] = std::string("world");