mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-19 05:22:24 +02:00
Tests: replace constants with sizeofString(n)
This commit is contained in:
@ -7,6 +7,7 @@
|
||||
|
||||
using ArduinoJson::detail::sizeofArray;
|
||||
using ArduinoJson::detail::sizeofObject;
|
||||
using ArduinoJson::detail::sizeofString;
|
||||
|
||||
TEST_CASE("JsonArray::memoryUsage()") {
|
||||
JsonDocument doc(4096);
|
||||
@ -28,7 +29,7 @@ TEST_CASE("JsonArray::memoryUsage()") {
|
||||
|
||||
SECTION("includes the size of the string") {
|
||||
arr.add(std::string("hello"));
|
||||
REQUIRE(arr.memoryUsage() == sizeofArray(1) + 6);
|
||||
REQUIRE(arr.memoryUsage() == sizeofArray(1) + sizeofString(5));
|
||||
}
|
||||
|
||||
SECTION("includes the size of the nested array") {
|
||||
|
Reference in New Issue
Block a user