From c46067b1d9b8cf5b0b425413c0250713763dfa00 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Wed, 20 May 2026 22:08:45 +0200 Subject: [PATCH] :bug: avoid overflow Signed-off-by: Niels Lohmann --- tests/src/unit-inspection.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/src/unit-inspection.cpp b/tests/src/unit-inspection.cpp index 9d6d06e23..83349484e 100644 --- a/tests/src/unit-inspection.cpp +++ b/tests/src/unit-inspection.cpp @@ -254,6 +254,8 @@ TEST_CASE("object inspection") CHECK(j_array.dump(1024).size() == 25622); // check if right indentation symbol is used CHECK(j_array.dump(1024, '\t')[4096] == '\t'); + // check resize is large enough + CHECK(j_array.dump(10000).size() == 250022); } SECTION("object") @@ -263,6 +265,8 @@ TEST_CASE("object inspection") CHECK(j_object.dump(1024).size() == 25642); // check if right indentation symbol is used CHECK(j_object.dump(1024, '\t')[4096] == '\t'); + // check resize is large enough + CHECK(j_object.dump(10000).size() == 250042); } SECTION("binary") @@ -271,6 +275,8 @@ TEST_CASE("object inspection") // check right size after indentation triggering a resize CHECK(j_binary.dump(1024).size() == 2086); CHECK(j_binary.dump(1024, '\t')[1024] == '\t'); + // check resize is large enough + CHECK(j_binary.dump(10000).size() == 20038); } }