Tests: replace constants with sizeofString(n)

This commit is contained in:
Benoit Blanchon committed 2023-04-07 14:50:54 +02:00
1 parent 5e0e35615c
commit e9850152a7
18 files changed
+174 -148

No files matched your search

+2 -1
View File
@@ -8,6 +8,7 @@
using ArduinoJson::detail::sizeofArray;
using ArduinoJson::detail::sizeofObject;
using ArduinoJson::detail::sizeofString;
TEST_CASE("JsonObject::memoryUsage()") {
JsonDocument doc(4096);
@@ -29,7 +30,7 @@ TEST_CASE("JsonObject::memoryUsage()") {
SECTION("includes the size of the key") {
obj[std::string("hello")] = 42;
REQUIRE(obj.memoryUsage() == sizeofObject(1) + 6);
REQUIRE(obj.memoryUsage() == sizeofObject(1) + sizeofString(5));
}
SECTION("includes the size of the nested array") {