From: Emil Velikov Date: Fri, 3 Jul 2026 12:05:03 +0000 (+0100) Subject: testsuite: s/return EXIT_SUCCESS/return 0/ X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=thirdparty%2Fkmod.git testsuite: s/return EXIT_SUCCESS/return 0/ 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 Link: https://github.com/kmod-project/kmod/pull/375 Signed-off-by: Lucas De Marchi --- diff --git a/testsuite/test-blacklist.c b/testsuite/test-blacklist.c index 6ba996c2..471744a4 100644 --- a/testsuite/test-blacklist.c +++ b/testsuite/test-blacklist.c @@ -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", diff --git a/testsuite/test-dependencies.c b/testsuite/test-dependencies.c index a88f3a58..c00a8be8 100644 --- a/testsuite/test-dependencies.c +++ b/testsuite/test-dependencies.c @@ -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", diff --git a/testsuite/test-init.c b/testsuite/test-init.c index 3c0ff851..6466d1a8 100644 --- a/testsuite/test-init.c +++ b/testsuite/test-init.c @@ -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", diff --git a/testsuite/test-initstate.c b/testsuite/test-initstate.c index 4d343039..33eda158 100644 --- a/testsuite/test-initstate.c +++ b/testsuite/test-initstate.c @@ -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 = diff --git a/testsuite/test-loaded.c b/testsuite/test-loaded.c index bf8efd7b..8cd4d8bb 100644 --- a/testsuite/test-loaded.c +++ b/testsuite/test-loaded.c @@ -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", diff --git a/testsuite/test-multi-softdep.c b/testsuite/test-multi-softdep.c index 0d51f924..13738b4a 100644 --- a/testsuite/test-multi-softdep.c +++ b/testsuite/test-multi-softdep.c @@ -97,7 +97,7 @@ static int multi_softdep(void) kmod_module_unref(mod); } kmod_unref(ctx); - return EXIT_SUCCESS; + return 0; } /* diff --git a/testsuite/test-new-module.c b/testsuite/test-new-module.c index 30683a60..3ec81b03 100644 --- a/testsuite/test-new-module.c +++ b/testsuite/test-new-module.c @@ -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", diff --git a/testsuite/test-remove.c b/testsuite/test-remove.c index b47e5e8f..fd99ea36 100644 --- a/testsuite/test-remove.c +++ b/testsuite/test-remove.c @@ -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", diff --git a/testsuite/test-testsuite.c b/testsuite/test-testsuite.c index 9570c0d7..73e7eb22 100644 --- a/testsuite/test-testsuite.c +++ b/testsuite/test-testsuite.c @@ -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 = { diff --git a/testsuite/test-util.c b/testsuite/test-util.c index 7d68ba2c..1749d2fa 100644 --- a/testsuite/test-util.c +++ b/testsuite/test-util.c @@ -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()"); diff --git a/testsuite/test-weakdep.c b/testsuite/test-weakdep.c index 342af127..96a7867a 100644 --- a/testsuite/test-weakdep.c +++ b/testsuite/test-weakdep.c @@ -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",