forked from bblanchon/ArduinoJson
Remove JSON_ARRAY_SIZE(), JSON_OBJECT_SIZE(), and JSON_STRING_SIZE()
This commit is contained in:
1 parent
0328f66340
commit
3f43c2b816
36 files changed
+395
-340
No files matched your search
@@ -5,6 +5,8 @@
|
||||
#include <ArduinoJson.h>
|
||||
#include <catch.hpp>
|
||||
|
||||
using ArduinoJson::detail::sizeofArray;
|
||||
|
||||
TEST_CASE("copyArray()") {
|
||||
SECTION("int[] -> JsonArray") {
|
||||
JsonDocument doc(4096);
|
||||
@@ -107,7 +109,7 @@ TEST_CASE("copyArray()") {
|
||||
}
|
||||
|
||||
SECTION("int[] -> JsonArray, but not enough memory") {
|
||||
const size_t SIZE = JSON_ARRAY_SIZE(2);
|
||||
const size_t SIZE = sizeofArray(2);
|
||||
JsonDocument doc(SIZE);
|
||||
JsonArray array = doc.to<JsonArray>();
|
||||
char json[32];
|
||||
@@ -158,8 +160,7 @@ TEST_CASE("copyArray()") {
|
||||
}
|
||||
|
||||
SECTION("int[][] -> JsonArray, but not enough memory") {
|
||||
const size_t SIZE =
|
||||
JSON_ARRAY_SIZE(2) + JSON_ARRAY_SIZE(3) + JSON_ARRAY_SIZE(2);
|
||||
const size_t SIZE = sizeofArray(2) + sizeofArray(3) + sizeofArray(2);
|
||||
JsonDocument doc(SIZE);
|
||||
JsonArray array = doc.to<JsonArray>();
|
||||
char json[32] = "";
|
||||
|
||||
Reference in new issue
Block a user