forked from bblanchon/ArduinoJson
Add more tests with VLAs
This commit is contained in:
@ -46,6 +46,18 @@ TEST_CASE("JsonVariant::add(T)") {
|
||||
|
||||
REQUIRE(var.as<std::string>() == "{\"val\":123}");
|
||||
}
|
||||
|
||||
#ifdef HAS_VARIABLE_LENGTH_ARRAY
|
||||
SECTION("supports VLAs") {
|
||||
size_t i = 16;
|
||||
char vla[i];
|
||||
strcpy(vla, "hello");
|
||||
|
||||
var.add(vla);
|
||||
|
||||
REQUIRE(var.as<std::string>() == "[\"hello\"]");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST_CASE("JsonVariant::add<T>()") {
|
||||
|
Reference in New Issue
Block a user