]> git.ipfire.org Git - pakfire.git/commitdiff
tests: Make xfer tests compile again
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 18 Oct 2024 16:06:48 +0000 (16:06 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 18 Oct 2024 16:06:48 +0000 (16:06 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
tests/libpakfire/xfer.c

index 2a280f87ad952b3a1053b948454f8e1a8b9530ac..d7cc845491a1c8872e15cfecff3712e485d202ad 100644 (file)
@@ -43,7 +43,7 @@ static int test_create(const struct test* t) {
        int r = EXIT_FAILURE;
 
        // Create a new transfer
-       ASSERT_SUCCESS(pakfire_xfer_create(&xfer, t->ctx, t->httpclient, "file://invalid"));
+       ASSERT_SUCCESS(pakfire_xfer_create_simple(&xfer, t->ctx, "file://invalid"));
 
        // Everything passed
        r = EXIT_SUCCESS;
@@ -60,7 +60,7 @@ static int test_download(const struct test* t) {
        int r = EXIT_FAILURE;
 
        // Create a new transfer
-       ASSERT_SUCCESS(pakfire_xfer_create(&xfer, t->ctx, t->httpclient, DOWNLOAD_URL));
+       ASSERT_SUCCESS(pakfire_xfer_create_simple(&xfer, t->ctx, DOWNLOAD_URL));
 
        // Run it!
        ASSERT_SUCCESS(pakfire_xfer_run(xfer, PAKFIRE_XFER_NO_PROGRESS));
@@ -82,7 +82,7 @@ static int test_download_into_buffer(const struct test* t) {
        int r = EXIT_FAILURE;
 
        // Create a new transfer
-       ASSERT_SUCCESS(pakfire_xfer_create(&xfer, t->ctx, t->httpclient, DOWNLOAD_URL));
+       ASSERT_SUCCESS(pakfire_xfer_create_simple(&xfer, t->ctx, DOWNLOAD_URL));
 
        // Write the data to the buffer
        ASSERT_SUCCESS(pakfire_xfer_set_output_buffer(xfer, &buffer, &length));
@@ -113,7 +113,7 @@ static int test_download_check_digest(const struct test* t) {
        int r = EXIT_FAILURE;
 
        // Create a new transfer
-       ASSERT_SUCCESS(pakfire_xfer_create(&xfer, t->ctx, t->httpclient, RANDOM_FILE));
+       ASSERT_SUCCESS(pakfire_xfer_create_simple(&xfer, t->ctx, RANDOM_FILE));
 
        // Write the data to the buffer
        ASSERT_SUCCESS(pakfire_xfer_set_output_buffer(xfer, &buffer, &length));
@@ -148,7 +148,7 @@ static int test_download_check_incorrect_digest(const struct test* t) {
        int r = EXIT_FAILURE;
 
        // Create a new transfer
-       ASSERT_SUCCESS(pakfire_xfer_create(&xfer, t->ctx, t->httpclient, RANDOM_FILE));
+       ASSERT_SUCCESS(pakfire_xfer_create_simple(&xfer, t->ctx, RANDOM_FILE));
 
        // Write the data to the buffer
        ASSERT_SUCCESS(pakfire_xfer_set_output_buffer(xfer, &buffer, &length));
@@ -178,7 +178,7 @@ static int test_online_download(const struct test* t) {
        int r = EXIT_FAILURE;
 
        // Create a new transfer
-       ASSERT_SUCCESS(pakfire_xfer_create(&xfer, t->ctx, t->httpclient, ONLINE_DOWNLOAD_URL));
+       ASSERT_SUCCESS(pakfire_xfer_create_simple(&xfer, t->ctx, ONLINE_DOWNLOAD_URL));
 
        // Run it!
        ASSERT_SUCCESS(pakfire_xfer_run(xfer, PAKFIRE_XFER_NO_PROGRESS));
@@ -195,18 +195,18 @@ FAIL:
 #endif /* ENABLE_ONLINE_TESTS */
 
 int main(int argc, const char* argv[]) {
-       testsuite_add_test(test_create, TEST_WANTS_HTTPCLIENT);
+       testsuite_add_test(test_create, 0);
 
        // Download files
-       testsuite_add_test(test_download, TEST_WANTS_HTTPCLIENT);
-       testsuite_add_test(test_download_into_buffer, TEST_WANTS_HTTPCLIENT);
+       testsuite_add_test(test_download, 0);
+       testsuite_add_test(test_download_into_buffer, 0);
 
        // Check digests
-       testsuite_add_test(test_download_check_digest, TEST_WANTS_HTTPCLIENT);
-       testsuite_add_test(test_download_check_incorrect_digest, TEST_WANTS_HTTPCLIENT);
+       testsuite_add_test(test_download_check_digest, 0);
+       testsuite_add_test(test_download_check_incorrect_digest, 0);
 
 #ifdef ENABLE_ONLINE_TESTS
-       testsuite_add_test(test_online_download, TEST_WANTS_HTTPCLIENT);
+       testsuite_add_test(test_online_download, 0);
 #endif /* ENABLE_ONLINE_TESTS */
 
        return testsuite_run(argc, argv);