From 23eee394893541fa531543e8fb4b12610599817c Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Mon, 19 Aug 2013 10:47:53 +0200 Subject: [PATCH] tests: roll out igt_require some more Signed-off-by: Daniel Vetter --- tests/gem_caching.c | 9 +++------ tests/gem_seqno_wrap.c | 7 +------ tests/sysfs_rc6_residency.c | 5 +---- tests/sysfs_rps.c | 5 +---- 4 files changed, 6 insertions(+), 20 deletions(-) diff --git a/tests/gem_caching.c b/tests/gem_caching.c index 6fa9a15..473872c 100644 --- a/tests/gem_caching.c +++ b/tests/gem_caching.c @@ -143,8 +143,7 @@ int main(int argc, char **argv) } igt_subtest("reads") { - if (!(flags & TEST_READ)) - igt_skip(); + igt_require(flags & TEST_READ); printf("checking partial reads\n"); @@ -173,8 +172,7 @@ int main(int argc, char **argv) } igt_subtest("writes") { - if (!(flags & TEST_WRITE)) - igt_skip(); + igt_require(flags & TEST_WRITE); printf("checking partial writes\n"); @@ -225,8 +223,7 @@ int main(int argc, char **argv) } igt_subtest("read-writes") { - if (!((flags & TEST_BOTH) == TEST_BOTH)) - igt_skip(); + igt_require((flags & TEST_BOTH) == TEST_BOTH); printf("checking partial writes after partial reads\n"); diff --git a/tests/gem_seqno_wrap.c b/tests/gem_seqno_wrap.c index 7549eb6..0f7e52b 100644 --- a/tests/gem_seqno_wrap.c +++ b/tests/gem_seqno_wrap.c @@ -367,12 +367,7 @@ static int dfs_open(int mode) dfs_base, card_index, dfs_entry); fh = open(fname, mode); - if (fh == -1) { - fprintf(stderr, - "error %d opening '%s/%d/%s'. too old kernel?\n", - errno, dfs_base, card_index, dfs_entry); - igt_skip(); - } + igt_require(fh >= 0); return fh; } diff --git a/tests/sysfs_rc6_residency.c b/tests/sysfs_rc6_residency.c index f96d5ec..3b873a0 100644 --- a/tests/sysfs_rc6_residency.c +++ b/tests/sysfs_rc6_residency.c @@ -77,10 +77,7 @@ int main(int argc, char *argv[]) sleep(5); file = fopen(path, "r"); - if (!file) { - printf("kernel too old or rc6 not supported on this platform.\n"); - igt_skip(); - } + igt_require(file); /* claim success if no rc6 enabled. */ if (readit(path) == 0) diff --git a/tests/sysfs_rps.c b/tests/sysfs_rps.c index 55804c0..544be8f 100644 --- a/tests/sysfs_rps.c +++ b/tests/sysfs_rps.c @@ -148,10 +148,7 @@ int main(int argc, char *argv[]) ret = asprintf(&path, sysfs_base_path, device, junk->name); igt_assert(ret != -1); junk->filp = fopen(path, junk->mode); - if (junk->filp == NULL) { - printf("Kernel is too old. GTFO\n"); - igt_skip(); - } + igt_require(junk->filp == NULL); val = readval(junk->filp); igt_assert(val >= 0); junk++; -- 2.7.4