Skip to content

Commit b4ca901

Browse files
committed
Test ElementProxy assignment
1 parent a215103 commit b4ca901

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

extras/tests/JsonDocument/ElementProxy.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,18 @@ TEST_CASE("ElementProxy::operator[]") {
217217

218218
REQUIRE(doc.as<std::string>() == "[null,[null,null,42]]");
219219
}
220+
221+
#ifdef HAS_VARIABLE_LENGTH_ARRAY
222+
SECTION("set VLA") {
223+
size_t i = 8;
224+
char vla[i];
225+
strcpy(vla, "world");
226+
227+
ep[0] = vla;
228+
229+
REQUIRE(doc.as<std::string>() == "[null,[\"world\"]]");
230+
}
231+
#endif
220232
}
221233

222234
TEST_CASE("ElementProxy cast to JsonVariantConst") {

0 commit comments

Comments
 (0)