mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-16 03:52:16 +02:00
JsonArray::remove() and JsonObject::remove() now release the memory of strings
This commit is contained in:
@ -108,6 +108,16 @@ TEST_CASE("JsonVariant::as()") {
|
||||
REQUIRE(variant.as<std::string>() == std::string("hello"));
|
||||
}
|
||||
|
||||
SECTION("set(std::string(\"4.2\"))") {
|
||||
variant.set(std::string("4.2"));
|
||||
|
||||
REQUIRE(variant.as<bool>() == true);
|
||||
REQUIRE(variant.as<long>() == 4L);
|
||||
REQUIRE(variant.as<double>() == 4.2);
|
||||
REQUIRE(variant.as<char*>() == std::string("4.2"));
|
||||
REQUIRE(variant.as<std::string>() == std::string("4.2"));
|
||||
}
|
||||
|
||||
SECTION("set(\"true\")") {
|
||||
variant.set("true");
|
||||
|
||||
|
Reference in New Issue
Block a user