Copy JsonArray and JsonObject, instead of storing pointers (fixes #780)

This commit is contained in:
Benoit Blanchon
2018-09-11 16:05:56 +02:00
parent 2998a55f0b
commit b106b1ed14
52 changed files with 971 additions and 978 deletions

View File

@ -160,6 +160,12 @@ TEST_CASE("JsonObject::operator[]") {
REQUIRE(obj[null] == 0);
}
SECTION("obj[key].to<JsonArray>()") {
JsonArray arr = obj["hello"].to<JsonArray>();
REQUIRE(arr.isNull() == false);
}
#if defined(HAS_VARIABLE_LENGTH_ARRAY) && \
!defined(SUBSCRIPT_CONFLICTS_WITH_BUILTIN_OPERATOR)
SECTION("obj[VLA] = str") {