8000 Migrate more tests · sarfata/ArduinoJson@597f12f · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 597f12f

Browse files
committed
Migrate more tests
1 parent 38e5627 commit 597f12f

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/ArduinoJson/JsonArray.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ class JsonArray : public Internals::JsonPrintable<JsonArray>,
4141
public Internals::JsonBufferAllocated {
4242
public:
4343
// Create an empty JsonArray attached to the specified JsonBuffer.
44-
// You should not call this constructor directly.
45-
// Instead, use JsonBuffer::createArray() or JsonBuffer::parseArray().
4644
explicit JsonArray(JsonBuffer *buffer) throw()
4745
: Internals::List<JsonVariant>(buffer) {}
4846

test/JsonVariant/subscript.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,20 @@ TEST_CASE("JsonVariant::operator[]") {
6464
}
6565

6666
SECTION("ArraySetValue") {
67-
JsonVariant var = _jsonBuffer.parseArray("[\"hello\"]");
67+
DynamicJsonArray array;
68+
array.add("hello");
69+
70+
JsonVariant var = array;
6871
var[0] = "world";
6972
REQUIRE(1 == var.size());
7073
REQUIRE(std::string("world") == var[0]);
7174
}
7275

7376
SECTION("NestedObjectSetValue") {
74-
JsonVariant var = _jsonBuffer.parseArray("[{}]");
77+
DynamicJsonArray array;
78+
array.createNestedObject();
79+
80+
JsonVariant var = array;
7581
var[0]["hello"] = "world";
7682
REQUIRE(1 == var.size());
7783
REQUIRE(1 == var[0].size());

0 commit comments

Comments
 (0)
0