Skip to content

Commit c7e998c

Browse files
committed
Test MemberProxy::add()
1 parent 264538b commit c7e998c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

extras/tests/JsonDocument/MemberProxy.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ TEST_CASE("MemberProxy::add()") {
3232

3333
REQUIRE(doc.as<std::string>() == "{\"hello\":[\"world\"]}");
3434
}
35+
36+
#ifdef HAS_VARIABLE_LENGTH_ARRAY
37+
SECTION("add(vla)") {
38+
size_t i = 16;
39+
char vla[i];
40+
strcpy(vla, "world");
41+
42+
mp.add(vla);
43+
44+
REQUIRE(doc.as<std::string>() == "{\"hello\":[\"world\"]}");
45+
}
46+
#endif
3547
}
3648

3749
TEST_CASE("MemberProxy::clear()") {

0 commit comments

Comments
 (0)