From f0e9a44d41e2040e14dbd07a288654415c6b595a Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 30 Jun 2022 14:00:38 +0100 Subject: [PATCH] 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 --- test cases/common/141 special characters/arg-char-test.c | 1 + test cases/common/141 special characters/arg-string-test.c | 1 + test cases/common/141 special characters/arg-unquoted-test.c | 1 + 3 files changed, 3 insertions(+) diff --git a/test cases/common/141 special characters/arg-char-test.c b/test cases/common/141 special characters/arg-char-test.c index 04e02f8e8675..044857eed7ec 100644 --- a/test cases/common/141 special characters/arg-char-test.c +++ b/test cases/common/141 special characters/arg-char-test.c @@ -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; } diff --git a/test cases/common/141 special characters/arg-string-test.c b/test cases/common/141 special characters/arg-string-test.c index 199fd79173d7..1d93f45c0d0a 100644 --- a/test cases/common/141 special characters/arg-string-test.c +++ b/test cases/common/141 special characters/arg-string-test.c @@ -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; } diff --git a/test cases/common/141 special characters/arg-unquoted-test.c b/test cases/common/141 special characters/arg-unquoted-test.c index 7f679ca685cf..9c51bffdcfd1 100644 --- a/test cases/common/141 special characters/arg-unquoted-test.c +++ b/test cases/common/141 special characters/arg-unquoted-test.c @@ -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; }