forked from bblanchon/ArduinoJson
Fix crash when adding an object member in a too small JsonDocument
This commit is contained in:
1 parent
4b4c68df5f
commit
ee12155617
3 files changed
+13
No files matched your search
@@ -35,6 +35,12 @@ TEST_CASE("JsonDocument::overflowed()") {
|
||||
CHECK(doc.overflowed() == false);
|
||||
}
|
||||
|
||||
SECTION("returns true after a failed member add") {
|
||||
StaticJsonDocument<1> doc;
|
||||
doc["example"] = true;
|
||||
CHECK(doc.overflowed() == true);
|
||||
}
|
||||
|
||||
SECTION("returns true after a failed deserialization") {
|
||||
StaticJsonDocument<JSON_ARRAY_SIZE(1)> doc;
|
||||
deserializeJson(doc, "[\"example\"]");
|
||||
|
||||
Reference in new issue
Block a user