diff options
author | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2015-06-23 10:38:19 -0300 |
---|---|---|
committer | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2015-06-23 14:41:22 -0300 |
commit | 77e1bac6eb4588c00bbc2e431d9f2594675a18bd (patch) | |
tree | 698143879bd119b8468c19e290204b121a477661 /tests | |
parent | 969cb3c575ac4618b3a3484f78a9644484f9c7e8 (diff) |
tests/kms_frontbuffer_tracking: simplify wait_user() calls
I often add new temoprary wait_user() calls when debugging things, and
having to add "if (opt.step)" is annoying, so let's make the step
level check inside wait_user(). As a bonus, our huge macro is 2 lines
shorter.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/kms_frontbuffer_tracking.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c index 683443ac..497a8ac7 100644 --- a/tests/kms_frontbuffer_tracking.c +++ b/tests/kms_frontbuffer_tracking.c @@ -1206,8 +1206,11 @@ static void teardown_environment(void) teardown_drm(); } -static void wait_user(const char *msg) +static void wait_user(int step, const char *msg) { + if (opt.step < step) + return; + igt_info("%s Press enter...\n", msg); while (getchar() != '\n') ; @@ -1298,8 +1301,7 @@ static int adjust_assertion_flags(const struct test_mode *t, int flags) #define do_assertions(flags) do { \ int flags_ = adjust_assertion_flags(t, (flags)); \ \ - if (opt.step > 1) \ - wait_user("Paused before assertions."); \ + wait_user(2, "Paused before assertions."); \ \ /* Check the CRC to make sure the drawing operations work \ * immediately, independently of the features being enabled. */ \ @@ -1343,8 +1345,7 @@ static int adjust_assertion_flags(const struct test_mode *t, int flags) igt_assert(!fbc_last_action_changed()); \ } \ \ - if (opt.step) \ - wait_user("Paused after assertions."); \ + wait_user(1, "Paused after assertions."); \ } while (0) static void enable_prim_screen_and_wait(const struct test_mode *t) |