mirror of
https://github.com/nlohmann/json.git
synced 2026-10-10 16:37:14 +00:00
Fix clang-tidy 22 findings in unit-json_view_image.cpp and image.hpp
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
(cherry picked from commit 611faf2c88)
This commit is contained in:
2 files changed
+12
-4
No files matched your search
@@ -56,7 +56,7 @@ const char* const check_failed = "[json.exception.parse_error.116] parse error:
|
||||
|
||||
std::string read_file(const std::string& name)
|
||||
{
|
||||
std::ifstream f(std::string(TEST_DATA_DIRECTORY) + name, std::ios::binary);
|
||||
const std::ifstream f(std::string(TEST_DATA_DIRECTORY) + name, std::ios::binary);
|
||||
std::stringstream ss;
|
||||
ss << f.rdbuf();
|
||||
return ss.str();
|
||||
@@ -325,7 +325,7 @@ TEST_CASE("json_view images: round trips")
|
||||
// exceed the probe limit, so the object has none and is searched
|
||||
// linearly; 40 of 200 keys in one slot (512 slots): a table with a
|
||||
// long chain
|
||||
const struct
|
||||
const struct // NOLINT(cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays): an unnamed type
|
||||
{
|
||||
std::size_t slots;
|
||||
std::size_t colliding;
|
||||
@@ -342,7 +342,7 @@ TEST_CASE("json_view images: round trips")
|
||||
text.pop_back();
|
||||
for (const std::string& key : duplicated)
|
||||
{
|
||||
text += ",\"" + key + "\":\"last\"";
|
||||
text += ",\"" + key + R"(":"last")";
|
||||
}
|
||||
text += "}";
|
||||
const json_document d = json_document::parse(text);
|
||||
|
||||
Reference in new issue
Block a user