mirror of
https://github.com/nlohmann/json.git
synced 2026-03-18 06:55:58 +00:00
Update to Doctest 2.4.12 (#4771)
* ⬆️ Doctest 2.4.12 Signed-off-by: Niels Lohmann <mail@nlohmann.me> * 🚨 fix warnings Signed-off-by: Niels Lohmann <mail@nlohmann.me> * 🚨 fix warnings Signed-off-by: Niels Lohmann <mail@nlohmann.me> * 🚨 fix warnings Signed-off-by: Niels Lohmann <mail@nlohmann.me> * 🚨 fix warnings Signed-off-by: Niels Lohmann <mail@nlohmann.me> * 🚨 fix warnings Signed-off-by: Niels Lohmann <mail@nlohmann.me> * 🚨 fix warnings Signed-off-by: Niels Lohmann <mail@nlohmann.me> * 🚨 fix warnings Signed-off-by: Niels Lohmann <mail@nlohmann.me> * 🚨 fix warnings Signed-off-by: Niels Lohmann <mail@nlohmann.me> * 🚨 fix warnings Signed-off-by: Niels Lohmann <mail@nlohmann.me> * 🚨 fix warnings Signed-off-by: Niels Lohmann <mail@nlohmann.me> * 🚨 fix warnings Signed-off-by: Niels Lohmann <mail@nlohmann.me> * 🚨 fix warnings Signed-off-by: Niels Lohmann <mail@nlohmann.me> * 🚨 fix warnings Signed-off-by: Niels Lohmann <mail@nlohmann.me> * 🚨 fix warnings Signed-off-by: Niels Lohmann <mail@nlohmann.me> * 🚨 fix warnings Signed-off-by: Niels Lohmann <mail@nlohmann.me> --------- Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
@@ -735,14 +735,14 @@ TEST_CASE("different basic_json types conversions")
|
||||
SECTION("null")
|
||||
{
|
||||
json const j;
|
||||
custom_json cj = j;
|
||||
const custom_json cj = j;
|
||||
CHECK(cj == nullptr);
|
||||
}
|
||||
|
||||
SECTION("boolean")
|
||||
{
|
||||
json const j = true;
|
||||
custom_json cj = j;
|
||||
const custom_json cj = j;
|
||||
CHECK(cj == true);
|
||||
}
|
||||
|
||||
@@ -764,28 +764,28 @@ TEST_CASE("different basic_json types conversions")
|
||||
SECTION("integer")
|
||||
{
|
||||
json const j = 42;
|
||||
custom_json cj = j;
|
||||
const custom_json cj = j;
|
||||
CHECK(cj == 42);
|
||||
}
|
||||
|
||||
SECTION("float")
|
||||
{
|
||||
json const j = 42.0;
|
||||
custom_json cj = j;
|
||||
const custom_json cj = j;
|
||||
CHECK(cj == 42.0);
|
||||
}
|
||||
|
||||
SECTION("unsigned")
|
||||
{
|
||||
json const j = 42u;
|
||||
custom_json cj = j;
|
||||
const custom_json cj = j;
|
||||
CHECK(cj == 42u);
|
||||
}
|
||||
|
||||
SECTION("string")
|
||||
{
|
||||
json const j = "forty-two";
|
||||
custom_json cj = j;
|
||||
const custom_json cj = j;
|
||||
CHECK(cj == "forty-two");
|
||||
}
|
||||
|
||||
@@ -794,7 +794,7 @@ TEST_CASE("different basic_json types conversions")
|
||||
json j = json::binary({1, 2, 3}, 42);
|
||||
custom_json cj = j;
|
||||
CHECK(cj.get_binary().subtype() == 42);
|
||||
std::vector<std::uint8_t> cv = cj.get_binary();
|
||||
const std::vector<std::uint8_t>& cv = cj.get_binary();
|
||||
std::vector<std::uint8_t> v = j.get_binary();
|
||||
CHECK(cv == v);
|
||||
}
|
||||
@@ -802,7 +802,7 @@ TEST_CASE("different basic_json types conversions")
|
||||
SECTION("object")
|
||||
{
|
||||
json const j = {{"forty", "two"}};
|
||||
custom_json cj = j;
|
||||
const custom_json cj = j;
|
||||
auto m = j.get<std::map<std::string, std::string>>();
|
||||
CHECK(cj == m);
|
||||
}
|
||||
@@ -810,7 +810,7 @@ TEST_CASE("different basic_json types conversions")
|
||||
SECTION("get<custom_json>")
|
||||
{
|
||||
json const j = 42;
|
||||
custom_json cj = j.get<custom_json>();
|
||||
const custom_json cj = j.get<custom_json>();
|
||||
CHECK(cj == 42);
|
||||
}
|
||||
}
|
||||
@@ -861,11 +861,11 @@ TEST_CASE("Issue #924")
|
||||
CHECK_NOTHROW(j.get<std::vector<Evil>>());
|
||||
|
||||
// silence Wunused-template warnings
|
||||
Evil e(1);
|
||||
const Evil e(1);
|
||||
CHECK(e.m_i >= 0);
|
||||
|
||||
// suppress warning: function "<unnamed>::Evil::Evil(T) [with T=std::string]" was declared but never referenced [declared_but_not_referenced]
|
||||
Evil e2(std::string("foo"));
|
||||
const Evil e2(std::string("foo"));
|
||||
CHECK(e2.m_i >= 0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user