more coverity fixes

This commit is contained in:
Jean-Louis Leroy
2026-01-25 19:21:19 -05:00
parent 3dfaf30264
commit 3e2454d841
10 changed files with 18 additions and 9 deletions

View File

@@ -116,9 +116,9 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(
unique_virtual_ptr<Dog, Registry> p(std::make_unique<Dog>());
auto dog = p.get();
unique_virtual_ptr<Dog, Registry> q(std::move(p));
// coverity[use_after_move]
BOOST_TEST(q.get() == dog);
BOOST_TEST(q.vptr() == Registry::template static_vptr<Dog>);
// coverity[use_after_move]
BOOST_TEST(p.get() == nullptr);
BOOST_TEST(p.vptr() == nullptr);
}
@@ -128,9 +128,9 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(
unique_virtual_ptr<Dog, Registry> p(std::make_unique<Dog>());
auto dog = p.get();
unique_virtual_ptr<Animal, Registry> q(std::move(p));
// coverity[use_after_move]
BOOST_TEST(q.get() == dog);
BOOST_TEST(q.vptr() == Registry::template static_vptr<Dog>);
// coverity[use_after_move]
BOOST_TEST(p.get() == nullptr);
BOOST_TEST(p.vptr() == nullptr);
}
@@ -271,6 +271,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(
unique_virtual_ptr<Class>>(std::move(base));
BOOST_TEST(derived.get() == p);
BOOST_TEST(derived.vptr() == default_registry::static_vptr<Class>);
// coverity[use_after_move]
BOOST_TEST(base.get() == nullptr);
}