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 <smcv@collabora.com>
This commit is contained in:
Simon McVittie 2022-06-30 14:00:38 +01:00 committed by Dylan Baker
parent e06dd48ad2
commit f0e9a44d41
3 changed files with 3 additions and 0 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}