summaryrefslogtreecommitdiff
path: root/tests/gem_partial_pwrite_pread.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-09-25 14:36:59 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-09-25 14:37:07 +0200
commitf3c54d0cb4744af9d58b5be45f574b625bbc8231 (patch)
tree9c4bd1af155ee0b1b51382a617109aa2e5f119b2 /tests/gem_partial_pwrite_pread.c
parent88ad6d7be8ab5741b7019a535952145c96577c9c (diff)
tests: use igt_assert/igt_require more
With the new _f variants we can replace almost all of them. Also remove a ton of checks for argc != 1, they're a bit useless ... Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests/gem_partial_pwrite_pread.c')
-rw-r--r--tests/gem_partial_pwrite_pread.c64
1 files changed, 24 insertions, 40 deletions
diff --git a/tests/gem_partial_pwrite_pread.c b/tests/gem_partial_pwrite_pread.c
index 61739c41..af772438 100644
--- a/tests/gem_partial_pwrite_pread.c
+++ b/tests/gem_partial_pwrite_pread.c
@@ -120,11 +120,9 @@ static void test_partial_reads(void)
drm_intel_bo_get_subdata(scratch_bo, start, len, tmp);
for (j = 0; j < len; j++) {
- if (tmp[j] != val) {
- printf("mismatch at %i, got: %i, expected: %i\n",
- j, tmp[j], val);
- igt_fail(1);
- }
+ igt_assert_f(tmp[j] == val,
+ "mismatch at %i, got: %i, expected: %i\n",
+ j, tmp[j], val);
}
igt_progress("partial reads test: ", i, ROUNDS);
@@ -156,25 +154,19 @@ static void test_partial_writes(void)
gtt_ptr = staging_bo->virtual;
for (j = 0; j < start; j++) {
- if (gtt_ptr[j] != val) {
- printf("mismatch at %i, got: %i, expected: %i\n",
- j, tmp[j], val);
- igt_fail(1);
- }
+ igt_assert_f(gtt_ptr[j] == val,
+ "mismatch at %i, got: %i, expected: %i\n",
+ j, tmp[j], val);
}
for (; j < start + len; j++) {
- if (gtt_ptr[j] != tmp[0]) {
- printf("mismatch at %i, got: %i, expected: %i\n",
- j, tmp[j], i);
- igt_fail(1);
- }
+ igt_assert_f(gtt_ptr[j] == tmp[0],
+ "mismatch at %i, got: %i, expected: %i\n",
+ j, tmp[j], i);
}
for (; j < BO_SIZE; j++) {
- if (gtt_ptr[j] != val) {
- printf("mismatch at %i, got: %i, expected: %i\n",
- j, tmp[j], val);
- igt_fail(1);
- }
+ igt_assert_f(gtt_ptr[j] == val,
+ "mismatch at %i, got: %i, expected: %i\n",
+ j, tmp[j], val);
}
drm_intel_gem_bo_unmap_gtt(staging_bo);
@@ -201,11 +193,9 @@ static void test_partial_read_writes(void)
drm_intel_bo_get_subdata(scratch_bo, start, len, tmp);
for (j = 0; j < len; j++) {
- if (tmp[j] != val) {
- printf("mismatch in read at %i, got: %i, expected: %i\n",
- j, tmp[j], val);
- igt_fail(1);
- }
+ igt_assert_f(tmp[j] == val,
+ "mismatch in read at %i, got: %i, expected: %i\n",
+ j, tmp[j], val);
}
/* Change contents through gtt to make the pread cachelines
@@ -226,25 +216,19 @@ static void test_partial_read_writes(void)
gtt_ptr = staging_bo->virtual;
for (j = 0; j < start; j++) {
- if (gtt_ptr[j] != val) {
- printf("mismatch at %i, got: %i, expected: %i\n",
- j, tmp[j], val);
- igt_fail(1);
- }
+ igt_assert_f(gtt_ptr[j] == val,
+ "mismatch at %i, got: %i, expected: %i\n",
+ j, tmp[j], val);
}
for (; j < start + len; j++) {
- if (gtt_ptr[j] != tmp[0]) {
- printf("mismatch at %i, got: %i, expected: %i\n",
- j, tmp[j], tmp[0]);
- igt_fail(1);
- }
+ igt_assert_f(gtt_ptr[j] == tmp[0],
+ "mismatch at %i, got: %i, expected: %i\n",
+ j, tmp[j], tmp[0]);
}
for (; j < BO_SIZE; j++) {
- if (gtt_ptr[j] != val) {
- printf("mismatch at %i, got: %i, expected: %i\n",
- j, tmp[j], val);
- igt_fail(1);
- }
+ igt_assert_f(gtt_ptr[j] == val,
+ "mismatch at %i, got: %i, expected: %i\n",
+ j, tmp[j], val);
}
drm_intel_gem_bo_unmap_gtt(staging_bo);