Skip to content

Commit 84fa569

Browse files
evelikovLucas De Marchi
authored andcommitted
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 <emil.l.velikov@gmail.com> Link: #375 Signed-off-by: Lucas De Marchi <ldemarchi@kernel.org>
1 parent bd7ed71 commit 84fa569

11 files changed

Lines changed: 30 additions & 30 deletions

testsuite/test-blacklist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static int blacklist_1(void)
6060
kmod_module_unref_list(list);
6161
kmod_unref(ctx);
6262

63-
return EXIT_SUCCESS;
63+
return 0;
6464
}
6565

6666
DEFINE_TEST(blacklist_1, .description = "check if modules are correctly blacklisted",

testsuite/test-dependencies.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static int test_dependencies(void)
5858
kmod_module_unref(mod);
5959
kmod_unref(ctx);
6060

61-
return EXIT_SUCCESS;
61+
return 0;
6262
}
6363
DEFINE_TEST(test_dependencies,
6464
.description = "test if kmod_module_get_dependencies works",

testsuite/test-init.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static int test_load_resources(void)
3333

3434
kmod_unref(ctx);
3535

36-
return EXIT_SUCCESS;
36+
return 0;
3737
}
3838
DEFINE_TEST_WITH_FUNC(
3939
test_load_resource1, test_load_resources,
@@ -64,7 +64,7 @@ static int test_initlib(void)
6464

6565
kmod_unref(ctx);
6666

67-
return EXIT_SUCCESS;
67+
return 0;
6868
}
6969
DEFINE_TEST(test_initlib, .description = "test if libkmod's init function work");
7070

@@ -87,7 +87,7 @@ static int test_insert(void)
8787
kmod_module_unref(mod);
8888
kmod_unref(ctx);
8989

90-
return EXIT_SUCCESS;
90+
return 0;
9191
}
9292
DEFINE_TEST(test_insert,
9393
.description = "test if libkmod's insert_module returns ok",
@@ -123,7 +123,7 @@ static int test_remove(void)
123123
kmod_module_unref(mod_simple);
124124
kmod_unref(ctx);
125125

126-
return EXIT_SUCCESS;
126+
return 0;
127127
}
128128
DEFINE_TEST(
129129
test_remove, .description = "test if libkmod's remove_module returns ok",

testsuite/test-initstate.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static int test_initstate_from_lookup(void)
4242
kmod_module_unref_list(list);
4343
kmod_unref(ctx);
4444

45-
return EXIT_SUCCESS;
45+
return 0;
4646
}
4747
DEFINE_TEST(
4848
test_initstate_from_lookup,
@@ -73,7 +73,7 @@ static int test_initstate_from_name(void)
7373
kmod_module_unref(mod);
7474
kmod_unref(ctx);
7575

76-
return EXIT_SUCCESS;
76+
return 0;
7777
}
7878
DEFINE_TEST(test_initstate_from_name,
7979
.description =

testsuite/test-loaded.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static int loaded_1(void)
5858

5959
kmod_unref(ctx);
6060

61-
return EXIT_SUCCESS;
61+
return 0;
6262
}
6363
DEFINE_TEST(loaded_1,
6464
.description = "check if list of module is created",

testsuite/test-multi-softdep.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static int multi_softdep(void)
9797
kmod_module_unref(mod);
9898
}
9999
kmod_unref(ctx);
100-
return EXIT_SUCCESS;
100+
return 0;
101101
}
102102

103103
/*

testsuite/test-new-module.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static int from_name(void)
4343

4444
kmod_unref(ctx);
4545

46-
return EXIT_SUCCESS;
46+
return 0;
4747
}
4848
DEFINE_TEST(from_name,
4949
.description = "check if module names are parsed correctly",
@@ -83,7 +83,7 @@ static int from_alias(void)
8383

8484
kmod_unref(ctx);
8585

86-
return EXIT_SUCCESS;
86+
return 0;
8787
}
8888
DEFINE_TEST(from_alias,
8989
.description = "check if aliases are parsed correctly",

testsuite/test-remove.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static int test_remove(void)
4242
kmod_module_unref(mod);
4343
kmod_unref(ctx);
4444

45-
return EXIT_SUCCESS;
45+
return 0;
4646
}
4747
DEFINE_TEST(test_remove,
4848
.description = "test if libkmod's delete_module removes module directory",

testsuite/test-testsuite.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ static int testsuite_uname(void)
3030

3131
TS_ASSERT(streq(u.release, TEST_UNAME));
3232

33-
return EXIT_SUCCESS;
33+
return 0;
3434
}
3535
DEFINE_TEST(testsuite_uname, .description = "test if trap to uname() works",
3636
.config = {
@@ -51,7 +51,7 @@ static int testsuite_rootfs_fopen(void)
5151

5252
TS_ASSERT(streq(s, "kmod-test-chroot-works"));
5353

54-
return EXIT_SUCCESS;
54+
return 0;
5555
}
5656
DEFINE_TEST(testsuite_rootfs_fopen, .description = "test if rootfs works - fopen()",
5757
.config = {
@@ -80,7 +80,7 @@ static int testsuite_rootfs_open(void)
8080

8181
TS_ASSERT(streq(buf, "kmod-test-chroot-works\n"));
8282

83-
return EXIT_SUCCESS;
83+
return 0;
8484
}
8585
DEFINE_TEST(testsuite_rootfs_open, .description = "test if rootfs works - open()",
8686
.config = {
@@ -93,7 +93,7 @@ static int testsuite_rootfs_stat(void)
9393

9494
TS_ASSERT(stat(MODULE_DIRECTORY "/a", &st) == 0);
9595

96-
return EXIT_SUCCESS;
96+
return 0;
9797
}
9898
DEFINE_TEST(testsuite_rootfs_stat, .description = "test if rootfs works - stat()",
9999
.config = {
@@ -108,7 +108,7 @@ static int testsuite_rootfs_opendir(void)
108108
TS_ASSERT(d != NULL);
109109

110110
closedir(d);
111-
return EXIT_SUCCESS;
111+
return 0;
112112
}
113113
DEFINE_TEST(testsuite_rootfs_opendir, .description = "test if rootfs works - opendir()",
114114
.config = {

testsuite/test-util.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static int alias_1(void)
4747
printf("\n");
4848
}
4949

50-
return EXIT_SUCCESS;
50+
return 0;
5151
}
5252
DEFINE_TEST(alias_1,
5353
.description = "check if alias_normalize does the right thing",
@@ -75,7 +75,7 @@ static int test_freadline_wrapped(void)
7575
}
7676

7777
fclose(fp);
78-
return EXIT_SUCCESS;
78+
return 0;
7979
}
8080
DEFINE_TEST(test_freadline_wrapped,
8181
.description = "check if freadline_wrapped() does the right thing",
@@ -94,7 +94,7 @@ static int test_strchr_replace(void)
9494
strchr_replace(s, 's', 'C');
9595
TS_ASSERT(streq(s, res));
9696

97-
return EXIT_SUCCESS;
97+
return 0;
9898
}
9999
DEFINE_TEST(test_strchr_replace,
100100
.description = "check implementation of strchr_replace()");
@@ -122,7 +122,7 @@ static int test_underscores(void)
122122
TS_ASSERT(streq(val, teststr[i].res));
123123
}
124124

125-
return EXIT_SUCCESS;
125+
return 0;
126126
}
127127
DEFINE_TEST(test_underscores, .description = "check implementation of underscores()");
128128

@@ -156,7 +156,7 @@ static int test_path_ends_with_kmod_ext(void)
156156
teststr[i].res);
157157
}
158158

159-
return EXIT_SUCCESS;
159+
return 0;
160160
}
161161
DEFINE_TEST(test_path_ends_with_kmod_ext,
162162
.description = "check implementation of path_ends_with_kmod_ext()");
@@ -174,7 +174,7 @@ static int test_write_str_safe(void)
174174
write_str_safe(fd, s, strlen(s));
175175
close(fd);
176176

177-
return EXIT_SUCCESS;
177+
return 0;
178178
}
179179
DEFINE_TEST(test_write_str_safe,
180180
.description = "check implementation of write_str_safe()",
@@ -201,7 +201,7 @@ static int test_uadd32_overflow(void)
201201
overflow = uadd32_overflow(UINT32_MAX, 1, &res);
202202
TS_ASSERT(overflow);
203203

204-
return EXIT_SUCCESS;
204+
return 0;
205205
}
206206
DEFINE_TEST(test_uadd32_overflow,
207207
.description = "check implementation of uadd32_overflow()");
@@ -218,7 +218,7 @@ static int test_uadd64_overflow(void)
218218
overflow = uadd64_overflow(UINT64_MAX, 1, &res);
219219
TS_ASSERT(overflow);
220220

221-
return EXIT_SUCCESS;
221+
return 0;
222222
}
223223
DEFINE_TEST(test_uadd64_overflow,
224224
.description = "check implementation of uadd64_overflow()");
@@ -235,7 +235,7 @@ static int test_umul32_overflow(void)
235235
overflow = umul32_overflow(UINT32_MAX, 0x10, &res);
236236
TS_ASSERT(overflow);
237237

238-
return EXIT_SUCCESS;
238+
return 0;
239239
}
240240
DEFINE_TEST(test_umul32_overflow,
241241
.description = "check implementation of umul32_overflow()");
@@ -252,7 +252,7 @@ static int test_umul64_overflow(void)
252252
overflow = umul64_overflow(UINT64_MAX, 0x10, &res);
253253
TS_ASSERT(overflow);
254254

255-
return EXIT_SUCCESS;
255+
return 0;
256256
}
257257
DEFINE_TEST(test_umul64_overflow,
258258
.description = "check implementation of umul64_overflow()");
@@ -289,7 +289,7 @@ static int test_backoff_time(void)
289289
get_backoff_delta_msec(now_msec() - 10, &delta);
290290
TS_ASSERT(delta == 0);
291291

292-
return EXIT_SUCCESS;
292+
return 0;
293293
}
294294
DEFINE_TEST(test_backoff_time,
295295
.description = "check implementation of get_backoff_delta_msec()");

0 commit comments

Comments
 (0)