This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch main in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=8d3c86c91e6a95a49ddd53041e003cbd9626e5bf commit 8d3c86c91e6a95a49ddd53041e003cbd9626e5bf Author: Guillem Jover <[email protected]> AuthorDate: Sun Nov 5 01:12:49 2023 +0100 test: Reorder check on whether pkg is NULL This is confusing cppcheck to consider that we could be passing a NULL pkg to the pkg_set_status() functions, which is not the case. Warned-by: cppcheck (ctunullpointer) --- lib/dpkg/t/t-pkg-hash.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/dpkg/t/t-pkg-hash.c b/lib/dpkg/t/t-pkg-hash.c index 2c009f88e..14935c259 100644 --- a/lib/dpkg/t/t-pkg-hash.c +++ b/lib/dpkg/t/t-pkg-hash.c @@ -57,8 +57,8 @@ test_pkg_hash(void) test_pass(pkg_hash_count_pkg() == 1); set = pkg_hash_find_set("pkg-bb"); - pkg_set_status(&set->pkg, PKG_STAT_INSTALLED); test_pass(set != NULL); + pkg_set_status(&set->pkg, PKG_STAT_INSTALLED); test_str(set->name, ==, "pkg-bb"); test_pass(pkg_hash_count_set() == 2); test_pass(pkg_hash_count_pkg() == 2); @@ -71,8 +71,8 @@ test_pkg_hash(void) arch = dpkg_arch_find("arch-xx"); pkg = pkg_hash_find_pkg("pkg-aa", arch); - pkg_set_status(pkg, PKG_STAT_INSTALLED); test_pass(pkg != NULL); + pkg_set_status(pkg, PKG_STAT_INSTALLED); test_str(pkg->set->name, ==, "pkg-aa"); test_str(pkg->installed.arch->name, ==, "arch-xx"); test_str(pkg->available.arch->name, ==, "arch-xx"); @@ -90,8 +90,8 @@ test_pkg_hash(void) arch = dpkg_arch_find("arch-zz"); pkg = pkg_hash_find_pkg("pkg-aa", arch); - pkg_set_status(pkg, PKG_STAT_UNPACKED); test_pass(pkg != NULL); + pkg_set_status(pkg, PKG_STAT_UNPACKED); test_str(pkg->set->name, ==, "pkg-aa"); test_str(pkg->installed.arch->name, ==, "arch-zz"); test_str(pkg->available.arch->name, ==, "arch-zz"); -- Dpkg.Org's dpkg

