File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -229,8 +229,13 @@ TEST_CASE("JsonVariant comparisons") {
229
229
}
230
230
231
231
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);
234
239
variant3.set (" world" );
235
240
236
241
REQUIRE (variant1 == variant2);
@@ -253,8 +258,13 @@ TEST_CASE("JsonVariant comparisons") {
253
258
}
254
259
255
260
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));
258
268
variant3.set (serialized (" world" ));
259
269
260
270
REQUIRE (variant1 == variant2);
You can’t perform that action at this time.
0 commit comments