Commit 07be8fec authored by Matt Roper's avatar Matt Roper Committed by Daniel Vetter

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's avatarMatt Roper <matthew.d.roper@intel.com>
Signed-off-by: Daniel Vetter's avatarDaniel Vetter <daniel.vetter@intel.com>
parent 14a3d88a
......@@ -141,3 +141,35 @@ a = drm_open_any();
- return ...;
- }
)
// Use comparison macros instead of raw igt_assert when possible
@@
typedef uint32_t;
uint32_t E1, E2;
int E3, E4;
@@
(
- igt_assert(E1 == E2);
+ igt_assert_eq_u32(E1, E2);
|
- igt_assert(E1 != E2);
+ igt_assert_neq_u32(E1, E2);
|
- igt_assert(E1 <= E2);
+ igt_assert_lte_u32(E1, E2);
|
- igt_assert(E1 < E2);
+ igt_assert_lt_u32(E1, E2);
|
- igt_assert(E3 == E4);
+ igt_assert_eq(E3, E4);
|
- igt_assert(E3 != E4);
+ igt_assert_neq(E3, E4);
|
- igt_assert(E3 <= E4);
+ igt_assert_lte(E3, E4);
|
- igt_assert(E3 < E4);
+ igt_assert_lt(E3, E4);
)
......@@ -79,14 +79,15 @@ static void test_sysfs_error_exists(void)
{
char tmp[1024];
igt_assert(read_sysfs(tmp, sizeof(tmp), "error") > 0);
igt_assert_lt(0, read_sysfs(tmp, sizeof(tmp), "error"));
}
static void test_debugfs_error_state_exists(void)
{
int fd;
igt_assert((fd = igt_debugfs_open("i915_error_state", O_RDONLY)) >= 0);
igt_assert_lte(0,
(fd = igt_debugfs_open("i915_error_state", O_RDONLY)));
close (fd);
}
......@@ -95,7 +96,7 @@ static void test_debugfs_ring_stop_exists(void)
{
int fd;
igt_assert((fd = igt_debugfs_open("i915_ring_stop", O_RDONLY)) >= 0);
igt_assert_lte(0, (fd = igt_debugfs_open("i915_ring_stop", O_RDONLY)));
close(fd);
}
......@@ -105,10 +106,10 @@ static void read_dfs(const char *fname, char *d, int maxlen)
int fd;
int l;
igt_assert((fd = igt_debugfs_open(fname, O_RDONLY)) >= 0);
igt_assert_lte(0, (fd = igt_debugfs_open(fname, O_RDONLY)));
igt_assert((l = read(fd, d, maxlen-1)) > 0);
igt_assert(l < maxlen);
igt_assert_lt(0, (l = read(fd, d, maxlen - 1)));
igt_assert_lt(l, maxlen);
d[l] = 0;
close(fd);
......@@ -210,7 +211,8 @@ static void clear_error_state(void)
int fd;
const char *b = "1";
igt_assert((fd = igt_debugfs_open("i915_error_state", O_WRONLY)) >= 0);
igt_assert_lte(0,
(fd = igt_debugfs_open("i915_error_state", O_WRONLY)));
igt_assert(write(fd, b, 1) == 1);
close(fd);
}
......@@ -244,7 +246,7 @@ static void check_error_state(const int gen,
bool bb_ok = false, req_ok = false, ringbuf_ok = false;
debug_fd = igt_debugfs_open("i915_error_state", O_RDONLY);
igt_assert(debug_fd >= 0);
igt_assert_lte(0, debug_fd);
file = fdopen(debug_fd, "r");
while (getline(&line, &line_size, file) > 0) {
......@@ -287,7 +289,7 @@ static void check_error_state(const int gen,
req_matched = sscanf(dashes, "--- %d requests\n", &requests);
if (req_matched == 1) {
igt_assert(strstr(ring_name, expected_ring_name));
igt_assert(requests > 0);
igt_assert_lt(0, requests);
for (i = 0; i < requests; i++) {
uint32_t seqno;
......@@ -296,7 +298,7 @@ static void check_error_state(const int gen,
igt_assert(getline(&line, &line_size, file) > 0);
items = sscanf(line, " seqno 0x%08x, emitted %ld, tail 0x%08x\n",
&seqno, &jiffies, &tail);
igt_assert(items == 3);
igt_assert_eq(items, 3);
}
req_ok = true;
continue;
......@@ -315,12 +317,12 @@ static void check_error_state(const int gen,
igt_assert(getline(&line, &line_size, file) > 0);
items = sscanf(line, "%08x : %08x\n",
&offset, &command);
igt_assert(items == 2);
igt_assert_eq(items, 2);
if ((command & 0x1F800000) == MI_BATCH_BUFFER_START) {
igt_assert(getline(&line, &line_size, file) > 0);
items = sscanf(line, "%08x : %08x\n",
&offset, &expected_addr);
igt_assert(items == 2);
igt_assert_eq(items, 2);
i++;
}
}
......
......@@ -165,7 +165,7 @@ test_forcewake(bool hibernate)
int fw_fd;
fw_fd = igt_open_forcewake_handle();
igt_assert(fw_fd >= 0);
igt_assert_lte(0, fw_fd);
if (hibernate)
igt_system_hibernate_autoresume();
......
......@@ -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);
......
......@@ -140,7 +140,7 @@ static void run(int child)
int fd;
fd = open(device, O_RDWR);
igt_assert(fd != -1);
igt_assert_neq(fd, -1);
handle = load(fd);
if ((child & 63) == 63)
......
......@@ -90,7 +90,7 @@ static void exec(int fd, uint32_t handle)
DRM_IOCTL_I915_GEM_EXECBUFFER2,
&execbuf);
gem_sync(fd, handle);
igt_assert(ret == 0);
igt_assert_eq(ret, 0);
}
igt_simple_main
......
......@@ -130,7 +130,8 @@ static void run_on_ring(int fd, unsigned ring_id, const char *ring_name)
gem_close(fd, handle);
}
igt_assert(exec(fd, handle_new, split, &gtt_offset_new, 0) == 0);
igt_assert_eq(exec(fd, handle_new, split, &gtt_offset_new, 0),
0);
if (split > 0) {
/* Check that we've managed to collide in the tlb. */
......
......@@ -85,7 +85,7 @@ static void *work(void *arg)
else
td_fd = fd;
igt_assert(td_fd >= 0);
igt_assert_lte(0, td_fd);
bufmgr = drm_intel_bufmgr_gem_init(td_fd, 4096);
batch = intel_batchbuffer_alloc(bufmgr, devid);
......@@ -105,7 +105,7 @@ static void *work(void *arg)
} else {
int ret;
ret = drm_intel_bo_subdata(batch->bo, 0, 4096, batch->buffer);
igt_assert(ret == 0);
igt_assert_eq(ret, 0);
intel_batchbuffer_flush_with_context(batch, context);
}
}
......
......@@ -127,7 +127,7 @@ copy(int fd, uint32_t dst, uint32_t src, uint32_t *all_bo, int n_bo, int alignme
ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec);
if (ret)
ret = errno;
igt_assert(ret == error);
igt_assert_eq(ret, error);
gem_close(fd, handle);
free(obj);
......
......@@ -75,7 +75,7 @@ run_batch(void)
used = batch->ptr - batch->buffer;
ret = drm_intel_bo_subdata(batch->bo, 0, used, batch->buffer);
igt_assert(ret == 0);
igt_assert_eq(ret, 0);
batch->ptr = NULL;
......
......@@ -60,7 +60,7 @@ static int gem_linear_blt(int fd,
uint32_t *b = batch;
int height = length / (16 * 1024);
igt_assert(height <= 1<<16);
igt_assert_lte(height, 1 << 16);
if (height) {
int i = 0;
......@@ -180,7 +180,7 @@ static uint32_t dumb_create(int fd)
arg.height = 32;
ret = drmIoctl(fd, DRM_IOCTL_MODE_CREATE_DUMB, &arg);
igt_assert(ret == 0);
igt_assert_eq(ret, 0);
igt_assert(arg.size >= 4096);
return arg.handle;
......
......@@ -70,7 +70,7 @@ static int gem_linear_blt(uint32_t *batch,
uint32_t *b = batch;
int height = length / (16 * 1024);
igt_assert(height <= 1<<16);
igt_assert_lte(height, 1 << 16);
if (height) {
int i = 0;
......
......@@ -97,7 +97,7 @@ static void loop(int fd, uint32_t handle, unsigned ring_id, const char *ring_nam
struct timeval start, end;
gettimeofday(&start, NULL);
igt_assert(exec(fd, handle, count, ring_id) == 0);
igt_assert_eq(exec(fd, handle, count, ring_id), 0);
gettimeofday(&end, NULL);
igt_info("Time to exec x %d: %7.3fµs (ring=%s)\n",
count, elapsed(&start, &end, count), ring_name);
......
......@@ -114,7 +114,7 @@ _bo_write_verify(struct test *t)
const char *tile_str[] = { "none", "x", "y" };
igt_assert(t->tiling >= 0 && t->tiling <= I915_TILING_Y);
igt_assert(t->num_surfaces > 0);
igt_assert_lt(0, t->num_surfaces);
s = calloc(sizeof(*s), t->num_surfaces);
igt_assert(s);
......@@ -171,7 +171,7 @@ static int run_test(int threads_per_fence, void *f, int tiling,
t.num_surfaces = surfaces_per_thread;
num_fences = gem_available_fences(t.fd);
igt_assert(num_fences > 0);
igt_assert_lt(0, num_fences);
num_threads = threads_per_fence * num_fences;
......
......@@ -50,15 +50,15 @@ test_flink(int fd)
memset(&create, 0, sizeof(create));
create.size = 16 * 1024;
ret = ioctl(fd, DRM_IOCTL_I915_GEM_CREATE, &create);
igt_assert(ret == 0);
igt_assert_eq(ret, 0);
flink.handle = create.handle;
ret = ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink);
igt_assert(ret == 0);
igt_assert_eq(ret, 0);
open_struct.name = flink.name;
ret = ioctl(fd, DRM_IOCTL_GEM_OPEN, &open_struct);
igt_assert(ret == 0);
igt_assert_eq(ret, 0);
igt_assert(open_struct.handle != 0);
}
......@@ -75,15 +75,15 @@ test_double_flink(int fd)
memset(&create, 0, sizeof(create));
create.size = 16 * 1024;
ret = ioctl(fd, DRM_IOCTL_I915_GEM_CREATE, &create);
igt_assert(ret == 0);
igt_assert_eq(ret, 0);
flink.handle = create.handle;
ret = ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink);
igt_assert(ret == 0);
igt_assert_eq(ret, 0);
flink2.handle = create.handle;
ret = ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink2);
igt_assert(ret == 0);
igt_assert_eq(ret, 0);
igt_assert(flink2.name == flink.name);
}
......@@ -129,15 +129,15 @@ test_flink_lifetime(int fd)
memset(&create, 0, sizeof(create));
create.size = 16 * 1024;
ret = ioctl(fd2, DRM_IOCTL_I915_GEM_CREATE, &create);
igt_assert(ret == 0);
igt_assert_eq(ret, 0);
flink.handle = create.handle;
ret = ioctl(fd2, DRM_IOCTL_GEM_FLINK, &flink);
igt_assert(ret == 0);
igt_assert_eq(ret, 0);
open_struct.name = flink.name;
ret = ioctl(fd, DRM_IOCTL_GEM_OPEN, &open_struct);
igt_assert(ret == 0);
igt_assert_eq(ret, 0);
igt_assert(open_struct.handle != 0);
close(fd2);
......@@ -145,7 +145,7 @@ test_flink_lifetime(int fd)
open_struct.name = flink.name;
ret = ioctl(fd2, DRM_IOCTL_GEM_OPEN, &open_struct);
igt_assert(ret == 0);
igt_assert_eq(ret, 0);
igt_assert(open_struct.handle != 0);
}
......
......@@ -61,7 +61,7 @@ static int get_object_count(void)
file = igt_debugfs_fopen("i915_gem_objects", "r");
scanned = fscanf(file, "%i objects", &ret);
igt_assert(scanned == 1);
igt_assert_eq(scanned, 1);
return ret;
}
......@@ -107,7 +107,7 @@ static void test_flink_name(void)
for (i = 0; i < num_threads; i++) {
r = pthread_create(&threads[i], NULL,
thread_fn_flink_name, NULL);
igt_assert(r == 0);
igt_assert_eq(r, 0);
}
for (i = 0; i < 1000000; i++) {
......@@ -176,7 +176,7 @@ static void test_flink_close(void)
for (i = 0; i < num_threads; i++) {
r = pthread_create(&threads[i], NULL,
thread_fn_flink_close, NULL);
igt_assert(r == 0);
igt_assert_eq(r, 0);
}
sleep(5);
......@@ -196,7 +196,7 @@ static void test_flink_close(void)
close(fake);
igt_assert(obj_count == 0);
igt_assert_eq(obj_count, 0);
}
igt_main
......
......@@ -149,7 +149,7 @@ static void run(data_t *data, int child)
x = ptr[rand() % (size / 4)];
munmap(ptr, size);
igt_assert(x == canary);
igt_assert_eq_u32(x, canary);
}
igt_simple_main
......
......@@ -153,7 +153,7 @@ copy(int fd, uint32_t dst, uint32_t src)
drmCommandNone(fd, DRM_I915_GEM_THROTTLE);
ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec);
}
igt_assert(ret == 0);
igt_assert_eq(ret, 0);
gem_close(fd, handle);
}
......
......@@ -105,7 +105,7 @@ static drm_intel_bo *create_special_bo(void)
BATCH(CMD_POLY_STIPPLE_OFFSET << 16);
BATCH(0);
}
igt_assert(len % 2 == 0);
igt_assert_eq(len % 2, 0);
BATCH(MI_NOOP);
BATCH(MI_BATCH_BUFFER_END);
......
......@@ -100,7 +100,7 @@ static void create_special_bo(void)
BATCH(CMD_POLY_STIPPLE_OFFSET << 16);
BATCH(0);
}
igt_assert(len % 2 == 0);
igt_assert_eq(len % 2, 0);
BATCH(MI_NOOP);
BATCH(MI_BATCH_BUFFER_END);
......
......@@ -243,7 +243,7 @@ static int inject_hang_ring(int fd, int ctx, int ring, bool ignore_ban_error)
i915_execbuffer2_set_context_id(execbuf, ctx);
execbuf.rsvd2 = 0;
igt_assert(gem_exec(fd, &execbuf) == 0);
igt_assert_eq(gem_exec(fd, &execbuf), 0);
gtt_off = exec.offset;
......@@ -284,7 +284,7 @@ static int inject_hang_ring(int fd, int ctx, int ring, bool ignore_ban_error)
i915_execbuffer2_set_context_id(execbuf, ctx);
execbuf.rsvd2 = 0;
igt_assert(gem_exec(fd, &execbuf) == 0);
igt_assert_eq(gem_exec(fd, &execbuf), 0);
igt_assert(gtt_off == exec.offset);
......@@ -342,8 +342,8 @@ static void test_rs(int num_fds, int hang_index, int rs_assumed_no_hang)
int fd[MAX_FD];
int h[MAX_FD];
igt_assert (num_fds <= MAX_FD);
igt_assert (hang_index < MAX_FD);
igt_assert_lte(num_fds, MAX_FD);
igt_assert_lt(hang_index, MAX_FD);
for (i = 0; i < num_fds; i++) {
fd[i] = drm_open_any();
......@@ -391,11 +391,11 @@ static void test_rs_ctx(int num_fds, int num_ctx, int hang_index,
int h[MAX_FD][MAX_CTX];
int ctx[MAX_FD][MAX_CTX];
igt_assert (num_fds <= MAX_FD);
igt_assert (hang_index < MAX_FD);
igt_assert_lte(num_fds, MAX_FD);
igt_assert_lt(hang_index, MAX_FD);
igt_assert (num_ctx <= MAX_CTX);
igt_assert (hang_context < MAX_CTX);
igt_assert_lte(num_ctx, MAX_CTX);
igt_assert_lt(hang_context, MAX_CTX);
test_rs(num_fds, -1, RS_NO_ERROR);
......@@ -482,15 +482,15 @@ static void test_ban(void)
assert_reset_status(fd_good, 0, RS_NO_ERROR);
h1 = exec_valid(fd_bad, 0);
igt_assert(h1 >= 0);
igt_assert_lte(0, h1);
h5 = exec_valid(fd_good, 0);
igt_assert(h5 >= 0);
igt_assert_lte(0, h5);
assert_reset_status(fd_bad, 0, RS_NO_ERROR);
assert_reset_status(fd_good, 0, RS_NO_ERROR);
h2 = inject_hang_no_ban_error(fd_bad, 0);
igt_assert(h2 >= 0);
igt_assert_lte(0, h2);
active_count++;
/* Second hang will be pending for this */
pending_count++;
......@@ -500,7 +500,7 @@ static void test_ban(void)
while (retry--) {
h3 = inject_hang_no_ban_error(fd_bad, 0);
igt_assert(h3 >= 0);
igt_assert_lte(0, h3);
gem_sync(fd_bad, h3);
active_count++;
/* This second hand will count as pending */
......@@ -515,21 +515,21 @@ static void test_ban(void)
/* Should not happen often but sometimes hang is declared too slow
* due to our way of faking hang using loop */
igt_assert(h4 >= 0);
igt_assert_lte(0, h4);
gem_close(fd_bad, h3);
gem_close(fd_bad, h4);
igt_info("retrying for ban (%d)\n", retry);
}
igt_assert(h4 == -EIO);
igt_assert_eq(h4, -EIO);
assert_reset_status(fd_bad, 0, RS_BATCH_ACTIVE);
gem_sync(fd_good, h7);
assert_reset_status(fd_good, 0, RS_BATCH_PENDING);
igt_assert(gem_reset_stats(fd_good, 0, &rs_good) == 0);
igt_assert(gem_reset_stats(fd_bad, 0, &rs_bad) == 0);
igt_assert_eq(gem_reset_stats(fd_good, 0, &rs_good), 0);
igt_assert_eq(gem_reset_stats(fd_bad, 0, &rs_bad), 0);
igt_assert(rs_bad.batch_active == active_count);
igt_assert(rs_bad.batch_pending == pending_count);
......@@ -542,14 +542,14 @@ static void test_ban(void)
gem_close(fd_good, h7);
h1 = exec_valid(fd_good, 0);
igt_assert(h1 >= 0);
igt_assert_lte(0, h1);
gem_close(fd_good, h1);
close(fd_bad);
close(fd_good);
igt_assert(gem_reset_status(fd_bad, 0) < 0);
igt_assert(gem_reset_status(fd_good, 0) < 0);
igt_assert_lt(gem_reset_status(fd_bad, 0), 0);
igt_assert_lt(gem_reset_status(fd_good, 0), 0);
}
static void test_ban_ctx(void)
......@@ -573,15 +573,15 @@ static void test_ban_ctx(void)
assert_reset_status(fd, ctx_bad, RS_NO_ERROR);
h1 = exec_valid(fd, ctx_bad);
igt_assert(h1 >= 0);
igt_assert_lte(0, h1);
h5 = exec_valid(fd, ctx_good);
igt_assert(h5 >= 0);
igt_assert_lte(0, h5);
assert_reset_status(fd, ctx_good, RS_NO_ERROR);
assert_reset_status(fd, ctx_bad, RS_NO_ERROR);
h2 = inject_hang_no_ban_error(fd, ctx_bad);
igt_assert(h2 >= 0);
igt_assert_lte(0, h2);
active_count++;
/* Second hang will be pending for this */
pending_count++;
......@@ -591,7 +591,7 @@ static void test_ban_ctx(void)
while (retry--) {
h3 = inject_hang_no_ban_error(fd, ctx_bad);
igt_assert(h3 >= 0);
igt_assert_lte(0, h3);
gem_sync(fd, h3);
active_count++;
/* This second hand will count as pending */
......@@ -606,21 +606,21 @@ static void test_ban_ctx(void)
/* Should not happen often but sometimes hang is declared too slow
* due to our way of faking hang using loop */
igt_assert(h4 >= 0);
igt_assert_lte(0, h4);
gem_close(fd, h3);
gem_close(fd, h4);
igt_info("retrying for ban (%d)\n", retry);
}
igt_assert(h4 == -EIO);
igt_assert_eq(h4, -EIO);
assert_reset_status(fd, ctx_bad, RS_BATCH_ACTIVE);
gem_sync(fd, h7);
assert_reset_status(fd, ctx_good, RS_BATCH_PENDING);
igt_assert(gem_reset_stats(fd, ctx_good, &rs_good) == 0);
igt_assert(gem_reset_stats(fd, ctx_bad, &rs_bad) == 0);
igt_assert_eq(gem_reset_stats(fd, ctx_good, &rs_good), 0);
igt_assert_eq(gem_reset_stats(fd, ctx_bad, &rs_bad), 0);
igt_assert(rs_bad.batch_active == active_count);
igt_assert(rs_bad.batch_pending == pending_count);
......@@ -633,15 +633,15 @@ static void test_ban_ctx(void)
gem_close(fd, h7);
h1 = exec_valid(fd, ctx_good);
igt_assert(h1 >= 0);
igt_assert_lte(0, h1);
gem_close(fd, h1);
gem_context_destroy(fd, ctx_good);
gem_context_destroy(fd, ctx_bad);
igt_assert(gem_reset_status(fd, ctx_good) < 0);
igt_assert(gem_reset_status(fd, ctx_bad) < 0);
igt_assert(exec_valid(fd, ctx_good) < 0);
igt_assert(exec_valid(fd, ctx_bad) < 0);
igt_assert_lt(gem_reset_status(fd, ctx_good), 0);
igt_assert_lt(gem_reset_status(fd, ctx_bad), 0);
igt_assert_lt(exec_valid(fd, ctx_good), 0);
igt_assert_lt(exec_valid(fd, ctx_bad), 0);
close(fd);
}
......@@ -663,13 +663,13 @@ static void test_unrelated_ctx(void)
assert_reset_status(fd2, ctx_unrelated, RS_NO_ERROR);
h1 = inject_hang(fd1, ctx_guilty);
igt_assert(h1 >= 0);
igt_assert_lte(0, h1);
gem_sync(fd1, h1);
assert_reset_status(fd1, ctx_guilty, RS_BATCH_ACTIVE);
assert_reset_status(fd2, ctx_unrelated, RS_NO_ERROR);
h2 = exec_valid(fd2, ctx_unrelated);
igt_assert(h2 >= 0);
igt_assert_lte(0, h2);
gem_sync(fd2, h2);
assert_reset_status(fd1, ctx_guilty, RS_BATCH_ACTIVE);
assert_reset_status(fd2, ctx_unrelated, RS_NO_ERROR);
......@@ -706,7 +706,7 @@ static void test_close_pending_ctx(void)
assert_reset_status(fd, ctx, RS_NO_ERROR);
h = inject_hang(fd, ctx);
igt_assert(h >= 0);
igt_assert_lte(0, h);
gem_context_destroy(fd, ctx);
igt_assert(__gem_context_destroy(fd, ctx) == -ENOENT);
......@@ -723,7 +723,7 @@ static void test_close_pending(void)
assert_reset_status(fd, 0, RS_NO_ERROR);
h = inject_hang(fd, 0);
igt_assert(h >= 0);
igt_assert_lte(0, h);
gem_close(fd, h);
close(fd);
......@@ -785,7 +785,7 @@ static void test_close_pending_fork(const bool reverse)
assert_reset_status(fd, 0, RS_NO_ERROR);
h = inject_hang(fd, 0);
igt_assert(h >= 0);
igt_assert_lte(0, h);
sleep(1);
......@@ -796,7 +796,7 @@ static void test_close_pending_fork(const bool reverse)
pid = fork();
if (pid == 0) {
const int fd2 = drm_open_any();
igt_assert(fd2 >= 0);
igt_assert_lte(0, fd2);
/* The crucial component is that we schedule the same noop batch
* on each ring. This exercises batch_obj reference counting,
......@@ -807,7 +807,7 @@ static void test_close_pending_fork(const bool reverse)
close(fd2);
return;
} else {
igt_assert(pid > 0);
igt_assert_lt(0, pid);
sleep(1);
/* Kill the child to reduce refcounts on
......@@ -822,7 +822,7 @@ static void test_close_pending_fork(const bool reverse)
fd = drm_open_any();
h = exec_valid(fd, 0);
igt_assert(h >= 0);
igt_assert_lte(0, h);
gem_sync(fd, h);
gem_close(fd, h);
......@@ -846,7 +846,7 @@ static void test_reset_count(const bool create_ctx)
igt_assert(c1 >= 0);
h = inject_hang(fd, ctx);
igt_assert (h >= 0);
igt_assert_lte(0, h);