tests: s/exit(EXIT_FAILURE)/igt_fail(1)/

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
Daniel Vetter 2013-08-13 12:49:46 +02:00
parent 907377da0e
commit a4cb8954b2
5 changed files with 10 additions and 10 deletions

View File

@ -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);
}
}

View File

@ -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);

View File

@ -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, &reg_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 */

View File

@ -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);

View File

@ -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);