|
9 | 9 | #include <catch.hpp>
|
10 | 10 |
|
11 | 11 | TEST_CASE("StaticJsonBuffer::parseArray()") {
|
12 |
| - SECTION("StaticJsonBuffer of the right size of 0 elements&
10000
quot;) { |
13 |
| - StaticJsonBuffer<JSON_ARRAY_SIZE(0)> jb; |
14 |
| - JsonArray& arr = jb.createArray(); |
| 12 | + SECTION("StaticJsonArray of the right size of 0 elements") { |
| 13 | + StaticJsonArray<JSON_ARRAY_SIZE(0)> arr; |
15 | 14 | char input[] = "[]";
|
16 | 15 | REQUIRE(true == parseJson(arr, input));
|
17 | 16 | }
|
18 | 17 |
|
19 |
| - SECTION("StaticJsonBuffer too small for 1 element") { |
20 |
| - StaticJsonBuffer<JSON_ARRAY_SIZE(1) - 1> jb; |
21 |
| - JsonArray& arr = jb.createArray(); |
| 18 | + SECTION("StaticJsonArray too small for 1 element") { |
| 19 | + StaticJsonArray<JSON_ARRAY_SIZE(1) - 1> arr; |
22 | 20 | char input[] = "[1]";
|
23 | 21 | REQUIRE(false == parseJson(arr, input));
|
24 | 22 | }
|
25 | 23 |
|
26 |
| - SECTION("StaticJsonBuffer of the right size of 1 element") { |
27 |
| - StaticJsonBuffer<JSON_ARRAY_SIZE(1)> jb; |
28 |
| - JsonArray& arr = jb.createArray(); |
| 24 | + SECTION("StaticJsonArray of the right size of 1 element") { |
| 25 | + StaticJsonArray<JSON_ARRAY_SIZE(1)> arr; |
29 | 26 | char input[] = "[1]";
|
30 | 27 | REQUIRE(true == parseJson(arr, input));
|
31 | 28 | }
|
32 | 29 |
|
33 |
| - SECTION("StaticJsonBuffer too small for 1 nested object") { |
34 |
| - StaticJsonBuffer<JSON_ARRAY_SIZE(1) + JSON_OBJECT_SIZE(0) - 1> jb; |
35 |
| - JsonArray& arr = jb.createArray(); |
| 30 | + SECTION("StaticJsonArray too small for 1 nested object") { |
| 31 | + StaticJsonArray<JSON_ARRAY_SIZE(1) + JSON_OBJECT_SIZE(0) - 1> arr; |
36 | 32 | char input[] = "[{}]";
|
37 | 33 | REQUIRE(false == parseJson(arr, input));
|
38 | 34 | }
|
39 | 35 |
|
40 |
| - SECTION("StaticJsonBuffer of the right size of 1 nested object") { |
41 |
| - StaticJsonBuffer<JSON_ARRAY_SIZE(1) + JSON_OBJECT_SIZE(0)> jb; |
42 |
| - JsonArray& arr = jb.createArray(); |
| 36 | + SECTION("StaticJsonArray of the right size of 1 nested object") { |
| 37 | + StaticJsonArray<JSON_ARRAY_SIZE(1) + JSON_OBJECT_SIZE(0)> arr; |
43 | 38 | char input[] = "[{}]";
|
44 | 39 | REQUIRE(true == parseJson(arr, input));
|
45 | 40 | }
|
46 | 41 |
|
47 | 42 | SECTION("Input is char* NULL") {
|
48 |
| - StaticJsonBuffer<100> jb; |
49 |
| - JsonArray& arr = jb.createArray(); |
| 43 | + StaticJsonArray<100> arr; |
50 | 44 | REQUIRE(false == parseJson(arr, static_cast<char*>(0)));
|
51 | 45 | }
|
52 | 46 |
|
|
0 commit comments