Fix JsonVariantTests

This commit is contained in:
Benoit Blanchon
2025-05-31 16:29:46 +00:00
parent cc2fea45cd
commit 3f6fff7d0c

View File

@ -8,7 +8,7 @@
#include "Allocators.hpp"
#include "Literals.hpp"
using ArduinoJson::detail::sizeofObject;
using namespace ArduinoJson::detail;
enum ErrorCode { ERROR_01 = 1, ERROR_10 = 10 };
@ -199,8 +199,8 @@ TEST_CASE("JsonVariant::set() when there is enough memory") {
REQUIRE(variant.as<double>() == 1.2);
REQUIRE(spy.log() ==
AllocatorLog{
Allocate(sizeofPool()),
Reallocate(sizeofPool(), sizeofPool(1)), // one extension slot
Allocate(sizeofPool<EightByteValue>()),
Reallocate(sizeofPool<EightByteValue>(), sizeofPool<EightByteValue>(1)),
});
}
@ -222,8 +222,8 @@ TEST_CASE("JsonVariant::set() when there is enough memory") {
REQUIRE(variant.as<int64_t>() == -2147483649LL);
REQUIRE(spy.log() ==
AllocatorLog{
Allocate(sizeofPool()),
Reallocate(sizeofPool(), sizeofPool(1)), // one extension slot
Allocate(sizeofPool<EightByteValue>()),
Reallocate(sizeofPool<EightByteValue>(), sizeofPool<EightByteValue>(1)),
});
}
@ -245,8 +245,8 @@ TEST_CASE("JsonVariant::set() when there is enough memory") {
REQUIRE(variant.as<uint64_t>() == 4294967296);
REQUIRE(spy.log() ==
AllocatorLog{
Allocate(sizeofPool()),
Reallocate(sizeofPool(), sizeofPool(1)), // one extension slot
Allocate(sizeofPool<EightByteValue>()),
Reallocate(sizeofPool<EightByteValue>(), sizeofPool<EightByteValue>(1)),
});
}