Fixed JsonVariant::isNull() not returning true after set((char*)0)

This commit is contained in:
Benoit Blanchon
2019-02-18 16:04:51 +01:00
parent e9b4c6289b
commit 56bf24e1ec
13 changed files with 127 additions and 47 deletions

View File

@ -64,3 +64,11 @@ TEST_CASE("Invalid JSON string") {
REQUIRE(deserializeJson(doc, input) == DeserializationError::InvalidInput);
}
}
TEST_CASE("Not enough room to duplicate the string") {
DynamicJsonDocument doc(4);
REQUIRE(deserializeJson(doc, "\"hello world!\"") ==
DeserializationError::NoMemory);
REQUIRE(doc.isNull() == true);
}