Fixed warning on Clang 8

This commit is contained in:
Benoit Blanchon
2019-03-24 19:39:23 +01:00
parent 9862048a58
commit 1c814d3bb6

View File

@ -229,8 +229,13 @@ TEST_CASE("JsonVariant comparisons") {
} }
SECTION("Variants containing linked strings") { SECTION("Variants containing linked strings") {
variant1.set("0hello" + 1); // make sure they have // create two identical strings at different addresses
variant2.set("1hello" + 1); // different addresses char hello1[] = "hello";
char hello2[] = "hello";
REQUIRE(hello1 != hello2);
variant1.set(hello1);
variant2.set(hello2);
variant3.set("world"); variant3.set("world");
REQUIRE(variant1 == variant2); REQUIRE(variant1 == variant2);
@ -253,8 +258,13 @@ TEST_CASE("JsonVariant comparisons") {
} }
SECTION("Variants containing linked raws") { SECTION("Variants containing linked raws") {
variant1.set(serialized("0hello" + 1)); // make sure they have // create two identical strings at different addresses
variant2.set(serialized("1hello" + 1)); // different addresses char hello1[] = "hello";
char hello2[] = "hello";
REQUIRE(hello1 != hello2);
variant1.set(serialized(hello1));
variant2.set(serialized(hello2));
variant3.set(serialized("world")); variant3.set(serialized("world"));
REQUIRE(variant1 == variant2); REQUIRE(variant1 == variant2);