summaryrefslogtreecommitdiff
path: root/tests/eviction_common.c
diff options
context:
space:
mode:
authorMatt Roper <matthew.d.roper@intel.com>2015-03-05 15:01:00 -0800
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-03-06 18:06:10 +0100
commit07be8fec156ba8405f2aafa3a37fe29d06893f05 (patch)
tree0591bf1aca05c2c8f5f89bb0400d948e8a2d0fe6 /tests/eviction_common.c
parent14a3d88a0967718124fc3b6c111a877203da025f (diff)
igt.cocci: Replace igt_assert() with igt_assert_CMP() where possible
The integer comparison macros give us better error output by including the actual values that failed the comparison. Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'tests/eviction_common.c')
-rw-r--r--tests/eviction_common.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/eviction_common.c b/tests/eviction_common.c
index b18c2a73..82cdaebc 100644
--- a/tests/eviction_common.c
+++ b/tests/eviction_common.c
@@ -89,7 +89,7 @@ static int minor_evictions(int fd, struct igt_eviction_test_ops *ops,
for (n = 0; n < nr_surfaces; n++, m += 7)
sel[n] = bo[m%total_surfaces];
ret = ops->copy(fd, sel[0], sel[1], sel, nr_surfaces);
- igt_assert(ret == 0);
+ igt_assert_eq(ret, 0);
}
ret = ops->copy(fd, bo[0], bo[0], bo, total_surfaces);
igt_assert(ret == ENOSPC);
@@ -120,7 +120,7 @@ static int major_evictions(int fd, struct igt_eviction_test_ops *ops,
for (loop = 0, m = 0; loop < 100; loop++, m += 17) {
n = m % nr_surfaces;
ret = ops->copy(fd, bo[n], bo[n], &bo[n], 1);
- igt_assert(ret == 0);
+ igt_assert_eq(ret, 0);
}
for (n = 0; n < nr_surfaces; n++)
@@ -156,7 +156,7 @@ static int swapping_evictions(int fd, struct igt_eviction_test_ops *ops,
for (pass = 0; pass < 100; pass++) {
ret = ops->copy(fd, bo[0], bo[1], bo, working_surfaces);
- igt_assert(ret == 0);
+ igt_assert_eq(ret, 0);
}
}
@@ -186,7 +186,7 @@ static int forking_evictions(int fd, struct igt_eviction_test_ops *ops,
} else
bo_count = working_surfaces;
- igt_assert(working_surfaces <= bo_count);
+ igt_assert_lte(working_surfaces, bo_count);
intel_require_memory(bo_count, surface_size, CHECK_RAM | CHECK_SWAP);
bo = malloc(bo_count*sizeof(*bo));
@@ -223,7 +223,7 @@ static int forking_evictions(int fd, struct igt_eviction_test_ops *ops,
for (pass = 0; pass < num_passes; pass++) {
ret = ops->copy(realfd, bo[0], bo[1], bo, working_surfaces);
- igt_assert(ret == 0);
+ igt_assert_eq(ret, 0);
for (l = 0; l < working_surfaces &&
(flags & FORKING_EVICTIONS_MEMORY_PRESSURE);