Skip to content

Commit f0e9a44

Browse files
smcvdcbaker
authored andcommitted
test cases: Don't fall off the end of main() without an exit status
This is undefined behaviour, and seems to have caused test failures when backporting Meson to an older toolchain in the Steam Runtime. Signed-off-by: Simon McVittie <[email protected]>
1 parent e06dd48 commit f0e9a44

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

test cases/common/141 special characters/arg-char-test.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ int main(int argc, char **argv) {
77
if (c != argv[1][0])
88
fprintf(stderr, "Expected %x, got %x\n", (unsigned int) c, (unsigned int) argv[1][0]);
99
assert(c == argv[1][0]);
10+
return 0;
1011
}

test cases/common/141 special characters/arg-string-test.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ int main(int argc, char **argv) {
99
if (s[0] != argv[1][0])
1010
fprintf(stderr, "Expected %x, got %x\n", (unsigned int) s[0], (unsigned int) argv[1][0]);
1111
assert(s[0] == argv[1][0]);
12+
return 0;
1213
}

test cases/common/141 special characters/arg-unquoted-test.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ int main(int argc, char **argv) {
1414
assert(s[0] == argv[1][0]);
1515
// There is no way to convert a macro argument into a character constant.
1616
// Otherwise we'd test that as well
17+
return 0;
1718
}

0 commit comments

Comments
 (0)