Mark the code of json_view that tests cannot reach

The 4 GiB limit and the fallback for an input that parse() accepts but
the view rejects (a bug) are excluded from the coverage; shrink_to_fit()
of an empty document is tested.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann
2026-09-29 14:02:46 +02:00
parent aa1a0c7561
commit 207fc01576
4 changed files with 19 additions and 7 deletions
+1 -1
View File
@@ -459,7 +459,7 @@ class basic_json_document
bool ok = false;
if (NLOHMANN_VIEW_UNLIKELY(size >= 0xFFFFFFF0u))
{
failure.code = detail::view::error_code::input_too_large;
failure.code = detail::view::error_code::input_too_large; // LCOV_EXCL_LINE (4 GiB)
}
else
{