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

@ -10,7 +10,8 @@ TEST_CASE("JsonObject::createNestedArray()") {
JsonObject obj = doc.to<JsonObject>();
SECTION("key is a const char*") {
obj.createNestedArray("hello");
JsonArray arr = obj.createNestedArray("hello");
REQUIRE(arr.isNull() == false);
}
#ifdef HAS_VARIABLE_LENGTH_ARRAY
@ -19,7 +20,8 @@ TEST_CASE("JsonObject::createNestedArray()") {
char vla[i];
strcpy(vla, "hello");
obj.createNestedArray(vla);
JsonArray arr = obj.createNestedArray(vla);
REQUIRE(arr.isNull() == false);
}
#endif
}