diff options
author | Lucas De Marchi <lucas.demarchi@intel.com> | 2018-01-03 13:37:59 -0800 |
---|---|---|
committer | Lucas De Marchi <lucas.demarchi@intel.com> | 2018-01-03 14:22:11 -0800 |
commit | 568b1c86cc4873c03c2df1c14cdf6dc4acfdc896 (patch) | |
tree | 1d3398963e8f1762b0fea4c4e4ccecd2efe5c10c | |
parent | dde2770ee6d64e3f6e010edd812db5eba7a42ef4 (diff) | |
download | kmod-568b1c86cc4873c03c2df1c14cdf6dc4acfdc896.tar.gz kmod-568b1c86cc4873c03c2df1c14cdf6dc4acfdc896.tar.bz2 kmod-568b1c86cc4873c03c2df1c14cdf6dc4acfdc896.zip |
testsuite: add missing error handling
If we passed an invalid argument to a test it would segfault rather than
returning an error code.
-rw-r--r-- | testsuite/testsuite.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/testsuite/testsuite.h b/testsuite/testsuite.h index bb0eb50..2b31483 100644 --- a/testsuite/testsuite.h +++ b/testsuite/testsuite.h @@ -151,6 +151,8 @@ int test_run(const struct test *t); arg = test_init(__start_kmod_tests, __stop_kmod_tests, argc, argv); \ if (arg == 0) \ return 0; \ + if (arg < 0) \ + return EXIT_FAILURE; \ \ if (arg < argc) { \ t = test_find(__start_kmod_tests, __stop_kmod_tests, argv[arg]); \ |