forked from bblanchon/ArduinoJson
Merge DynamicJsonDocument with JsonDocument
This commit is contained in:
1 parent
db9258bcd7
commit
540901e219
164 files changed
+550
-666
No files matched your search
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user