8000 Fixed warning on Clang 8 · joglosemarduino/ArduinoJson@1c814d3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1c814d3

Browse files
committed
Fixed warning on Clang 8
1 parent 9862048 commit 1c814d3

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

test/JsonVariant/compare.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,13 @@ TEST_CASE("JsonVariant comparisons") {
229229
}
230230

231231
SECTION("Variants containing linked strings") {
232-
variant1.set("0hello" + 1); // make sure they have
233-
variant2.set("1hello" + 1); // different addresses
232+
// create two identical strings at different addresses
233+
char hello1[] = "hello";
234+
char hello2[] = "hello";
235+
REQUIRE(hello1 != hello2);
236+
237+
variant1.set(hello1);
238+
variant2.set(hello2);
234239
variant3.set("world");
235240

236241
REQUIRE(variant1 == variant2);
@@ -253,8 +258,13 @@ TEST_CASE("JsonVariant comparisons") {
253258
}
254259

255260
SECTION("Variants containing linked raws") {
256-
variant1.set(serialized("0hello" + 1)); // make sure they have
257-
variant2.set(serialized("1hello" + 1)); // different addresses
261+
// create two identical strings at different addresses
262+
char hello1[] = "hello";
263+
char hello2[] = "hello";
264+
REQUIRE(hello1 != hello2);
265+
266+
variant1.set(serialized(hello1));
267+
variant2.set(serialized(hello2));
258268
variant3.set(serialized("world"));
259269

260270
REQUIRE(variant1 == variant2);

0 commit comments

Comments
 (0)
0