diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-08-12 10:43:59 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-08-12 11:17:58 +0200 |
commit | 7553ad6e10f76aa703359a10e08138e14501d54d (patch) | |
tree | 1e778fa0a06bf91bdc43aa2574be555396e42d5c /tests/gem_pread_after_blit.c | |
parent | a4038d3853b98707a803f5d1fb5c9ebe32f0b84b (diff) |
tests: use drmtest_skip() in caching ioctl helpers
This way we can rip out all the skip handling from the test control flow,
and additionally (by using drmtest_retval()) even get correct exit codes.
The only tricky part is that when we only want ot skip parts of a test
(like for gem_pread and gem_pwrite) we need to split out those parts as
subtests. But no addition of control-flow is required, the set/longjmp
magic in the helpers all makes it happen.
Also we make extensive use of the behaviour of drmtest_skip to skip
all subsequent subtests if it is called outside of a subtest. This allows
us to re-flatten the control flow a lot.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests/gem_pread_after_blit.c')
-rw-r--r-- | tests/gem_pread_after_blit.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/gem_pread_after_blit.c b/tests/gem_pread_after_blit.c index 7375000a..71dab345 100644 --- a/tests/gem_pread_after_blit.c +++ b/tests/gem_pread_after_blit.c @@ -131,11 +131,12 @@ static void do_test(int fd, int cache_level, int loop) { if (cache_level != -1) { - if (gem_set_caching(fd, tmp[0]->handle, cache_level) || - gem_set_caching(fd, tmp[1]->handle, cache_level)) - return; + gem_set_caching(fd, tmp[0]->handle, cache_level); + gem_set_caching(fd, tmp[1]->handle, cache_level); } + printf("meh"); + do { /* First, do a full-buffer read after blitting */ intel_copy_bo(batch, tmp[0], src[0], width, height); @@ -235,5 +236,5 @@ main(int argc, char **argv) close(fd); - return 0; + return drmtest_retval(); } |