diff options
author | Matt Roper <matthew.d.roper@intel.com> | 2015-03-05 15:01:00 -0800 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-03-06 18:06:10 +0100 |
commit | 07be8fec156ba8405f2aafa3a37fe29d06893f05 (patch) | |
tree | 0591bf1aca05c2c8f5f89bb0400d948e8a2d0fe6 /tests/prime_self_import.c | |
parent | 14a3d88a0967718124fc3b6c111a877203da025f (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/prime_self_import.c')
-rw-r--r-- | tests/prime_self_import.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/prime_self_import.c b/tests/prime_self_import.c index ded92cfc..20eb1150 100644 --- a/tests/prime_self_import.c +++ b/tests/prime_self_import.c @@ -162,7 +162,7 @@ static void test_with_one_bo_two_files(void) handle_import = prime_fd_to_handle(fd2, dma_buf_fd2); /* dma-buf selfimporting an flink bo should give the same handle */ - igt_assert(handle_import == handle_open); + igt_assert_eq_u32(handle_import, handle_open); close(fd1); close(fd2); @@ -189,11 +189,11 @@ static void test_with_one_bo(void) /* reimport should give us the same handle so that userspace can check * whether it has that bo already somewhere. */ handle_import2 = prime_fd_to_handle(fd2, dma_buf_fd); - igt_assert(handle_import1 == handle_import2); + igt_assert_eq_u32(handle_import1, handle_import2); /* Same for re-importing on the exporting fd. */ handle_selfimport = prime_fd_to_handle(fd1, dma_buf_fd); - igt_assert(handle == handle_selfimport); + igt_assert_eq_u32(handle, handle_selfimport); /* close dma_buf, check whether nothing disappears. */ close(dma_buf_fd); @@ -225,7 +225,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; } @@ -278,7 +278,7 @@ static void test_reimport_close_race(void) r = pthread_create(&threads[i], NULL, thread_fn_reimport_vs_close, (void *)(uintptr_t)fds); - igt_assert(r == 0); + igt_assert_eq(r, 0); } sleep(5); @@ -360,7 +360,7 @@ static void test_export_close_race(void) r = pthread_create(&threads[i], NULL, thread_fn_export_vs_close, (void *)(uintptr_t)fd); - igt_assert(r == 0); + igt_assert_eq(r, 0); } sleep(5); |