tests/libpakfire/repo \
tests/libpakfire/snapshot \
tests/libpakfire/string \
- tests/libpakfire/util
+ tests/libpakfire/util \
+ tests/libpakfire/xfer
dist_tests_libpakfire_main_SOURCES = \
tests/libpakfire/main.c
tests_libpakfire_util_LDADD = \
$(TESTSUITE_LDADD)
+dist_tests_libpakfire_xfer_SOURCES = \
+ tests/libpakfire/xfer.c
+
+tests_libpakfire_xfer_CPPFLAGS = \
+ $(TESTSUITE_CPPFLAGS)
+
+tests_libpakfire_xfer_CFLAGS = \
+ $(TESTSUITE_CFLAGS)
+
+tests_libpakfire_xfer_LDADD = \
+ $(TESTSUITE_LDADD)
+
# ------------------------------------------------------------------------------
noinst_PROGRAMS += \
--- /dev/null
+/*#############################################################################
+# #
+# Pakfire - The IPFire package management system #
+# Copyright (C) 2023 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 <pakfire/xfer.h>
+
+#include "../testsuite.h"
+
+static int test_create(const struct test* t) {
+ struct pakfire_xfer* xfer = NULL;
+ int r = EXIT_FAILURE;
+
+ // Create a new transfer
+ ASSERT_SUCCESS(pakfire_xfer_create(&xfer, t->ctx, t->httpclient, "file://invalid"));
+
+ // Everything passed
+ r = EXIT_SUCCESS;
+
+FAIL:
+ if (xfer)
+ pakfire_xfer_unref(xfer);
+
+ return r;
+}
+
+int main(int argc, const char* argv[]) {
+ testsuite_add_test(test_create, TEST_WANTS_HTTPCLIENT);
+
+ return testsuite_run(argc, argv);
+}