From 68d0a7b246ed7a9641a12025e8a8c7ac80127e54 Mon Sep 17 00:00:00 2001 From: Isaac Nickaein Date: Sat, 9 Nov 2019 21:19:12 +0330 Subject: [PATCH] Reduce depth in unit-test to avoid choking valgrind --- test/src/unit-regression.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/src/unit-regression.cpp b/test/src/unit-regression.cpp index a5da394c..faf2da54 100644 --- a/test/src/unit-regression.cpp +++ b/test/src/unit-regression.cpp @@ -1780,10 +1780,10 @@ TEST_CASE("regression tests") SECTION("issue #1419 - Segmentation fault (stack overflow) due to unbounded recursion") { - const int depth = 8000000; + const auto depth = 5000000; - std::string s(depth, '['); - s += std::string(depth, ']'); + std::string s(2 * depth, '['); + std::fill(s.begin() + depth, s.end(), ']'); CHECK_NOTHROW(nlohmann::json::parse(s)); }