Update to ArduinoJson 7.0.4
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright © 2014-2023, Benoit BLANCHON
|
||||
// Copyright © 2014-2024, Benoit BLANCHON
|
||||
// MIT License
|
||||
|
||||
#include <ArduinoJson.h>
|
||||
#include <catch.hpp>
|
||||
|
||||
TEST_CASE("JsonVariant::isNull()") {
|
||||
DynamicJsonDocument doc(4096);
|
||||
JsonDocument doc;
|
||||
JsonVariant variant = doc.to<JsonVariant>();
|
||||
|
||||
SECTION("returns true when Undefined") {
|
||||
@@ -20,7 +20,7 @@ TEST_CASE("JsonVariant::isNull()") {
|
||||
}
|
||||
|
||||
SECTION("returns false when EmptyArray") {
|
||||
DynamicJsonDocument doc2(4096);
|
||||
JsonDocument doc2;
|
||||
JsonArray array = doc2.to<JsonArray>();
|
||||
|
||||
variant.set(array);
|
||||
@@ -28,7 +28,7 @@ TEST_CASE("JsonVariant::isNull()") {
|
||||
}
|
||||
|
||||
SECTION("returns false when EmptyObject") {
|
||||
DynamicJsonDocument doc2(4096);
|
||||
JsonDocument doc2;
|
||||
JsonObject obj = doc2.to<JsonObject>();
|
||||
|
||||
variant.set(obj);
|
||||
@@ -69,25 +69,4 @@ TEST_CASE("JsonVariant::isNull()") {
|
||||
variant.set(serialized(static_cast<const char*>(0)));
|
||||
REQUIRE(variant.isNull() == true);
|
||||
}
|
||||
|
||||
SECTION("returns true for a shallow null copy") {
|
||||
StaticJsonDocument<128> doc2;
|
||||
variant.shallowCopy(doc2);
|
||||
CHECK(variant.isNull() == true);
|
||||
}
|
||||
|
||||
SECTION("returns false for a shallow array copy") {
|
||||
StaticJsonDocument<128> doc2;
|
||||
doc2[0] = 42;
|
||||
variant.shallowCopy(doc2);
|
||||
CHECK(variant.isNull() == false);
|
||||
}
|
||||
|
||||
SECTION("works with JsonVariantConst") {
|
||||
variant.set(42);
|
||||
|
||||
JsonVariantConst cvar = variant;
|
||||
|
||||
REQUIRE(cvar.isNull() == false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user