Update to ArduinoJson 7.0.4

This commit is contained in:
iranl
2024-04-19 14:44:01 +02:00
parent 1378732081
commit 81be0a689a
444 changed files with 10842 additions and 9422 deletions

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org
// Copyright © 2014-2023, Benoit BLANCHON
// Copyright © 2014-2024, Benoit BLANCHON
// MIT License
#include <ArduinoJson.h>
@@ -15,7 +15,7 @@ static void check(JsonArray array, std::string expected) {
}
TEST_CASE("serializeJson(JsonArray)") {
StaticJsonDocument<JSON_ARRAY_SIZE(2)> doc;
JsonDocument doc;
JsonArray array = doc.to<JsonArray>();
SECTION("Empty") {
@@ -41,14 +41,6 @@ TEST_CASE("serializeJson(JsonArray)") {
check(array, "[\"hello\",\"world\"]");
}
SECTION("OneStringOverCapacity") {
array.add("hello");
array.add("world");
array.add("lost");
check(array, "[\"hello\",\"world\"]");
}
SECTION("One double") {
array.add(3.1415927);
check(array, "[3.1415927]");
@@ -80,14 +72,6 @@ TEST_CASE("serializeJson(JsonArray)") {
check(array, "[{\"key\":\"value\"}]");
}
SECTION("OneIntegerOverCapacity") {
array.add(1);
array.add(2);
array.add(3);
check(array, "[1,2]");
}
SECTION("OneTrue") {
array.add(true);
@@ -107,22 +91,14 @@ TEST_CASE("serializeJson(JsonArray)") {
check(array, "[false,true]");
}
SECTION("OneBooleanOverCapacity") {
array.add(false);
array.add(true);
array.add(false);
check(array, "[false,true]");
}
SECTION("OneEmptyNestedArray") {
array.createNestedArray();
array.add<JsonArray>();
check(array, "[[]]");
}
SECTION("OneEmptyNestedHash") {
array.createNestedObject();
array.add<JsonObject>();
check(array, "[{}]");
}