From b883a31796b0a8a9398558f0735440d8b40823bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 26 Jan 2021 16:07:07 +0100 Subject: [PATCH] tests/monitor-unit-tests: Sanity check some monitor info Check that some information about the monitor is the same as the main output they are derived from. Part-of: --- src/backends/meta-output.h | 1 + src/tests/monitor-test-utils.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/backends/meta-output.h b/src/backends/meta-output.h index 91ebe80bd..bed199662 100644 --- a/src/backends/meta-output.h +++ b/src/backends/meta-output.h @@ -164,6 +164,7 @@ int meta_output_get_backlight (MetaOutput *output); void meta_output_add_possible_clone (MetaOutput *output, MetaOutput *possible_clone); +META_EXPORT_TEST const MetaOutputInfo * meta_output_get_info (MetaOutput *output); META_EXPORT_TEST diff --git a/src/tests/monitor-test-utils.c b/src/tests/monitor-test-utils.c index b9771ef1a..705201810 100644 --- a/src/tests/monitor-test-utils.c +++ b/src/tests/monitor-test-utils.c @@ -365,6 +365,8 @@ check_monitor_configuration (MonitorTestCaseExpect *expect) for (l = monitors, i = 0; l; l = l->next, i++) { MetaMonitor *monitor = l->data; + MetaOutput *main_output; + const MetaOutputInfo *main_output_info; GList *outputs; GList *l_output; int j; @@ -400,6 +402,19 @@ check_monitor_configuration (MonitorTestCaseExpect *expect) ==, expect->monitors[i].height_mm); + main_output = meta_monitor_get_main_output (monitor); + main_output_info = meta_output_get_info (main_output); + g_assert_cmpstr (meta_monitor_get_connector (monitor), ==, + main_output_info->name); + g_assert_cmpstr (meta_monitor_get_vendor (monitor), ==, + main_output_info->vendor); + g_assert_cmpstr (meta_monitor_get_product (monitor), ==, + main_output_info->product); + g_assert_cmpstr (meta_monitor_get_serial (monitor), ==, + main_output_info->serial); + g_assert_cmpint (meta_monitor_get_connector_type (monitor), ==, + main_output_info->connector_type); + modes = meta_monitor_get_modes (monitor); g_assert_cmpint (g_list_length (modes), ==,