mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-16 20:12:16 +02:00
Improve test coverage
This commit is contained in:
@ -97,12 +97,19 @@ TEST_CASE("Not enough room to save the key") {
|
|||||||
DynamicJsonDocument doc(JSON_OBJECT_SIZE(1) + 8);
|
DynamicJsonDocument doc(JSON_OBJECT_SIZE(1) + 8);
|
||||||
|
|
||||||
SECTION("Quoted string") {
|
SECTION("Quoted string") {
|
||||||
|
REQUIRE(deserializeJson(doc, "{\"example\":1}") ==
|
||||||
|
DeserializationError::Ok);
|
||||||
REQUIRE(deserializeJson(doc, "{\"accuracy\":1}") ==
|
REQUIRE(deserializeJson(doc, "{\"accuracy\":1}") ==
|
||||||
DeserializationError::NoMemory);
|
DeserializationError::NoMemory);
|
||||||
|
REQUIRE(deserializeJson(doc, "{\"hello\":1,\"world\"}") ==
|
||||||
|
DeserializationError::NoMemory); // fails in the second string
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("Non-quoted string") {
|
SECTION("Non-quoted string") {
|
||||||
|
REQUIRE(deserializeJson(doc, "{example:1}") == DeserializationError::Ok);
|
||||||
REQUIRE(deserializeJson(doc, "{accuracy:1}") ==
|
REQUIRE(deserializeJson(doc, "{accuracy:1}") ==
|
||||||
DeserializationError::NoMemory);
|
DeserializationError::NoMemory);
|
||||||
|
REQUIRE(deserializeJson(doc, "{hello:1,world}") ==
|
||||||
|
DeserializationError::NoMemory); // fails in the second string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user