From 9dbd679dbb8ff4e098b916b6477c03d82daea635 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Sun, 11 Sep 2022 13:11:15 +0200 Subject: [PATCH] :rewind: revert fix --- tests/src/unit-constructor1.cpp | 50 ++++++++++++++++----------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/tests/src/unit-constructor1.cpp b/tests/src/unit-constructor1.cpp index d8e83b13b..1741dd2e7 100644 --- a/tests/src/unit-constructor1.cpp +++ b/tests/src/unit-constructor1.cpp @@ -1119,9 +1119,9 @@ TEST_CASE("constructors") SECTION("constructor with implicit types (object)") { // This should break through any short string optimization in std::string - std::string const source(1024, '!'); + std::string source(1024, '!'); const auto* source_addr = source.data(); - json const j = {{"key", std::move(source)}}; + json j = {{"key", std::move(source)}}; const auto* target_addr = j["key"].get_ref().data(); const bool success = (target_addr == source_addr); CHECK(success); @@ -1130,7 +1130,7 @@ TEST_CASE("constructors") SECTION("constructor with implicit types (object key)") { // This should break through any short string optimization in std::string - std::string const source(1024, '!'); + std::string source(1024, '!'); const auto* source_addr = source.data(); json j = {{std::move(source), 42}}; const auto* target_addr = j.get_ref().begin()->first.data(); @@ -1143,9 +1143,9 @@ TEST_CASE("constructors") { SECTION("constructor with implicit types (array)") { - json::array_t const source = {1, 2, 3}; + json::array_t source = {1, 2, 3}; const auto* source_addr = source.data(); - json const j {std::move(source)}; + json j {std::move(source)}; const auto* target_addr = j[0].get_ref().data(); const bool success = (target_addr == source_addr); CHECK(success); @@ -1153,8 +1153,8 @@ TEST_CASE("constructors") SECTION("constructor with implicit types (object)") { - json::array_t const source = {1, 2, 3}; - const auto* source_addr = source.data(); + json::array_t source = {1, 2, 3}; + auto* source_addr = source.data(); json const j {{"key", std::move(source)}}; const auto* target_addr = j["key"].get_ref().data(); const bool success = (target_addr == source_addr); @@ -1163,9 +1163,9 @@ TEST_CASE("constructors") SECTION("assignment with implicit types (array)") { - json::array_t const source = {1, 2, 3}; + json::array_t source = {1, 2, 3}; const auto* source_addr = source.data(); - json const j = {std::move(source)}; + json j = {std::move(source)}; const auto* target_addr = j[0].get_ref().data(); const bool success = (target_addr == source_addr); CHECK(success); @@ -1173,9 +1173,9 @@ TEST_CASE("constructors") SECTION("assignment with implicit types (object)") { - json::array_t const source = {1, 2, 3}; + json::array_t source = {1, 2, 3}; const auto* source_addr = source.data(); - json const j = {{"key", std::move(source)}}; + json j = {{"key", std::move(source)}}; const auto* target_addr = j["key"].get_ref().data(); const bool success = (target_addr == source_addr); CHECK(success); @@ -1186,17 +1186,17 @@ TEST_CASE("constructors") { SECTION("constructor with implicit types (array)") { - json::object_t const source = {{"hello", "world"}}; + json::object_t source = {{"hello", "world"}}; const json* source_addr = &source.at("hello"); - json const j {std::move(source)}; + json j {std::move(source)}; CHECK(&(j[0].get_ref().at("hello")) == source_addr); } SECTION("constructor with implicit types (object)") { - json::object_t const source = {{"hello", "world"}}; + json::object_t source = {{"hello", "world"}}; const json* source_addr = &source.at("hello"); - json const j {{"key", std::move(source)}}; + json j {{"key", std::move(source)}}; CHECK(&(j["key"].get_ref().at("hello")) == source_addr); } @@ -1210,9 +1210,9 @@ TEST_CASE("constructors") SECTION("assignment with implicit types (object)") { - json::object_t const source = {{"hello", "world"}}; + json::object_t source = {{"hello", "world"}}; const json* source_addr = &source.at("hello"); - json const j = {{"key", std::move(source)}}; + json j = {{"key", std::move(source)}}; CHECK(&(j["key"].get_ref().at("hello")) == source_addr); } } @@ -1221,33 +1221,33 @@ TEST_CASE("constructors") { SECTION("constructor with implicit types (array)") { - json const source {1, 2, 3}; + json source {1, 2, 3}; const json* source_addr = &source[0]; - json const j {std::move(source), {}}; + json j {std::move(source), {}}; CHECK(&j[0][0] == source_addr); } SECTION("constructor with implicit types (object)") { - json const source {1, 2, 3}; + json source {1, 2, 3}; const json* source_addr = &source[0]; - json const j {{"key", std::move(source)}}; + json j {{"key", std::move(source)}}; CHECK(&j["key"][0] == source_addr); } SECTION("assignment with implicit types (array)") { - json const source {1, 2, 3}; + json source {1, 2, 3}; const json* source_addr = &source[0]; - json const j = {std::move(source), {}}; + json j = {std::move(source), {}}; CHECK(&j[0][0] == source_addr); } SECTION("assignment with implicit types (object)") { - json const source {1, 2, 3}; + json source {1, 2, 3}; const json* source_addr = &source[0]; - json const j = {{"key", std::move(source)}}; + json j = {{"key", std::move(source)}}; CHECK(&j["key"][0] == source_addr); } }