优化了平衡,尤其对于向后倾倒的几种极限情况进行优化

This commit is contained in:
myperworld committed 2025-08-16 22:32:06 +08:00
1 parent 10aba2664d
commit fcb8af8163
693 files changed
+2427 -70

No files matched your search

@@ -0,0 +1,25 @@
// ArduinoJson - https://arduinojson.org
// Copyright © 2014-2023, Benoit BLANCHON
// MIT License
#include <ArduinoJson.h>
#include <catch.hpp>
TEST_CASE("JsonObject::clear()") {
SECTION("No-op on null JsonObject") {
JsonObject obj;
obj.clear();
REQUIRE(obj.isNull() == true);
REQUIRE(obj.size() == 0);
}
SECTION("Removes all elements") {
StaticJsonDocument<64> doc;
JsonObject obj = doc.to<JsonObject>();
obj["hello"] = 1;
obj["world"] = 2;
obj.clear();
REQUIRE(obj.size() == 0);
REQUIRE(obj.isNull() == false);
}
}