// ArduinoJson - https://arduinojson.org // Copyright © 2014-2024, Benoit BLANCHON // MIT License #include #include using ArduinoJson::detail::is_base_of; TEST_CASE("StaticJsonDocument") { SECTION("is a JsonDocument") { REQUIRE(is_base_of>::value == true); } SECTION("deserialize / serialize") { StaticJsonDocument<256> doc; deserializeJson(doc, "{\"hello\":\"world\"}"); REQUIRE(doc.as() == "{\"hello\":\"world\"}"); } SECTION("copy") { StaticJsonDocument<256> doc; doc["hello"] = "world"; auto copy = doc; REQUIRE(copy.as() == "{\"hello\":\"world\"}"); } SECTION("capacity") { StaticJsonDocument<256> doc; REQUIRE(doc.capacity() == 256); } }