From b2c20c01b1732bd9305dfdab8d1a75d0e9191049 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Wed, 14 Oct 2026 17:37:46 +0200 Subject: [PATCH] Rename the reader parameter to avoid a flawfinder false positive Signed-off-by: Niels Lohmann --- tests/src/fuzzer_common.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/src/fuzzer_common.hpp b/tests/src/fuzzer_common.hpp index 59b05fdd9..8761b3a35 100644 --- a/tests/src/fuzzer_common.hpp +++ b/tests/src/fuzzer_common.hpp @@ -84,12 +84,12 @@ inline std::string outcome_value(bool b) } template -read_outcome read_with(const Read& read, Args&& ... args) +read_outcome read_with(const Read& parse, Args&& ... args) { read_outcome result; try { - result.value = outcome_value(read(std::forward(args)...)); + result.value = outcome_value(parse(std::forward(args)...)); } catch (const json::parse_error& e) { @@ -110,23 +110,23 @@ read_outcome read_with(const Read& read, Args&& ... args) // checks that all give the same value, or the same exception with the same // id, message, and byte position. // -// @a read is called with either an iterator range or a single input (stream +// @a parse is called with either an iterator range or a single input (stream // or FILE*) and returns the parsed value (or the result of accept()). template -void check_input_adapters(const std::uint8_t* data, std::size_t size, const Read& read) +void check_input_adapters(const std::uint8_t* data, std::size_t size, const Read& parse) { - const read_outcome expected = read_with(read, data, data + size); + const read_outcome expected = read_with(parse, data, data + size); // stream adapter { std::istringstream stream(std::string(reinterpret_cast(data), size)); - assert(read_with(read, stream) == expected); + assert(read_with(parse, stream) == expected); } // iterator adapter on a non-contiguous range { const std::list list(data, data + size); - assert(read_with(read, list.begin(), list.end()) == expected); + assert(read_with(parse, list.begin(), list.end()) == expected); } #if defined(__unix__) || defined(__APPLE__) @@ -136,7 +136,7 @@ void check_input_adapters(const std::uint8_t* data, std::size_t size, const Read std::FILE* file = buffer.empty() ? nullptr : fmemopen(buffer.data(), buffer.size(), "rb"); if (file != nullptr) { - const read_outcome actual = read_with(read, file); + const read_outcome actual = read_with(parse, file); std::fclose(file); assert(actual == expected); }