mirror of
https://github.com/nlohmann/json.git
synced 2026-04-07 08:38:54 +00:00
Fix Clang-Tidy warnings (#4047)
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <nlohmann/json.hpp>
|
||||
using nlohmann::json;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ struct bad_allocator : std::allocator<T>
|
||||
template<class U> bad_allocator(const bad_allocator<U>& /*unused*/) { }
|
||||
|
||||
template<class... Args>
|
||||
void construct(T* /*unused*/, Args&& ... /*unused*/)
|
||||
void construct(T* /*unused*/, Args&& ... /*unused*/) // NOLINT(cppcoreguidelines-missing-std-forward)
|
||||
{
|
||||
throw std::bad_alloc();
|
||||
}
|
||||
|
||||
@@ -119,13 +119,13 @@ TEST_CASE("README" * doctest::skip())
|
||||
|
||||
// serialization with pretty printing
|
||||
// pass in the amount of spaces to indent
|
||||
std::cout << j.dump(4) << std::endl;
|
||||
std::cout << j.dump(4) << std::endl; // NOLINT(performance-avoid-endl)
|
||||
// {
|
||||
// "happy": true,
|
||||
// "pi": 3.141
|
||||
// }
|
||||
|
||||
std::cout << std::setw(2) << j << std::endl;
|
||||
std::cout << std::setw(2) << j << std::endl; // NOLINT(performance-avoid-endl)
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
@@ -123,7 +123,7 @@ void check_utf8string(bool success_expected, int byte1, int byte2 = -1, int byte
|
||||
{
|
||||
if (++calls % 100000 == 0)
|
||||
{
|
||||
std::cout << calls << " of 455355 UTF-8 strings checked" << std::endl;
|
||||
std::cout << calls << " of 455355 UTF-8 strings checked" << std::endl; // NOLINT(performance-avoid-endl)
|
||||
}
|
||||
|
||||
static std::string json_string;
|
||||
|
||||
@@ -123,7 +123,7 @@ void check_utf8string(bool success_expected, int byte1, int byte2 = -1, int byte
|
||||
{
|
||||
if (++calls % 100000 == 0)
|
||||
{
|
||||
std::cout << calls << " of 1641521 UTF-8 strings checked" << std::endl;
|
||||
std::cout << calls << " of 1641521 UTF-8 strings checked" << std::endl; // NOLINT(performance-avoid-endl)
|
||||
}
|
||||
|
||||
static std::string json_string;
|
||||
|
||||
@@ -123,7 +123,7 @@ void check_utf8string(bool success_expected, int byte1, int byte2 = -1, int byte
|
||||
{
|
||||
if (++calls % 100000 == 0)
|
||||
{
|
||||
std::cout << calls << " of 5517507 UTF-8 strings checked" << std::endl;
|
||||
std::cout << calls << " of 5517507 UTF-8 strings checked" << std::endl; // NOLINT(performance-avoid-endl)
|
||||
}
|
||||
|
||||
static std::string json_string;
|
||||
|
||||
@@ -123,7 +123,7 @@ void check_utf8string(bool success_expected, int byte1, int byte2 = -1, int byte
|
||||
{
|
||||
if (++calls % 100000 == 0)
|
||||
{
|
||||
std::cout << calls << " of 1246225 UTF-8 strings checked" << std::endl;
|
||||
std::cout << calls << " of 1246225 UTF-8 strings checked" << std::endl; // NOLINT(performance-avoid-endl)
|
||||
}
|
||||
|
||||
static std::string json_string;
|
||||
|
||||
Reference in New Issue
Block a user