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 /lib/igt.cocci | |
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 'lib/igt.cocci')
-rw-r--r-- | lib/igt.cocci | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/igt.cocci b/lib/igt.cocci index 41a8beb3..7dc398d0 100644 --- a/lib/igt.cocci +++ b/lib/igt.cocci @@ -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); +) |