Update ArduinoJSON, esp-nimble-cpp, Arduino Core, ESP-IDF (#448)

* ArduinoJSON 7.1.0

* Update nimble and arduino core

* Update nuki_ble
This commit is contained in:
iranl
2024-08-11 11:20:31 +02:00
committed by GitHub
parent 4af90cbc79
commit 9d55c2173d
216 changed files with 6437 additions and 5705 deletions

View File

@@ -7,6 +7,8 @@
#include <sstream>
#include "Literals.hpp"
#define SHOULD_WORK(expression) REQUIRE(DeserializationError::Ok == expression);
#define SHOULD_FAIL(expression) \
REQUIRE(DeserializationError::TooDeep == expression);
@@ -63,23 +65,23 @@ TEST_CASE("JsonDeserializer nesting") {
SECTION("Input = std::string") {
SECTION("limit = 0") {
DeserializationOption::NestingLimit nesting(0);
SHOULD_WORK(deserializeJson(doc, std::string("\"toto\""), nesting));
SHOULD_WORK(deserializeJson(doc, std::string("123"), nesting));
SHOULD_WORK(deserializeJson(doc, std::string("true"), nesting));
SHOULD_FAIL(deserializeJson(doc, std::string("[]"), nesting));
SHOULD_FAIL(deserializeJson(doc, std::string("{}"), nesting));
SHOULD_FAIL(deserializeJson(doc, std::string("[\"toto\"]"), nesting));
SHOULD_FAIL(deserializeJson(doc, std::string("{\"toto\":1}"), nesting));
SHOULD_WORK(deserializeJson(doc, "\"toto\""_s, nesting));
SHOULD_WORK(deserializeJson(doc, "123"_s, nesting));
SHOULD_WORK(deserializeJson(doc, "true"_s, nesting));
SHOULD_FAIL(deserializeJson(doc, "[]"_s, nesting));
SHOULD_FAIL(deserializeJson(doc, "{}"_s, nesting));
SHOULD_FAIL(deserializeJson(doc, "[\"toto\"]"_s, nesting));
SHOULD_FAIL(deserializeJson(doc, "{\"toto\":1}"_s, nesting));
}
SECTION("limit = 1") {
DeserializationOption::NestingLimit nesting(1);
SHOULD_WORK(deserializeJson(doc, std::string("[\"toto\"]"), nesting));
SHOULD_WORK(deserializeJson(doc, std::string("{\"toto\":1}"), nesting));
SHOULD_FAIL(deserializeJson(doc, std::string("{\"toto\":{}}"), nesting));
SHOULD_FAIL(deserializeJson(doc, std::string("{\"toto\":[]}"), nesting));
SHOULD_FAIL(deserializeJson(doc, std::string("[[\"toto\"]]"), nesting));
SHOULD_FAIL(deserializeJson(doc, std::string("[{\"toto\":1}]"), nesting));
SHOULD_WORK(deserializeJson(doc, "[\"toto\"]"_s, nesting));
SHOULD_WORK(deserializeJson(doc, "{\"toto\":1}"_s, nesting));
SHOULD_FAIL(deserializeJson(doc, "{\"toto\":{}}"_s, nesting));
SHOULD_FAIL(deserializeJson(doc, "{\"toto\":[]}"_s, nesting));
SHOULD_FAIL(deserializeJson(doc, "[[\"toto\"]]"_s, nesting));
SHOULD_FAIL(deserializeJson(doc, "[{\"toto\":1}]"_s, nesting));
}
}