From patchwork Mon Nov 2 11:48:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Wood X-Patchwork-Id: 7535851 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 75C5F9F399 for ; Mon, 2 Nov 2015 11:59:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9880620591 for ; Mon, 2 Nov 2015 11:59:31 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id BA8CD205BE for ; Mon, 2 Nov 2015 11:59:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CB8136E523; Mon, 2 Nov 2015 03:59:29 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id F0E6B6E523 for ; Mon, 2 Nov 2015 03:59:27 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP; 02 Nov 2015 03:59:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,234,1444719600"; d="scan'208";a="840558493" Received: from otc-vmt1.isw.intel.com ([10.237.224.80]) by orsmga002.jf.intel.com with ESMTP; 02 Nov 2015 03:59:03 -0800 From: Thomas Wood To: intel-gfx@lists.freedesktop.org Date: Mon, 2 Nov 2015 11:48:37 +0000 Message-Id: <1446464924-20878-1-git-send-email-thomas.wood@intel.com> X-Mailer: git-send-email 1.9.1 Organization: Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ Subject: [Intel-gfx] [PATCH i-g-t 1/8] kms_force_connector: use comparison macros to make debug output clearer X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Thomas Wood --- tests/kms_force_connector.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tests/kms_force_connector.c b/tests/kms_force_connector.c index 7485ca8..4ba1e0b 100644 --- a/tests/kms_force_connector.c +++ b/tests/kms_force_connector.c @@ -27,8 +27,9 @@ IGT_TEST_DESCRIPTION("Check the debugfs force connector/edid features work" " correctly."); -#define CHECK_MODE(m, h, w, r) igt_assert(m.hdisplay == h && m.vdisplay == w \ - && m.vrefresh == r) +#define CHECK_MODE(m, h, w, r) \ + igt_assert_eq(m.hdisplay, h); igt_assert_eq(m.vdisplay, w); \ + igt_assert_eq(m.vrefresh, r); igt_main { @@ -63,8 +64,8 @@ igt_main /* force the connector on and check the reported values */ kmstest_force_connector(drm_fd, vga_connector, FORCE_CONNECTOR_ON); temp = drmModeGetConnector(drm_fd, vga_connector->connector_id); - igt_assert(temp->connection == DRM_MODE_CONNECTED); - igt_assert(temp->count_modes > 0); + igt_assert_eq(temp->connection, DRM_MODE_CONNECTED); + igt_assert_lt(0, temp->count_modes); drmModeFreeConnector(temp); /* attempt to use the display */ @@ -77,15 +78,15 @@ igt_main kmstest_force_connector(drm_fd, vga_connector, FORCE_CONNECTOR_OFF); temp = drmModeGetConnector(drm_fd, vga_connector->connector_id); - igt_assert(temp->connection == DRM_MODE_DISCONNECTED); - igt_assert(temp->count_modes == 0); + igt_assert_eq(temp->connection, DRM_MODE_DISCONNECTED); + igt_assert_lt(0, temp->count_modes); drmModeFreeConnector(temp); /* check that the previous state is restored */ kmstest_force_connector(drm_fd, vga_connector, FORCE_CONNECTOR_UNSPECIFIED); temp = drmModeGetConnector(drm_fd, vga_connector->connector_id); - igt_assert(temp->connection == vga_connector->connection); + igt_assert_eq(temp->connection, vga_connector->connection); drmModeFreeConnector(temp); } @@ -115,7 +116,7 @@ igt_main temp = drmModeGetConnector(drm_fd, vga_connector->connector_id); /* the connector should now have the same number of modes that * it started with */ - igt_assert(temp->count_modes == start_n_modes); + igt_assert_eq(temp->count_modes, start_n_modes); drmModeFreeConnector(temp); kmstest_force_connector(drm_fd, vga_connector,