mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-20 12:52:55 +00:00
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>
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user