mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-20 21:02:59 +00:00
tests: Remove usage of igt_crc_equal and _non_null
Tests should positively check for crc matches, not for mismatches. Enforce this by only exposing and igt_assert function for comparing crcs. For the few tests which didn't just do this as consistency checks but to do functional tests add FIXME comments that some reference crc values are missing. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
This commit is contained in:
+2
-4
@@ -267,11 +267,10 @@ static void test_crc(data_t *data, enum test_mode mode)
|
||||
igt_pipe_crc_start(pipe_crc);
|
||||
igt_pipe_crc_get_crcs(pipe_crc, 1, &crcs);
|
||||
igt_pipe_crc_stop(pipe_crc);
|
||||
igt_assert(!igt_crc_equal(&crcs[0], &data->ref_crc[0]));
|
||||
if (mode == TEST_PAGE_FLIP)
|
||||
igt_assert_crc_equal(&crcs[0], &data->ref_crc[1]);
|
||||
else
|
||||
igt_assert(!igt_crc_equal(&crcs[0], &data->ref_crc[1]));
|
||||
;/* FIXME: missing reference CRCs */
|
||||
free(crcs);
|
||||
|
||||
/*
|
||||
@@ -285,11 +284,10 @@ static void test_crc(data_t *data, enum test_mode mode)
|
||||
igt_pipe_crc_start(pipe_crc);
|
||||
igt_pipe_crc_get_crcs(pipe_crc, 1, &crcs);
|
||||
igt_pipe_crc_stop(pipe_crc);
|
||||
igt_assert(!igt_crc_equal(&crcs[0], &data->ref_crc[0]));
|
||||
if (mode == TEST_PAGE_FLIP)
|
||||
igt_assert_crc_equal(&crcs[0], &data->ref_crc[1]);
|
||||
else
|
||||
igt_assert(!igt_crc_equal(&crcs[0], &data->ref_crc[1]));
|
||||
;/* FIXME: missing reference CRCs */
|
||||
free(crcs);
|
||||
}
|
||||
|
||||
|
||||
@@ -168,18 +168,6 @@ test_read_crc_for_output(data_t *data, int pipe, igt_output_t *output,
|
||||
igt_debug("CRC for this fb: %s\n", crc_str);
|
||||
free(crc_str);
|
||||
|
||||
/*
|
||||
* make sure the CRC of this fb is different from the ones of
|
||||
* previous fbs
|
||||
*/
|
||||
for (j = 0; j < c; j++)
|
||||
igt_assert(!igt_crc_equal(&colors[j].crc,
|
||||
&colors[c].crc));
|
||||
|
||||
/* ensure the CRCs are not all 0s */
|
||||
for (j = 0; j < N_CRCS; j++)
|
||||
igt_assert(!igt_crc_is_null(&crcs[j]));
|
||||
|
||||
/* and ensure that they'are all equal, we haven't changed the fb */
|
||||
for (j = 0; j < (N_CRCS - 1); j++)
|
||||
igt_assert_crc_equal(&crcs[j], &crcs[j + 1]);
|
||||
|
||||
+1
-1
@@ -209,7 +209,7 @@ test_plane_position_with_output(data_t *data,
|
||||
if (flags & TEST_POSITION_FULLY_COVERED)
|
||||
igt_assert_crc_equal(&test.reference_crc, &crc);
|
||||
else
|
||||
igt_assert(!igt_crc_equal(&test.reference_crc, &crc));
|
||||
;/* FIXME: missing reference CRCs */
|
||||
|
||||
igt_assert_crc_equal(&crc, &crc2);
|
||||
|
||||
|
||||
@@ -75,10 +75,6 @@ static void test(data_t *data)
|
||||
igt_plane_set_fb(data->primary, fb);
|
||||
igt_display_commit(display);
|
||||
|
||||
/* sanity check to make sure crc changed */
|
||||
igt_pipe_crc_collect_crc(data->pipe_crc, &crc);
|
||||
igt_assert(!igt_crc_equal(&crc, &data->ref_crc));
|
||||
|
||||
/* flip back the original white buffer */
|
||||
igt_plane_set_fb(data->primary, &data->fb[0]);
|
||||
igt_display_commit(display);
|
||||
|
||||
Reference in New Issue
Block a user