[Intel-gfx] [PATCH 2/2] tests/kms_sink_crc_basic: Use igt_assert
Daniel Vetter
daniel.vetter at ffwll.ch
Thu May 22 09:35:23 CEST 2014
Less verbose code makes for clearer test logic.
Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
---
tests/kms_sink_crc_basic.c | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/tests/kms_sink_crc_basic.c b/tests/kms_sink_crc_basic.c
index 4be115c2d51c..087b79db4b36 100644
--- a/tests/kms_sink_crc_basic.c
+++ b/tests/kms_sink_crc_basic.c
@@ -134,28 +134,19 @@ static void basic_sink_crc_check(data_t *data, uint32_t connector_id)
/* get reference crc for black color */
get_crc(ref_crc_black);
- if (strcmp(ref_crc_black, ref_crc_white) == 0) {
- fprintf(stderr, "CRC Black should differ from CRC White\n");
- igt_fail(1);
- }
+ igt_assert(strcmp(ref_crc_black, ref_crc_white) != 0);
/*Go White again*/
connector_set_mode(data, &connector, &connector.config.default_mode, WHITE);
get_crc(crc_check);
- if (strcmp(crc_check, ref_crc_white) != 0) {
- fprintf(stderr, "CRC check for white differ from reference\n");
- igt_fail(1);
- }
+ igt_assert(strcmp(crc_check, ref_crc_white) == 0);
/* Go Black again */
connector_set_mode(data, &connector, &connector.config.default_mode, BLACK);
get_crc(crc_check);
- if (strcmp(crc_check, ref_crc_black) != 0) {
- fprintf(stderr, "CRC check for black differ from reference\n");
- igt_fail(1);
- }
+ igt_assert(strcmp(crc_check, ref_crc_black) == 0);
kmstest_free_connector_config(&connector.config);
}
--
1.8.4.rc3
More information about the Intel-gfx
mailing list