From: Michael Tremer Date: Thu, 31 Aug 2023 06:08:01 +0000 (+0000) Subject: tests: packages: Fix group check X-Git-Tag: 0.9.29~30 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1cc55a743dcaa4f13d242d1b9be66ada06e2f22b;p=pakfire.git tests: packages: Fix group check Signed-off-by: Michael Tremer --- diff --git a/tests/libpakfire/package.c b/tests/libpakfire/package.c index 8a56b6d1a..ca345c49b 100644 --- a/tests/libpakfire/package.c +++ b/tests/libpakfire/package.c @@ -23,6 +23,7 @@ #include #include +#include #include #include "../testsuite.h" @@ -32,6 +33,7 @@ */ static int test_create(const struct test* t) { struct pakfire_package* pkg = NULL; + char** groups = NULL; int r = EXIT_FAILURE; ASSERT_SUCCESS(pakfire_package_create(&pkg, t->pakfire, NULL, "test", "1.0-1", "x86_64")); @@ -69,7 +71,10 @@ static int test_create(const struct test* t) { // Groups ASSERT_SUCCESS(pakfire_package_set_string(pkg, PAKFIRE_PKG_GROUPS, "GROUPS")); - ASSERT_STRING_EQUALS(pakfire_package_get_string(pkg, PAKFIRE_PKG_GROUPS), "GROUPS"); + + groups = pakfire_package_get_strings(pkg, PAKFIRE_PKG_GROUPS); + ASSERT(groups && *groups); + ASSERT_STRING_EQUALS(groups[0], "GROUPS"); ASSERT(groups[1] == NULL); // Vendor ASSERT_SUCCESS(pakfire_package_set_string(pkg, PAKFIRE_PKG_VENDOR, "VENDOR")); @@ -139,6 +144,8 @@ static int test_create(const struct test* t) { FAIL: if (pkg) pakfire_package_unref(pkg); + if (groups) + pakfire_strings_free(groups); return r; }