summaryrefslogtreecommitdiff
path: root/tests/kms_plane_multiple.c
diff options
context:
space:
mode:
authorPetri Latvala <petri.latvala@intel.com>2019-05-23 15:27:20 +0300
committerPetri Latvala <petri.latvala@intel.com>2019-05-27 12:47:43 +0300
commitb6e9dcb5be57eae398ffc2717f4087a14d710100 (patch)
treedc829c7671bd47c9422eabfac01c647e1717c37a /tests/kms_plane_multiple.c
parent6d0cc5202a9a3a823c6239b15763d4b01d32080d (diff)
kms_plane_multiple: Nuke custom main function
Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Diffstat (limited to 'tests/kms_plane_multiple.c')
-rw-r--r--tests/kms_plane_multiple.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/tests/kms_plane_multiple.c b/tests/kms_plane_multiple.c
index d2d02a5f..a28b30cc 100644
--- a/tests/kms_plane_multiple.c
+++ b/tests/kms_plane_multiple.c
@@ -346,8 +346,8 @@ static int opt_handler(int option, int option_index, void *input)
opt.iterations = strtol(optarg, NULL, 0);
if (opt.iterations < LOOP_FOREVER || opt.iterations == 0) {
- igt_info("incorrect number of iterations\n");
- igt_assert(false);
+ igt_info("incorrect number of iterations: %d\n", opt.iterations);
+ return IGT_OPT_HANDLER_ERROR;
}
break;
@@ -356,28 +356,26 @@ static int opt_handler(int option, int option_index, void *input)
opt.seed = strtol(optarg, NULL, 0);
break;
default:
- igt_assert(false);
+ return IGT_OPT_HANDLER_ERROR;
}
- return 0;
+ return IGT_OPT_HANDLER_SUCCESS;
}
const char *help_str =
" --iterations Number of iterations for test coverage. -1 loop forever, default 64 iterations\n"
" --seed Seed for random number generator\n";
-int main(int argc, char *argv[])
+struct option long_options[] = {
+ { "iterations", required_argument, NULL, 'i'},
+ { "seed", required_argument, NULL, 's'},
+ { 0, 0, 0, 0 }
+};
+
+igt_main_args("", long_options, help_str, opt_handler, NULL)
{
- struct option long_options[] = {
- { "iterations", required_argument, NULL, 'i'},
- { "seed", required_argument, NULL, 's'},
- { 0, 0, 0, 0 }
- };
enum pipe pipe;
- igt_subtest_init_parse_opts(&argc, argv, "", long_options, help_str,
- opt_handler, NULL);
-
igt_skip_on_simulation();
igt_fixture {
@@ -396,6 +394,4 @@ int main(int argc, char *argv[])
igt_fixture {
igt_display_fini(&data.display);
}
-
- igt_exit();
}