From a4cb8954b2d8f103b613aaa9860d9f25e8e2954d Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Tue, 13 Aug 2013 12:49:46 +0200 Subject: [PATCH] tests: s/exit(EXIT_FAILURE)/igt_fail(1)/ Signed-off-by: Daniel Vetter --- tests/gem_ctx_bad_destroy.c | 4 ++-- tests/gem_ctx_create.c | 2 +- tests/gem_reg_read.c | 8 ++++---- tests/gem_wait_render_timeout.c | 2 +- tests/sysfs_rc6_residency.c | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/gem_ctx_bad_destroy.c b/tests/gem_ctx_bad_destroy.c index 8ac78874..ed1474a7 100644 --- a/tests/gem_ctx_bad_destroy.c +++ b/tests/gem_ctx_bad_destroy.c @@ -66,11 +66,11 @@ static void handle_bad(int ret, int lerrno, int expected, const char *desc) if (ret != 0 && lerrno != expected) { fprintf(stderr, "%s - errno was %d, but should have been %d\n", desc, lerrno, expected); - exit(EXIT_FAILURE); + igt_fail(1); } else if (ret == 0) { fprintf(stderr, "%s - Command succeeded, but should have failed\n", desc); - exit(EXIT_FAILURE); + igt_fail(1); } } diff --git a/tests/gem_ctx_create.c b/tests/gem_ctx_create.c index 9e00e0f8..66bbe57d 100644 --- a/tests/gem_ctx_create.c +++ b/tests/gem_ctx_create.c @@ -56,7 +56,7 @@ int main(int argc, char *argv[]) exit(77); } else if (ret != 0) { fprintf(stderr, "%s\n", strerror(errno)); - exit(EXIT_FAILURE); + igt_fail(1); } igt_assert(create.ctx_id != 0); diff --git a/tests/gem_reg_read.c b/tests/gem_reg_read.c index 743beac8..1e36aa43 100644 --- a/tests/gem_reg_read.c +++ b/tests/gem_reg_read.c @@ -42,11 +42,11 @@ static void handle_bad(int ret, int expected, const char *desc) if (ret != 0 && errno != expected) { fprintf(stderr, "%s - errno was %d, but should have been %d\n", desc, errno, expected); - exit(EXIT_FAILURE); + igt_fail(1); } else if (ret == 0) { fprintf(stderr, "%s - Command succeeded, but should have failed\n", desc); - exit(EXIT_FAILURE); + igt_fail(1); } } @@ -57,7 +57,7 @@ static uint64_t timer_query(int fd) reg_read.offset = 0x2358; if (drmIoctl(fd, REG_READ_IOCTL, ®_read)) { perror("positive test case failed: "); - exit(EXIT_FAILURE); + igt_fail(1); } return reg_read.val; @@ -78,7 +78,7 @@ int main(int argc, char *argv[]) sleep(1); if (timer_query(fd) == reg_read.val) { fprintf(stderr, "Timer isn't moving, probably busted\n"); - exit(EXIT_FAILURE); + igt_fail(1); } /* bad reg */ diff --git a/tests/gem_wait_render_timeout.c b/tests/gem_wait_render_timeout.c index 2df91ba1..4424bfa1 100644 --- a/tests/gem_wait_render_timeout.c +++ b/tests/gem_wait_render_timeout.c @@ -185,7 +185,7 @@ int main(int argc, char **argv) ret = gem_bo_wait_timeout(fd, dst2->handle, &timeout); if (ret) { fprintf(stderr, "Timed wait failed %s\n", strerror(errno)); - exit(EXIT_FAILURE); + igt_fail(1); } igt_assert(gem_bo_busy(fd, dst2->handle) == false); igt_assert(timeout != 0); diff --git a/tests/sysfs_rc6_residency.c b/tests/sysfs_rc6_residency.c index 34b0b406..bb5d2110 100644 --- a/tests/sysfs_rc6_residency.c +++ b/tests/sysfs_rc6_residency.c @@ -111,13 +111,13 @@ int main(int argc, char *argv[]) if (diff > (SLEEP_DURATION + RC6_FUDGE)) { fprintf(stderr, "Diff was too high. That is unpossible\n"); - exit(EXIT_FAILURE); + igt_fail(1); } if (diff < (SLEEP_DURATION - RC6_FUDGE)) { fprintf(stderr, "GPU was not in RC6 long enough. Check that " "the GPU is as idle as possible (ie. no X, " "running and running no other tests)\n"); - exit(EXIT_FAILURE); + igt_fail(1); } exit(EXIT_SUCCESS);