[PATCH 2/2] tests/kms_sink_crc_basic: Use igt_assert

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Less verbose code makes for clearer test logic.

Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxx>
---
 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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux