From: Francis Deslauriers Date: Wed, 4 Mar 2020 21:18:37 +0000 (-0500) Subject: Fix: Tests: `gen-ust-events` doesn't error out on invalid option X-Git-Tag: v2.13.0-rc1~725 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=86cf031ae8be7633ff8eee0cd0bf503b331cfc34;p=lttng-tools.git Fix: Tests: `gen-ust-events` doesn't error out on invalid option Issue ===== When running `gen-ust-events` with an invalid option: ./gen-ust-events -h The `getopt_long()` function prints the following error: ./gen-ust-events: invalid option -- 'h' which is very kind of it. The problem is that the process keep running and go on to generate events. It should exit right away. Solution ======== Remove the `break` statement and so that we execute the `goto end` right away. Apply the same changes to `gen-ust-nevents`. Signed-off-by: Francis Deslauriers Change-Id: Ib1c96f4c9ed8f98395bf842215f858a69db2bbf0 Signed-off-by: Jérémie Galarneau --- diff --git a/tests/utils/testapp/gen-ust-events/gen-ust-events.c b/tests/utils/testapp/gen-ust-events/gen-ust-events.c index 51e53a620..7ce86bcae 100644 --- a/tests/utils/testapp/gen-ust-events/gen-ust-events.c +++ b/tests/utils/testapp/gen-ust-events/gen-ust-events.c @@ -90,7 +90,6 @@ int main(int argc, char **argv) break; case '?': /* getopt_long already printed an error message. */ - break; default: ret = -1; goto end; diff --git a/tests/utils/testapp/gen-ust-nevents/gen-ust-nevents.c b/tests/utils/testapp/gen-ust-nevents/gen-ust-nevents.c index 329368731..abbc72e12 100644 --- a/tests/utils/testapp/gen-ust-nevents/gen-ust-nevents.c +++ b/tests/utils/testapp/gen-ust-nevents/gen-ust-nevents.c @@ -51,7 +51,6 @@ int main(int argc, char **argv) break; case '?': /* getopt_long already printed an error message. */ - break; default: ret = -1; goto end;