tests: Use igt macros more

Often just folding together of the common if (cond) printf;
abort|igt_skip|igt_fail; pattern. But in a few cases I've ripped out
more since the igt macros will already print the condition and errno.

A few tests where more work (like ripping out return codes en masse)
is needed left as-is.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
Daniel Vetter
2014-05-14 09:56:53 +02:00
parent e624fa8a2e
commit 0b7ce4ac29
30 changed files with 131 additions and 288 deletions
+5 -10
View File
@@ -317,12 +317,10 @@ check_bo(int fd, uint32_t handle, uint32_t val)
gem_read(fd, handle, 0, linear, sizeof(linear));
for (i = 0; i < WIDTH*HEIGHT; i++) {
if (linear[i] != val) {
fprintf(stderr, "Expected 0x%08x, found 0x%08x "
"at offset 0x%08x\n",
val, linear[i], i * 4);
abort();
}
igt_assert_f(linear[i] == val,
"Expected 0x%08x, found 0x%08x "
"at offset 0x%08x\n",
val, linear[i], i * 4);
val++;
}
}
@@ -337,10 +335,7 @@ int main(int argc, char **argv)
fd = drm_open_any();
if (!IS_GEN3(intel_get_drm_devid(fd))) {
printf("gen3-only test, doing nothing\n");
return 77;
}
igt_require(IS_GEN3(intel_get_drm_devid(fd)));
count = 0;
if (argc > 1)