mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-22 14:57:33 +02:00
Preallocate pool list
This commit is contained in:
@ -344,7 +344,7 @@ TEST_CASE("deserialize JSON object under memory constraints") {
|
||||
REQUIRE(doc.as<std::string>() == "{}");
|
||||
}
|
||||
|
||||
SECTION("pool list allocation fails") {
|
||||
SECTION("pool allocation fails") {
|
||||
allocator.setCountdown(2);
|
||||
char input[] = "{\"a\":1}";
|
||||
|
||||
@ -354,18 +354,8 @@ TEST_CASE("deserialize JSON object under memory constraints") {
|
||||
REQUIRE(doc.as<std::string>() == "{}");
|
||||
}
|
||||
|
||||
SECTION("pool allocation fails") {
|
||||
allocator.setCountdown(3);
|
||||
char input[] = "{\"a\":1}";
|
||||
|
||||
DeserializationError err = deserializeJson(doc, input);
|
||||
|
||||
REQUIRE(err == DeserializationError::NoMemory);
|
||||
REQUIRE(doc.as<std::string>() == "{}");
|
||||
}
|
||||
|
||||
SECTION("string allocation fails") {
|
||||
allocator.setCountdown(4);
|
||||
allocator.setCountdown(3);
|
||||
char input[] = "{\"a\":\"b\"}";
|
||||
|
||||
DeserializationError err = deserializeJson(doc, input);
|
||||
|
Reference in New Issue
Block a user