]> git.ipfire.org Git - pakfire.git/commitdiff
tests: makefile: Check filelist length
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 17 May 2022 15:09:35 +0000 (15:09 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 17 May 2022 15:09:35 +0000 (15:09 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
tests/libpakfire/makefile.c

index b8218377eaf56dac0c657afd87258a8b486c6f90..e634aec38a46ca701b95e33308b61e24f7363e8b 100644 (file)
@@ -172,6 +172,7 @@ static int test_dist_dummy(const struct test* t) {
 
        struct pakfire_archive* archive = NULL;
        struct pakfire_package* package = NULL;
+       struct pakfire_filelist* filelist = NULL;
 
        // Create a directory to write packages to
        char* tmp = test_mkdtemp();
@@ -236,12 +237,21 @@ static int test_dist_dummy(const struct test* t) {
        size_t installed_size = pakfire_package_get_installsize(package);
        ASSERT(installed_size == 0);
 
+       // Fetch the filelist
+       filelist = pakfire_archive_get_filelist(archive);
+       ASSERT(filelist);
+
+       // There must be exactly one file in this package
+       ASSERT(pakfire_filelist_size(filelist) == 1);
+
        // Everything okay
        r = EXIT_SUCCESS;
 
 FAIL:
        if (archive)
                pakfire_archive_unref(archive);
+       if (filelist)
+               pakfire_filelist_unref(filelist);
        if (package)
                pakfire_package_unref(package);