Merge DynamicJsonDocument with JsonDocument

This commit is contained in:
Benoit Blanchon
2023-03-20 10:49:01 +01:00
parent db9258bcd7
commit 540901e219
164 changed files with 550 additions and 666 deletions

View File

@ -5,9 +5,9 @@
#include <ArduinoJson.h>
#include <catch.hpp>
TEST_CASE("DynamicJsonDocument::operator==(const DynamicJsonDocument&)") {
DynamicJsonDocument doc1(4096);
DynamicJsonDocument doc2(4096);
TEST_CASE("JsonDocument::operator==(const JsonDocument&)") {
JsonDocument doc1(4096);
JsonDocument doc2(4096);
SECTION("Empty") {
REQUIRE(doc1 == doc2);
@ -27,29 +27,3 @@ TEST_CASE("DynamicJsonDocument::operator==(const DynamicJsonDocument&)") {
REQUIRE(doc1 != doc2);
}
}
TEST_CASE("JsonDocument::operator==(const JsonDocument&)") {
DynamicJsonDocument doc1(256);
DynamicJsonDocument doc2(256);
const JsonDocument& ref1 = doc1;
const JsonDocument& ref2 = doc2;
SECTION("Empty") {
REQUIRE(ref1 == ref2);
REQUIRE_FALSE(ref1 != ref2);
}
SECTION("With same object") {
doc1["hello"] = "world";
doc2["hello"] = "world";
REQUIRE(ref1 == ref2);
REQUIRE_FALSE(ref1 != ref2);
}
SECTION("With different object") {
doc1["hello"] = "world";
doc2["world"] = "hello";
REQUIRE_FALSE(ref1 == ref2);
REQUIRE(ref1 != ref2);
}
}