From: Michael Tremer Date: Sun, 1 Oct 2023 10:59:29 +0000 (+0000) Subject: tests: Drop tests for the progressbar module X-Git-Tag: 0.9.30~1585 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c74cb0ed871a891a66c15a8080bb0f706bd521d5;p=pakfire.git tests: Drop tests for the progressbar module Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index 121ca9540..4bfb4b328 100644 --- a/Makefile.am +++ b/Makefile.am @@ -510,7 +510,6 @@ check_PROGRAMS += \ tests/libpakfire/package \ tests/libpakfire/packager \ tests/libpakfire/parser \ - tests/libpakfire/progressbar \ tests/libpakfire/repo \ tests/libpakfire/snapshot \ tests/libpakfire/string \ @@ -732,18 +731,6 @@ tests_libpakfire_parser_CFLAGS = \ tests_libpakfire_parser_LDADD = \ $(TESTSUITE_LDADD) -dist_tests_libpakfire_progressbar_SOURCES = \ - tests/libpakfire/progressbar.c - -tests_libpakfire_progressbar_CPPFLAGS = \ - $(TESTSUITE_CPPFLAGS) - -tests_libpakfire_progressbar_CFLAGS = \ - $(TESTSUITE_CFLAGS) - -tests_libpakfire_progressbar_LDADD = \ - $(TESTSUITE_LDADD) - dist_tests_libpakfire_repo_SOURCES = \ tests/libpakfire/repo.c diff --git a/tests/libpakfire/progressbar.c b/tests/libpakfire/progressbar.c deleted file mode 100644 index e87362d88..000000000 --- a/tests/libpakfire/progressbar.c +++ /dev/null @@ -1,75 +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 . # -# # -#############################################################################*/ - -#include -#include -#include - -#include - -#include "../testsuite.h" - -static int test_run(const struct test* t) { - struct pakfire_progressbar* p = NULL; - int r = EXIT_FAILURE; - - ASSERT_SUCCESS(pakfire_progressbar_create(&p, NULL)); - - ASSERT(pakfire_progressbar_finish(p) == EINVAL); - - // Add a string - ASSERT_SUCCESS(pakfire_progressbar_add_string(p, "STRING")); - - // Add a counter - ASSERT_SUCCESS(pakfire_progressbar_add_counter(p)); - - // Add a bar - ASSERT_SUCCESS(pakfire_progressbar_add_bar(p)); - - // Add the percentage - ASSERT_SUCCESS(pakfire_progressbar_add_percentage(p)); - - // Add a timer - ASSERT_SUCCESS(pakfire_progressbar_add_timer(p)); - - ASSERT_SUCCESS(pakfire_progressbar_start(p, 1000)); - - for (unsigned int i = 0; i < 1000; i++) { - ASSERT_SUCCESS(pakfire_progressbar_increment(p, 1)); - usleep(2500); - } - - ASSERT_SUCCESS(pakfire_progressbar_finish(p)); - - // Everything passed - r = EXIT_SUCCESS; - -FAIL: - if (p) - pakfire_progressbar_unref(p); - - return r; -} - -int main(int argc, const char* argv[]) { - testsuite_add_test(test_run); - - return testsuite_run(argc, argv); -}