diff options
author | Lionel Landwerlin <lionel.g.landwerlin@intel.com> | 2016-03-18 17:33:03 +0000 |
---|---|---|
committer | Matt Roper <matthew.d.roper@intel.com> | 2016-03-21 11:47:22 -0700 |
commit | c7e9be2302ab3dea289edc86b8c63e22d668fe2b (patch) | |
tree | 728220717b65a1a01146b411d5487021d5bfc5b6 /lib/igt_debugfs.c | |
parent | a511310244ed82391a45a438b0d7126a8f9c974b (diff) |
lib: add crc comparison function without an assert
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Diffstat (limited to 'lib/igt_debugfs.c')
-rw-r--r-- | lib/igt_debugfs.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c index c291ef3b..a32ed784 100644 --- a/lib/igt_debugfs.c +++ b/lib/igt_debugfs.c @@ -252,6 +252,23 @@ bool igt_debugfs_search(const char *filename, const char *substring) * @a: first pipe CRC value * @b: second pipe CRC value * + * Compares two CRC values. + */ +bool igt_crc_equal(igt_crc_t *a, igt_crc_t *b) +{ + int i; + + for (i = 0; i < a->n_words; i++) + if (a->crc[i] != b->crc[i]) + return false; + return true; +} + +/** + * igt_assert_crc_equal: + * @a: first pipe CRC value + * @b: second pipe CRC value + * * Compares two CRC values and fails the testcase if they don't match with * igt_fail(). Note that due to CRC collisions CRC based testcase can only * assert that CRCs match, never that they are different. Otherwise there might |