]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
testsuite: s/return EXIT_SUCCESS/return 0/ master
authorEmil Velikov <emil.l.velikov@gmail.com>
Fri, 3 Jul 2026 12:05:03 +0000 (13:05 +0100)
committerLucas De Marchi <ldemarchi@kernel.org>
Thu, 16 Jul 2026 02:19:53 +0000 (23:19 -0300)
With all the EXIT_FAILURE instances done from the tests (only ones in
tools and the test runner remain), lets drop the EXIT_SUCCESS ones.

Functionally identical and arguably slightly neater.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/375
Signed-off-by: Lucas De Marchi <ldemarchi@kernel.org>
testsuite/test-blacklist.c
testsuite/test-dependencies.c
testsuite/test-init.c
testsuite/test-initstate.c
testsuite/test-loaded.c
testsuite/test-multi-softdep.c
testsuite/test-new-module.c
testsuite/test-remove.c
testsuite/test-testsuite.c
testsuite/test-util.c
testsuite/test-weakdep.c

index 6ba996c2a49ac20b7744cffc7a21396c56a851f7..471744a4897c6133874125982bb2b5145b964338 100644 (file)
@@ -60,7 +60,7 @@ static int blacklist_1(void)
        kmod_module_unref_list(list);
        kmod_unref(ctx);
 
-       return EXIT_SUCCESS;
+       return 0;
 }
 
 DEFINE_TEST(blacklist_1, .description = "check if modules are correctly blacklisted",
index a88f3a582417e4720fe6d6052b931e8578da97c2..c00a8be870f56c9c8ae9e92d04f5c7ef1152b992 100644 (file)
@@ -58,7 +58,7 @@ static int test_dependencies(void)
        kmod_module_unref(mod);
        kmod_unref(ctx);
 
-       return EXIT_SUCCESS;
+       return 0;
 }
 DEFINE_TEST(test_dependencies,
            .description = "test if kmod_module_get_dependencies works",
index 3c0ff8513bf3fc1c5994acab4986ad0b148f4016..6466d1a8c1a87756e690c6b4ace87d35e7c5b36a 100644 (file)
@@ -33,7 +33,7 @@ static int test_load_resources(void)
 
        kmod_unref(ctx);
 
-       return EXIT_SUCCESS;
+       return 0;
 }
 DEFINE_TEST_WITH_FUNC(
        test_load_resource1, test_load_resources,
@@ -64,7 +64,7 @@ static int test_initlib(void)
 
        kmod_unref(ctx);
 
-       return EXIT_SUCCESS;
+       return 0;
 }
 DEFINE_TEST(test_initlib, .description = "test if libkmod's init function work");
 
@@ -87,7 +87,7 @@ static int test_insert(void)
        kmod_module_unref(mod);
        kmod_unref(ctx);
 
-       return EXIT_SUCCESS;
+       return 0;
 }
 DEFINE_TEST(test_insert,
        .description = "test if libkmod's insert_module returns ok",
@@ -123,7 +123,7 @@ static int test_remove(void)
        kmod_module_unref(mod_simple);
        kmod_unref(ctx);
 
-       return EXIT_SUCCESS;
+       return 0;
 }
 DEFINE_TEST(
        test_remove, .description = "test if libkmod's remove_module returns ok",
index 4d3430397a834043397a0529bdf709ca4662affc..33eda1582611a632e2a6b976423eadd35f13a585 100644 (file)
@@ -42,7 +42,7 @@ static int test_initstate_from_lookup(void)
        kmod_module_unref_list(list);
        kmod_unref(ctx);
 
-       return EXIT_SUCCESS;
+       return 0;
 }
 DEFINE_TEST(
        test_initstate_from_lookup,
@@ -73,7 +73,7 @@ static int test_initstate_from_name(void)
        kmod_module_unref(mod);
        kmod_unref(ctx);
 
-       return EXIT_SUCCESS;
+       return 0;
 }
 DEFINE_TEST(test_initstate_from_name,
            .description =
index bf8efd7bbc797786b9b272ce560aa2624db91780..8cd4d8bbc4395eb47bb08282d7a0a90a26e8b24f 100644 (file)
@@ -58,7 +58,7 @@ static int loaded_1(void)
 
        kmod_unref(ctx);
 
-       return EXIT_SUCCESS;
+       return 0;
 }
 DEFINE_TEST(loaded_1,
        .description = "check if list of module is created",
index 0d51f924cb772e4cafb61e0354766fadb112536d..13738b4a1de7a420d98d6bc321a0c1142d360584 100644 (file)
@@ -97,7 +97,7 @@ static int multi_softdep(void)
                kmod_module_unref(mod);
        }
        kmod_unref(ctx);
-       return EXIT_SUCCESS;
+       return 0;
 }
 
 /*
index 30683a607384fb1d0c5813ad74d68484159ed3bf..3ec81b0359fa888abb3a5ed7472cf677d66b29cc 100644 (file)
@@ -43,7 +43,7 @@ static int from_name(void)
 
        kmod_unref(ctx);
 
-       return EXIT_SUCCESS;
+       return 0;
 }
 DEFINE_TEST(from_name,
        .description = "check if module names are parsed correctly",
@@ -83,7 +83,7 @@ static int from_alias(void)
 
        kmod_unref(ctx);
 
-       return EXIT_SUCCESS;
+       return 0;
 }
 DEFINE_TEST(from_alias,
        .description = "check if aliases are parsed correctly",
index b47e5e8f2673caaff9a735f2545bf1335863e0a6..fd99ea36fc4c5fb5ceb66dbac6a30da77d362dd0 100644 (file)
@@ -42,7 +42,7 @@ static int test_remove(void)
        kmod_module_unref(mod);
        kmod_unref(ctx);
 
-       return EXIT_SUCCESS;
+       return 0;
 }
 DEFINE_TEST(test_remove,
            .description = "test if libkmod's delete_module removes module directory",
index 9570c0d7ed49214440b140e87437bfc248885bc1..73e7eb227c5fb2e358642c02ed924aabd204726a 100644 (file)
@@ -30,7 +30,7 @@ static int testsuite_uname(void)
 
        TS_ASSERT(streq(u.release, TEST_UNAME));
 
-       return EXIT_SUCCESS;
+       return 0;
 }
 DEFINE_TEST(testsuite_uname, .description = "test if trap to uname() works",
            .config = {
@@ -51,7 +51,7 @@ static int testsuite_rootfs_fopen(void)
 
        TS_ASSERT(streq(s, "kmod-test-chroot-works"));
 
-       return EXIT_SUCCESS;
+       return 0;
 }
 DEFINE_TEST(testsuite_rootfs_fopen, .description = "test if rootfs works - fopen()",
            .config = {
@@ -80,7 +80,7 @@ static int testsuite_rootfs_open(void)
 
        TS_ASSERT(streq(buf, "kmod-test-chroot-works\n"));
 
-       return EXIT_SUCCESS;
+       return 0;
 }
 DEFINE_TEST(testsuite_rootfs_open, .description = "test if rootfs works - open()",
            .config = {
@@ -93,7 +93,7 @@ static int testsuite_rootfs_stat(void)
 
        TS_ASSERT(stat(MODULE_DIRECTORY "/a", &st) == 0);
 
-       return EXIT_SUCCESS;
+       return 0;
 }
 DEFINE_TEST(testsuite_rootfs_stat, .description = "test if rootfs works - stat()",
            .config = {
@@ -108,7 +108,7 @@ static int testsuite_rootfs_opendir(void)
        TS_ASSERT(d != NULL);
 
        closedir(d);
-       return EXIT_SUCCESS;
+       return 0;
 }
 DEFINE_TEST(testsuite_rootfs_opendir, .description = "test if rootfs works - opendir()",
            .config = {
index 7d68ba2c87a47a792c106e4e41c70eb2d0a5c42b..1749d2faa82d7c17ff4b1e3f7193959a904bc325 100644 (file)
@@ -47,7 +47,7 @@ static int alias_1(void)
                printf("\n");
        }
 
-       return EXIT_SUCCESS;
+       return 0;
 }
 DEFINE_TEST(alias_1,
        .description = "check if alias_normalize does the right thing",
@@ -75,7 +75,7 @@ static int test_freadline_wrapped(void)
        }
 
        fclose(fp);
-       return EXIT_SUCCESS;
+       return 0;
 }
 DEFINE_TEST(test_freadline_wrapped,
        .description = "check if freadline_wrapped() does the right thing",
@@ -94,7 +94,7 @@ static int test_strchr_replace(void)
        strchr_replace(s, 's', 'C');
        TS_ASSERT(streq(s, res));
 
-       return EXIT_SUCCESS;
+       return 0;
 }
 DEFINE_TEST(test_strchr_replace,
            .description = "check implementation of strchr_replace()");
@@ -122,7 +122,7 @@ static int test_underscores(void)
                TS_ASSERT(streq(val, teststr[i].res));
        }
 
-       return EXIT_SUCCESS;
+       return 0;
 }
 DEFINE_TEST(test_underscores, .description = "check implementation of underscores()");
 
@@ -156,7 +156,7 @@ static int test_path_ends_with_kmod_ext(void)
                        teststr[i].res);
        }
 
-       return EXIT_SUCCESS;
+       return 0;
 }
 DEFINE_TEST(test_path_ends_with_kmod_ext,
            .description = "check implementation of path_ends_with_kmod_ext()");
@@ -174,7 +174,7 @@ static int test_write_str_safe(void)
        write_str_safe(fd, s, strlen(s));
        close(fd);
 
-       return EXIT_SUCCESS;
+       return 0;
 }
 DEFINE_TEST(test_write_str_safe,
        .description = "check implementation of write_str_safe()",
@@ -201,7 +201,7 @@ static int test_uadd32_overflow(void)
        overflow = uadd32_overflow(UINT32_MAX, 1, &res);
        TS_ASSERT(overflow);
 
-       return EXIT_SUCCESS;
+       return 0;
 }
 DEFINE_TEST(test_uadd32_overflow,
            .description = "check implementation of uadd32_overflow()");
@@ -218,7 +218,7 @@ static int test_uadd64_overflow(void)
        overflow = uadd64_overflow(UINT64_MAX, 1, &res);
        TS_ASSERT(overflow);
 
-       return EXIT_SUCCESS;
+       return 0;
 }
 DEFINE_TEST(test_uadd64_overflow,
            .description = "check implementation of uadd64_overflow()");
@@ -235,7 +235,7 @@ static int test_umul32_overflow(void)
        overflow = umul32_overflow(UINT32_MAX, 0x10, &res);
        TS_ASSERT(overflow);
 
-       return EXIT_SUCCESS;
+       return 0;
 }
 DEFINE_TEST(test_umul32_overflow,
            .description = "check implementation of umul32_overflow()");
@@ -252,7 +252,7 @@ static int test_umul64_overflow(void)
        overflow = umul64_overflow(UINT64_MAX, 0x10, &res);
        TS_ASSERT(overflow);
 
-       return EXIT_SUCCESS;
+       return 0;
 }
 DEFINE_TEST(test_umul64_overflow,
            .description = "check implementation of umul64_overflow()");
@@ -289,7 +289,7 @@ static int test_backoff_time(void)
        get_backoff_delta_msec(now_msec() - 10, &delta);
        TS_ASSERT(delta == 0);
 
-       return EXIT_SUCCESS;
+       return 0;
 }
 DEFINE_TEST(test_backoff_time,
            .description = "check implementation of get_backoff_delta_msec()");
index 342af1272d6fb078a3fe5fc9270cac05209e2e1d..96a7867aa358593b716c6d7d5cd7fe120a97c32f 100644 (file)
@@ -57,7 +57,7 @@ static int test_weakdep(void)
 
        kmod_unref(ctx);
 
-       return EXIT_SUCCESS;
+       return 0;
 }
 DEFINE_TEST(test_weakdep,
        .description = "check if libkmod breaks weakdep",