summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorThomas Wood <thomas.wood@intel.com>2015-11-10 14:16:00 +0000
committerThomas Wood <thomas.wood@intel.com>2015-11-11 14:52:44 +0000
commit3dce57a699e1481bbe7b2e4c52a7643654e2da19 (patch)
treefa7a92c904ac529b35f32879c7eaac113c53f554 /tests
parenta8f63574307b0914214256a04939799bde2cffb9 (diff)
tests/kms_force_connector: reset connectors and edid on exit
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/kms_force_connector.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/kms_force_connector.c b/tests/kms_force_connector.c
index 997ae881..838a3b0a 100644
--- a/tests/kms_force_connector.c
+++ b/tests/kms_force_connector.c
@@ -31,7 +31,7 @@ IGT_TEST_DESCRIPTION("Check the debugfs force connector/edid features work"
igt_assert_eq(m.hdisplay, h); igt_assert_eq(m.vdisplay, w); \
igt_assert_eq(m.vrefresh, r);
-static void __attribute__((noreturn)) reset_connectors(void)
+static void reset_connectors(void)
{
int drm_fd = 0;
drmModeRes *res;
@@ -51,8 +51,6 @@ static void __attribute__((noreturn)) reset_connectors(void)
drmModeFreeConnector(connector);
}
-
- exit(0);
}
static int opt_handler(int opt, int opt_index, void *data)
@@ -60,6 +58,7 @@ static int opt_handler(int opt, int opt_index, void *data)
switch (opt) {
case 'r':
reset_connectors();
+ exit(0);
break;
}
@@ -172,6 +171,9 @@ int main(int argc, char **argv)
igt_fixture {
drmModeFreeConnector(vga_connector);
+ close(drm_fd);
+
+ reset_connectors();
}
igt_exit();