Fix remaining red CI on develop: Infer null dereferences, clang-tidy redundant init (#5943)

This commit is contained in:
Niels Lohmann authored and GitHub committed 2026-10-27 14:31:31 +01:00
1 parent a47170346a
commit ebf5a176c4
2 files changed
+6 -1

No files matched your search

+1 -1
View File
@@ -1311,7 +1311,7 @@ TEST_CASE("BSON declared document size bounds the content")
// records the events that a SAX parser receives // records the events that a SAX parser receives
struct recorder : nlohmann::json_sax<json> struct recorder : nlohmann::json_sax<json>
{ {
std::string events{}; std::string events;
bool null() override bool null() override
{ {
+5
View File
@@ -291,6 +291,7 @@ TEST_CASE("pointer access")
// check if pointers are returned correctly // check if pointers are returned correctly
test_type* p1 = value.get_ptr<test_type*>(); test_type* p1 = value.get_ptr<test_type*>();
CHECK(p1 == value.get_ptr<test_type*>()); CHECK(p1 == value.get_ptr<test_type*>());
// @infer-ignore NULLPTR_DEREFERENCE
CHECK(*p1 == value.get<test_type>()); CHECK(*p1 == value.get<test_type>());
const test_type* p2 = value.get_ptr<const test_type*>(); const test_type* p2 = value.get_ptr<const test_type*>();
@@ -320,6 +321,7 @@ TEST_CASE("pointer access")
// check if pointers are returned correctly // check if pointers are returned correctly
const test_type* p1 = value.get_ptr<test_type*>(); const test_type* p1 = value.get_ptr<test_type*>();
CHECK(p1 == value.get_ptr<test_type*>()); CHECK(p1 == value.get_ptr<test_type*>());
// @infer-ignore NULLPTR_DEREFERENCE
CHECK(*p1 == value.get<test_type>()); CHECK(*p1 == value.get<test_type>());
const test_type* p2 = value.get_ptr<const test_type*>(); const test_type* p2 = value.get_ptr<const test_type*>();
@@ -349,6 +351,7 @@ TEST_CASE("pointer access")
// check if pointers are returned correctly // check if pointers are returned correctly
test_type* p1 = value.get_ptr<test_type*>(); test_type* p1 = value.get_ptr<test_type*>();
CHECK(p1 == value.get_ptr<test_type*>()); CHECK(p1 == value.get_ptr<test_type*>());
// @infer-ignore NULLPTR_DEREFERENCE
CHECK(*p1 == value.get<test_type>()); CHECK(*p1 == value.get<test_type>());
const test_type* p2 = value.get_ptr<const test_type*>(); const test_type* p2 = value.get_ptr<const test_type*>();
@@ -378,6 +381,7 @@ TEST_CASE("pointer access")
// check if pointers are returned correctly // check if pointers are returned correctly
const test_type* p1 = value.get_ptr<test_type*>(); const test_type* p1 = value.get_ptr<test_type*>();
CHECK(p1 == value.get_ptr<test_type*>()); CHECK(p1 == value.get_ptr<test_type*>());
// @infer-ignore NULLPTR_DEREFERENCE
CHECK(*p1 == Approx(value.get<test_type>())); CHECK(*p1 == Approx(value.get<test_type>()));
const test_type* p2 = value.get_ptr<const test_type*>(); const test_type* p2 = value.get_ptr<const test_type*>();
@@ -407,6 +411,7 @@ TEST_CASE("pointer access")
// check if pointers are returned correctly // check if pointers are returned correctly
test_type* p1 = value.get_ptr<test_type*>(); test_type* p1 = value.get_ptr<test_type*>();
CHECK(p1 == value.get_ptr<test_type*>()); CHECK(p1 == value.get_ptr<test_type*>());
// @infer-ignore NULLPTR_DEREFERENCE
CHECK(*p1 == Approx(value.get<test_type>())); CHECK(*p1 == Approx(value.get<test_type>()));
const test_type* p2 = value.get_ptr<const test_type*>(); const test_type* p2 = value.get_ptr<const test_type*>();