diff --git a/tests/src/unit-json_view_builder.cpp b/tests/src/unit-json_view_builder.cpp index 06059aba8..988c25771 100644 --- a/tests/src/unit-json_view_builder.cpp +++ b/tests/src/unit-json_view_builder.cpp @@ -692,7 +692,7 @@ TEST_CASE("json_view builder: fraction digits") check_same(number); check_same("[" + number + "]"); std::string pair; - pair.reserve(number.size() * 2 + 3); + pair.reserve((number.size() * 2) + 3); pair += '['; pair += number; pair += ','; diff --git a/tests/src/unit-json_view_positions.cpp b/tests/src/unit-json_view_positions.cpp index c6afd7fcb..966c4b46a 100644 --- a/tests/src/unit-json_view_positions.cpp +++ b/tests/src/unit-json_view_positions.cpp @@ -521,7 +521,8 @@ TEST_CASE("json_view exceptions name the path and the bytes of the value") std::string text = "7"; for (int level = 0; level < 40; ++level) { - text = R"([[1, [2]], )" + text + R"(, {"k": [3, {"l": [4]}]}, [5, [6, [7]]]])"; + text.insert(0, R"([[1, [2]], )"); + text += R"(, {"k": [3, {"l": [4]}]}, [5, [6, [7]]]])"; } CAPTURE(text) const json j = json::parse(text);