diff options
author | Antti Koskipaa <antti.koskipaa@linux.intel.com> | 2014-04-10 15:08:11 +0300 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2014-04-25 16:18:19 +0300 |
commit | fafcff90a870844e0febdda4066b361479df3747 (patch) | |
tree | dfaf033d422b53146d7a486e7cd97c8208bcf322 | |
parent | 470e5ce6c34731a1c76a1089dabfb6144f4f1429 (diff) |
kms_cursor_crc: Add random cursor placement test
Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>
-rw-r--r-- | tests/kms_cursor_crc.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c index b2498a1e..e00abf59 100644 --- a/tests/kms_cursor_crc.c +++ b/tests/kms_cursor_crc.c @@ -214,6 +214,18 @@ static void test_crc_sliding(test_data_t *test_data) } } +static void test_crc_random(test_data_t *test_data) +{ + int i; + + /* Random cursor placement */ + for (i = 0; i < 50; i++) { + int x = rand() % (test_data->screenw + test_data->curw * 2) - test_data->curw; + int y = rand() % (test_data->screenh + test_data->curh * 2) - test_data->curh; + do_single_test(test_data, x, y); + } +} + static bool prepare_crtc(test_data_t *test_data, igt_output_t *output, int cursor_w, int cursor_h) { @@ -359,6 +371,8 @@ static void run_test_generic(data_t *data, int cursor_max_size) run_test(data, test_crc_offscreen, cursor_size, cursor_size); igt_subtest_f("cursor-%s-sliding", c_size) run_test(data, test_crc_sliding, cursor_size, cursor_size); + igt_subtest_f("cursor-%s-random", c_size) + run_test(data, test_crc_random, cursor_size, cursor_size); } } |