From: Thomas Wood Subject: [PATCH i-g-t] tests/kms_force_connector: fix assertion when VGA is already connected Date: Thu, 16 Oct 2014 10:47:31 +0100 Message-ID: <1413452851-31238-1-git-send-email-thomas.wood@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) by gabe.freedesktop.org (Postfix) with ESMTP id 93B676E193 for ; Thu, 16 Oct 2014 02:47:35 -0700 (PDT) Received: by mail-wi0-f171.google.com with SMTP id em10so975284wid.10 for ; Thu, 16 Oct 2014 02:47:34 -0700 (PDT) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org Compare the number of modes available when the edid is reset with the number before the edid was overridden. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82230 Signed-off-by: Thomas Wood --- tests/kms_force_connector.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/kms_force_connector.c b/tests/kms_force_connector.c index a6c4ce3..34c33b0 100644 --- a/tests/kms_force_connector.c +++ b/tests/kms_force_connector.c @@ -35,6 +35,7 @@ main (int argc, char **argv) drmModeRes *res; drmModeConnector *vga_connector, *temp; igt_display_t display; + int start_n_modes; igt_simple_init(argc, argv); @@ -61,6 +62,7 @@ main (int argc, char **argv) temp = drmModeGetConnector(drm_fd, vga_connector->connector_id); igt_assert(temp->connection == DRM_MODE_CONNECTED); igt_assert(temp->count_modes > 0); + start_n_modes = temp->count_modes; drmModeFreeConnector(temp); /* attempt to use the display */ @@ -96,8 +98,9 @@ main (int argc, char **argv) /* remove edid */ kmstest_force_edid(drm_fd, vga_connector, NULL, 0); temp = drmModeGetConnector(drm_fd, vga_connector->connector_id); - /* the connector should now have the 5 default modes */ - igt_assert(temp->count_modes == 5); + /* the connector should now have the same number of modes that it + * started with */ + igt_assert(temp->count_modes == start_n_modes); drmModeFreeConnector(temp); /* force the connector off */ -- 2.1.0