// ArduinoJson - https://arduinojson.org // Copyright © 2014-2023, Benoit BLANCHON // MIT License #include #include TEST_CASE("JsonDocument::isNull()") { DynamicJsonDocument doc(4096); SECTION("returns true if uninitialized") { REQUIRE(doc.isNull() == true); } SECTION("returns false after to()") { doc.to(); REQUIRE(doc.isNull() == false); } SECTION("returns false after to()") { doc.to(); REQUIRE(doc.isNull() == false); } SECTION("returns true after to()") { REQUIRE(doc.isNull() == true); } SECTION("returns false after set()") { doc.to().set(42); REQUIRE(doc.isNull() == false); } SECTION("returns true after clear()") { doc.to(); doc.clear(); REQUIRE(doc.isNull() == true); } }