]> git.ipfire.org Git - pakfire.git/commitdiff
tests: archive: Extract package metadata after opening
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 1 Sep 2022 11:49:17 +0000 (11:49 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 1 Sep 2022 11:49:17 +0000 (11:49 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
tests/libpakfire/archive.c

index fd90dd77adb5b92e7ee676104012429f18ec8dc1..48efddb09e258160ce43583e0cccda94ebb0de07 100644 (file)
@@ -32,6 +32,7 @@
 
 static int test_open(const struct test* t) {
        struct pakfire_archive* archive = NULL;
+       struct pakfire_package* package = NULL;
        int r = EXIT_FAILURE;
 
        // Open the archive
@@ -43,6 +44,10 @@ static int test_open(const struct test* t) {
        // Check if format matches
        ASSERT(pakfire_archive_get_format(archive) == 5);
 
+       // Fetch package
+       ASSERT_SUCCESS(pakfire_archive_make_package(archive, NULL, &package));
+       ASSERT(package);
+
 #if 0
        pakfire_archive_verify_status_t status;
 
@@ -57,6 +62,8 @@ static int test_open(const struct test* t) {
 FAIL:
        if (archive)
                pakfire_archive_unref(archive);
+       if (package)
+               pakfire_package_unref(package);
 
        return r;
 }