From 70d1baa57aa9be1e3fab19e866fc67ba14ec4f8c Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Fri, 23 Oct 2026 18:53:34 +0200 Subject: [PATCH] Remove a nested duplicate guard from the json_view image test clang-tidy reported the inner #if !defined(JSON_NOEXCEPTION) as redundant (the test case is in the same #if) and a find() != npos, which gets the NOLINT the other tests use. Signed-off-by: Niels Lohmann --- tests/src/unit-json_view_image.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/src/unit-json_view_image.cpp b/tests/src/unit-json_view_image.cpp index fa9676617..62b0c3f39 100644 --- a/tests/src/unit-json_view_image.cpp +++ b/tests/src/unit-json_view_image.cpp @@ -682,7 +682,6 @@ TEST_CASE("json_view images: ownership") #if !defined(JSON_NOEXCEPTION) TEST_CASE("json_view images: errors") { -#if !defined(JSON_NOEXCEPTION) SECTION("float tokens: a changed byte is accepted if the text is still a number with the digits the node records") { for (const char* const token : @@ -721,7 +720,7 @@ TEST_CASE("json_view images: errors") } } // (as a JSON text, the token may have white space around it) - const bool float_token = json::accept(t) && t.find_first_of(std::string(" \t\r\n\0", 5)) == std::string::npos && (t.find('.') != std::string::npos || t.find_first_of("eE") != std::string::npos) + const bool float_token = json::accept(t) && t.find_first_of(std::string(" \t\r\n\0", 5)) == std::string::npos && (t.find('.') != std::string::npos || t.find_first_of("eE") != std::string::npos) // NOLINT(abseil-string-find-str-contains) && ((integer | (fraction << 8U)) == recorded); CAPTURE(pos) CAPTURE(byte) @@ -740,7 +739,6 @@ TEST_CASE("json_view images: errors") } } } -#endif SECTION("a literal as the root: dump() after loading") {