From 305ee2824e307d9ec6a541b8b84c57246bf3f3fb Mon Sep 17 00:00:00 2001 From: Yury Gribov Date: Wed, 10 Apr 2024 23:39:34 +0300 Subject: [PATCH] Minor test update. --- tests/stack-args/main.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/stack-args/main.c b/tests/stack-args/main.c index 56e7a04..774865d 100644 --- a/tests/stack-args/main.c +++ b/tests/stack-args/main.c @@ -11,18 +11,23 @@ #include #include +#include + +static void usage(char *progname) { + fprintf(stderr, "Usage: %s float/int\n", progname); + exit(1); +} int main(int argc, char *argv[]) { if (argc != 2) - return 1; + usage(argv[0]); if (0 == strcmp(argv[1], "int")) { foo(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); } else if (0 == strcmp(argv[1], "float")) { bar(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); } else { - fprintf(stderr, "Invalid option: %s\n", argv[1]); - return 1; + usage(argv[0]); } return 0;