mirror of
https://github.com/nlohmann/json.git
synced 2026-02-21 19:06:27 +00:00
Add clang-tools to required tools for ci_static_analysis_clang (#3724)
* 💚 add clang-tools to required tools for ci_static_analysis_clang * 🚨 update Clang-Tidy warning selection * 🚨 fix Clang-Tidy warnings * 🚨 fix Clang-Tidy warnings * 🚨 fix Clang-Tidy warnings * 🚨 fix Clang-Tidy warnings * 🚨 fix Clang-Tidy warnings * 🚨 fix Clang-Tidy warnings * 🚨 fix Clang-Tidy warnings * 🚨 fix Clang-Tidy warnings * 🚨 fix Clang-Tidy warnings * 🚨 fix Clang-Tidy warnings * 🚨 fix Clang-Tidy warnings (#3738) * ⏪ revert fix * ⏪ revert fix * 🚨 fix Clang-Tidy warnings (#3739) Co-authored-by: Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
This commit is contained in:
@@ -20,27 +20,27 @@ TEST_CASE("const_iterator class")
|
||||
{
|
||||
SECTION("null")
|
||||
{
|
||||
json j(json::value_t::null);
|
||||
json::const_iterator it(&j);
|
||||
json const j(json::value_t::null);
|
||||
json::const_iterator const it(&j);
|
||||
}
|
||||
|
||||
SECTION("object")
|
||||
{
|
||||
json j(json::value_t::object);
|
||||
json::const_iterator it(&j);
|
||||
json const j(json::value_t::object);
|
||||
json::const_iterator const it(&j);
|
||||
}
|
||||
|
||||
SECTION("array")
|
||||
{
|
||||
json j(json::value_t::array);
|
||||
json::const_iterator it(&j);
|
||||
json const j(json::value_t::array);
|
||||
json::const_iterator const it(&j);
|
||||
}
|
||||
}
|
||||
|
||||
SECTION("copy assignment")
|
||||
{
|
||||
json j(json::value_t::null);
|
||||
json::const_iterator it(&j);
|
||||
json const j(json::value_t::null);
|
||||
json::const_iterator const it(&j);
|
||||
json::const_iterator it2(&j);
|
||||
it2 = it;
|
||||
}
|
||||
@@ -50,14 +50,14 @@ TEST_CASE("const_iterator class")
|
||||
SECTION("create from uninitialized iterator")
|
||||
{
|
||||
const json::iterator it {};
|
||||
json::const_iterator cit(it);
|
||||
json::const_iterator const cit(it);
|
||||
}
|
||||
|
||||
SECTION("create from initialized iterator")
|
||||
{
|
||||
json j;
|
||||
const json::iterator it = j.begin();
|
||||
json::const_iterator cit(it);
|
||||
json::const_iterator const cit(it);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,7 +68,7 @@ TEST_CASE("const_iterator class")
|
||||
{
|
||||
SECTION("null")
|
||||
{
|
||||
json j(json::value_t::null);
|
||||
json const j(json::value_t::null);
|
||||
json::const_iterator it(&j);
|
||||
it.set_begin();
|
||||
CHECK((it == j.cbegin()));
|
||||
@@ -76,7 +76,7 @@ TEST_CASE("const_iterator class")
|
||||
|
||||
SECTION("object")
|
||||
{
|
||||
json j(json::value_t::object);
|
||||
json const j(json::value_t::object);
|
||||
json::const_iterator it(&j);
|
||||
it.set_begin();
|
||||
CHECK((it == j.cbegin()));
|
||||
@@ -84,7 +84,7 @@ TEST_CASE("const_iterator class")
|
||||
|
||||
SECTION("array")
|
||||
{
|
||||
json j(json::value_t::array);
|
||||
json const j(json::value_t::array);
|
||||
json::const_iterator it(&j);
|
||||
it.set_begin();
|
||||
CHECK((it == j.cbegin()));
|
||||
@@ -95,7 +95,7 @@ TEST_CASE("const_iterator class")
|
||||
{
|
||||
SECTION("null")
|
||||
{
|
||||
json j(json::value_t::null);
|
||||
json const j(json::value_t::null);
|
||||
json::const_iterator it(&j);
|
||||
it.set_end();
|
||||
CHECK((it == j.cend()));
|
||||
@@ -103,7 +103,7 @@ TEST_CASE("const_iterator class")
|
||||
|
||||
SECTION("object")
|
||||
{
|
||||
json j(json::value_t::object);
|
||||
json const j(json::value_t::object);
|
||||
json::const_iterator it(&j);
|
||||
it.set_end();
|
||||
CHECK((it == j.cend()));
|
||||
@@ -111,7 +111,7 @@ TEST_CASE("const_iterator class")
|
||||
|
||||
SECTION("array")
|
||||
{
|
||||
json j(json::value_t::array);
|
||||
json const j(json::value_t::array);
|
||||
json::const_iterator it(&j);
|
||||
it.set_end();
|
||||
CHECK((it == j.cend()));
|
||||
@@ -125,14 +125,14 @@ TEST_CASE("const_iterator class")
|
||||
{
|
||||
SECTION("null")
|
||||
{
|
||||
json j(json::value_t::null);
|
||||
json::const_iterator it = j.cbegin();
|
||||
json const j(json::value_t::null);
|
||||
json::const_iterator const it = j.cbegin();
|
||||
CHECK_THROWS_WITH_AS(*it, "[json.exception.invalid_iterator.214] cannot get value", json::invalid_iterator&);
|
||||
}
|
||||
|
||||
SECTION("number")
|
||||
{
|
||||
json j(17);
|
||||
json const j(17);
|
||||
json::const_iterator it = j.cbegin();
|
||||
CHECK(*it == json(17));
|
||||
it = j.cend();
|
||||
@@ -141,15 +141,15 @@ TEST_CASE("const_iterator class")
|
||||
|
||||
SECTION("object")
|
||||
{
|
||||
json j({{"foo", "bar"}});
|
||||
json::const_iterator it = j.cbegin();
|
||||
json const j({{"foo", "bar"}});
|
||||
json::const_iterator const it = j.cbegin();
|
||||
CHECK(*it == json("bar"));
|
||||
}
|
||||
|
||||
SECTION("array")
|
||||
{
|
||||
json j({1, 2, 3, 4});
|
||||
json::const_iterator it = j.cbegin();
|
||||
json const j({1, 2, 3, 4});
|
||||
json::const_iterator const it = j.cbegin();
|
||||
CHECK(*it == json(1));
|
||||
}
|
||||
}
|
||||
@@ -158,14 +158,14 @@ TEST_CASE("const_iterator class")
|
||||
{
|
||||
SECTION("null")
|
||||
{
|
||||
json j(json::value_t::null);
|
||||
json::const_iterator it = j.cbegin();
|
||||
json const j(json::value_t::null);
|
||||
json::const_iterator const it = j.cbegin();
|
||||
CHECK_THROWS_WITH_AS(std::string(it->type_name()), "[json.exception.invalid_iterator.214] cannot get value", json::invalid_iterator&);
|
||||
}
|
||||
|
||||
SECTION("number")
|
||||
{
|
||||
json j(17);
|
||||
json const j(17);
|
||||
json::const_iterator it = j.cbegin();
|
||||
CHECK(std::string(it->type_name()) == "number");
|
||||
it = j.cend();
|
||||
@@ -174,15 +174,15 @@ TEST_CASE("const_iterator class")
|
||||
|
||||
SECTION("object")
|
||||
{
|
||||
json j({{"foo", "bar"}});
|
||||
json::const_iterator it = j.cbegin();
|
||||
json const j({{"foo", "bar"}});
|
||||
json::const_iterator const it = j.cbegin();
|
||||
CHECK(std::string(it->type_name()) == "string");
|
||||
}
|
||||
|
||||
SECTION("array")
|
||||
{
|
||||
json j({1, 2, 3, 4});
|
||||
json::const_iterator it = j.cbegin();
|
||||
json const j({1, 2, 3, 4});
|
||||
json::const_iterator const it = j.cbegin();
|
||||
CHECK(std::string(it->type_name()) == "number");
|
||||
}
|
||||
}
|
||||
@@ -194,7 +194,7 @@ TEST_CASE("const_iterator class")
|
||||
{
|
||||
SECTION("null")
|
||||
{
|
||||
json j(json::value_t::null);
|
||||
json const j(json::value_t::null);
|
||||
json::const_iterator it = j.cbegin();
|
||||
CHECK((it.m_it.primitive_iterator.m_it == 1));
|
||||
it++;
|
||||
@@ -203,7 +203,7 @@ TEST_CASE("const_iterator class")
|
||||
|
||||
SECTION("number")
|
||||
{
|
||||
json j(17);
|
||||
json const j(17);
|
||||
json::const_iterator it = j.cbegin();
|
||||
CHECK((it.m_it.primitive_iterator.m_it == 0));
|
||||
it++;
|
||||
@@ -214,7 +214,7 @@ TEST_CASE("const_iterator class")
|
||||
|
||||
SECTION("object")
|
||||
{
|
||||
json j({{"foo", "bar"}});
|
||||
json const j({{"foo", "bar"}});
|
||||
json::const_iterator it = j.cbegin();
|
||||
CHECK((it.m_it.object_iterator == it.m_object->m_value.object->begin()));
|
||||
it++;
|
||||
@@ -223,7 +223,7 @@ TEST_CASE("const_iterator class")
|
||||
|
||||
SECTION("array")
|
||||
{
|
||||
json j({1, 2, 3, 4});
|
||||
json const j({1, 2, 3, 4});
|
||||
json::const_iterator it = j.cbegin();
|
||||
CHECK((it.m_it.array_iterator == it.m_object->m_value.array->begin()));
|
||||
it++;
|
||||
@@ -245,7 +245,7 @@ TEST_CASE("const_iterator class")
|
||||
{
|
||||
SECTION("null")
|
||||
{
|
||||
json j(json::value_t::null);
|
||||
json const j(json::value_t::null);
|
||||
json::const_iterator it = j.cbegin();
|
||||
CHECK((it.m_it.primitive_iterator.m_it == 1));
|
||||
++it;
|
||||
@@ -254,7 +254,7 @@ TEST_CASE("const_iterator class")
|
||||
|
||||
SECTION("number")
|
||||
{
|
||||
json j(17);
|
||||
json const j(17);
|
||||
json::const_iterator it = j.cbegin();
|
||||
CHECK((it.m_it.primitive_iterator.m_it == 0));
|
||||
++it;
|
||||
@@ -265,7 +265,7 @@ TEST_CASE("const_iterator class")
|
||||
|
||||
SECTION("object")
|
||||
{
|
||||
json j({{"foo", "bar"}});
|
||||
json const j({{"foo", "bar"}});
|
||||
json::const_iterator it = j.cbegin();
|
||||
CHECK((it.m_it.object_iterator == it.m_object->m_value.object->begin()));
|
||||
++it;
|
||||
@@ -274,7 +274,7 @@ TEST_CASE("const_iterator class")
|
||||
|
||||
SECTION("array")
|
||||
{
|
||||
json j({1, 2, 3, 4});
|
||||
json const j({1, 2, 3, 4});
|
||||
json::const_iterator it = j.cbegin();
|
||||
CHECK((it.m_it.array_iterator == it.m_object->m_value.array->begin()));
|
||||
++it;
|
||||
@@ -296,14 +296,14 @@ TEST_CASE("const_iterator class")
|
||||
{
|
||||
SECTION("null")
|
||||
{
|
||||
json j(json::value_t::null);
|
||||
json::const_iterator it = j.cend();
|
||||
json const j(json::value_t::null);
|
||||
json::const_iterator const it = j.cend();
|
||||
CHECK((it.m_it.primitive_iterator.m_it == 1));
|
||||
}
|
||||
|
||||
SECTION("number")
|
||||
{
|
||||
json j(17);
|
||||
json const j(17);
|
||||
json::const_iterator it = j.cend();
|
||||
CHECK((it.m_it.primitive_iterator.m_it == 1));
|
||||
it--;
|
||||
@@ -314,7 +314,7 @@ TEST_CASE("const_iterator class")
|
||||
|
||||
SECTION("object")
|
||||
{
|
||||
json j({{"foo", "bar"}});
|
||||
json const j({{"foo", "bar"}});
|
||||
json::const_iterator it = j.cend();
|
||||
CHECK((it.m_it.object_iterator == it.m_object->m_value.object->end()));
|
||||
it--;
|
||||
@@ -323,7 +323,7 @@ TEST_CASE("const_iterator class")
|
||||
|
||||
SECTION("array")
|
||||
{
|
||||
json j({1, 2, 3, 4});
|
||||
json const j({1, 2, 3, 4});
|
||||
json::const_iterator it = j.cend();
|
||||
CHECK((it.m_it.array_iterator == it.m_object->m_value.array->end()));
|
||||
it--;
|
||||
@@ -345,14 +345,14 @@ TEST_CASE("const_iterator class")
|
||||
{
|
||||
SECTION("null")
|
||||
{
|
||||
json j(json::value_t::null);
|
||||
json::const_iterator it = j.cend();
|
||||
json const j(json::value_t::null);
|
||||
json::const_iterator const it = j.cend();
|
||||
CHECK((it.m_it.primitive_iterator.m_it == 1));
|
||||
}
|
||||
|
||||
SECTION("number")
|
||||
{
|
||||
json j(17);
|
||||
json const j(17);
|
||||
json::const_iterator it = j.cend();
|
||||
CHECK((it.m_it.primitive_iterator.m_it == 1));
|
||||
--it;
|
||||
@@ -363,7 +363,7 @@ TEST_CASE("const_iterator class")
|
||||
|
||||
SECTION("object")
|
||||
{
|
||||
json j({{"foo", "bar"}});
|
||||
json const j({{"foo", "bar"}});
|
||||
json::const_iterator it = j.cend();
|
||||
CHECK((it.m_it.object_iterator == it.m_object->m_value.object->end()));
|
||||
--it;
|
||||
@@ -372,7 +372,7 @@ TEST_CASE("const_iterator class")
|
||||
|
||||
SECTION("array")
|
||||
{
|
||||
json j({1, 2, 3, 4});
|
||||
json const j({1, 2, 3, 4});
|
||||
json::const_iterator it = j.cend();
|
||||
CHECK((it.m_it.array_iterator == it.m_object->m_value.array->end()));
|
||||
--it;
|
||||
|
||||
Reference in New Issue
Block a user