Skip to content

Commit

Permalink
test cases: Don't fall off the end of main() without an exit status
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
smcv authored and dcbaker committed Jun 30, 2022
1 parent e06dd48 commit f0e9a44
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions test cases/common/141 special characters/arg-char-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ int main(int argc, char **argv) {
if (c != argv[1][0])
fprintf(stderr, "Expected %x, got %x\n", (unsigned int) c, (unsigned int) argv[1][0]);
assert(c == argv[1][0]);
return 0;
}
1 change: 1 addition & 0 deletions test cases/common/141 special characters/arg-string-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ int main(int argc, char **argv) {
if (s[0] != argv[1][0])
fprintf(stderr, "Expected %x, got %x\n", (unsigned int) s[0], (unsigned int) argv[1][0]);
assert(s[0] == argv[1][0]);
return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ int main(int argc, char **argv) {
assert(s[0] == argv[1][0]);
// There is no way to convert a macro argument into a character constant.
// Otherwise we'd test that as well
return 0;
}

0 comments on commit f0e9a44

Please sign in to comment.