]> git.ipfire.org Git - pakfire.git/commitdiff
tests: Drop the old snapshot tests
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 17 Oct 2024 17:47:32 +0000 (17:47 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 17 Oct 2024 17:47:32 +0000 (17:47 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
.gitignore
Makefile.am
tests/libpakfire/snapshot.c [deleted file]

index 2f4c20082b1f769ee799b8360c35eeea1d3d0016..d1a47723cc90eeffac08a68de6d61b43a427e45c 100644 (file)
@@ -34,7 +34,6 @@
 /tests/libpakfire/path
 /tests/libpakfire/progressbar
 /tests/libpakfire/repo
-/tests/libpakfire/snapshot
 /tests/libpakfire/string
 /tests/libpakfire/util
 /tests/libpakfire/xfer
index 1a660dfcb961300b94644d0f3aa85359b848b490..586c68ed41e9d594324bbeaec4f78f1f7bfa2e23 100644 (file)
@@ -586,7 +586,6 @@ check_PROGRAMS += \
        tests/libpakfire/parser \
        tests/libpakfire/path \
        tests/libpakfire/repo \
-       tests/libpakfire/snapshot \
        tests/libpakfire/string \
        tests/libpakfire/util \
        tests/libpakfire/xfer
@@ -843,18 +842,6 @@ tests_libpakfire_repo_CFLAGS = \
 tests_libpakfire_repo_LDADD = \
        $(TESTSUITE_LDADD)
 
-dist_tests_libpakfire_snapshot_SOURCES = \
-       tests/libpakfire/snapshot.c
-
-tests_libpakfire_snapshot_CPPFLAGS = \
-       $(TESTSUITE_CPPFLAGS)
-
-tests_libpakfire_snapshot_CFLAGS = \
-       $(TESTSUITE_CFLAGS)
-
-tests_libpakfire_snapshot_LDADD = \
-       $(TESTSUITE_LDADD)
-
 dist_tests_libpakfire_string_SOURCES = \
        tests/libpakfire/string.c
 
diff --git a/tests/libpakfire/snapshot.c b/tests/libpakfire/snapshot.c
deleted file mode 100644 (file)
index 8eed823..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*#############################################################################
-#                                                                             #
-# Pakfire - The IPFire package management system                              #
-# Copyright (C) 2021 Pakfire development team                                 #
-#                                                                             #
-# This program is free software: you can redistribute it and/or modify        #
-# it under the terms of the GNU General Public License as published by        #
-# the Free Software Foundation, either version 3 of the License, or           #
-# (at your option) any later version.                                         #
-#                                                                             #
-# This program is distributed in the hope that it will be useful,             #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
-# GNU General Public License for more details.                                #
-#                                                                             #
-# You should have received a copy of the GNU General Public License           #
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
-#                                                                             #
-#############################################################################*/
-
-#include <stdio.h>
-
-#include <pakfire/snapshot.h>
-
-#include "../testsuite.h"
-
-static int test_create_and_restore(const struct test* t) {
-       int r = EXIT_FAILURE;
-
-       // Create a temporary file
-       FILE* f = test_mktemp(NULL);
-       ASSERT(f);
-
-       // Create the snapshot
-       ASSERT_SUCCESS(pakfire_snapshot_compress(t->pakfire, f));
-
-       // Determine the size of the snapshot
-       size_t size = ftell(f);
-
-       LOG("Snapshot has a size of %jd bytes\n", size);
-
-       // Check if the snapshot has something in it
-       ASSERT(size >= 1024);
-
-       // Rewind the file descriptor to the beginning
-       rewind(f);
-
-       // Perform a restore
-       ASSERT_SUCCESS(pakfire_snapshot_extract(t->pakfire, f));
-
-       // Everything passed
-       r = EXIT_SUCCESS;
-
-FAIL:
-       if (f)
-               fclose(f);
-
-       return r;
-}
-
-static int test_invalid_inputs(const struct test* t) {
-       int r = EXIT_FAILURE;
-
-       // pakfire_snapshot_create
-       ASSERT_ERRNO(pakfire_snapshot_compress(t->pakfire, NULL), EINVAL);
-
-       // pakfire_snapshot_restore
-       ASSERT_ERRNO(pakfire_snapshot_extract(t->pakfire, NULL), EINVAL);
-
-       // Everything passed
-       r = EXIT_SUCCESS;
-
-FAIL:
-       return r;
-}
-
-int main(int argc, const char* argv[]) {
-       testsuite_add_test(test_create_and_restore, TEST_WANTS_PAKFIRE);
-       testsuite_add_test(test_invalid_inputs, TEST_WANTS_PAKFIRE);
-
-       return testsuite_run(argc, argv);
-}