Store the strings in the heap

This commit is contained in:
Benoit Blanchon
2023-04-11 10:03:47 +02:00
parent 7c0fa7c276
commit d8f3058efa
27 changed files with 434 additions and 377 deletions

View File

@ -10,6 +10,11 @@ TEST_CASE("VariantData") {
true);
}
TEST_CASE("StringNode") {
REQUIRE(std::is_standard_layout<ArduinoJson::detail::StringNode>::value ==
true);
}
TEST_CASE("JsonVariant from JsonArray") {
SECTION("JsonArray is null") {
JsonArray arr;

View File

@ -5,6 +5,8 @@
#include <ArduinoJson.h>
#include <catch.hpp>
#include "Allocators.hpp"
enum ErrorCode { ERROR_01 = 1, ERROR_10 = 10 };
TEST_CASE("JsonVariant::set() when there is enough memory") {
@ -128,7 +130,7 @@ TEST_CASE("JsonVariant::set() when there is enough memory") {
}
TEST_CASE("JsonVariant::set() with not enough memory") {
JsonDocument doc(1);
JsonDocument doc(1, FailingAllocator::instance());
JsonVariant v = doc.to<JsonVariant>();