monitor-store-unit-tests: Check the primary and presentation flags

https://bugzilla.gnome.org/show_bug.cgi?id=777732
This commit is contained in:
Jonas Ådahl 2017-01-16 13:07:58 +08:00
parent 449320cd23
commit 9fb8abf840

View File

@ -45,11 +45,14 @@ typedef struct _MonitorTestCaseMonitor
const char *product; const char *product;
const char *serial; const char *serial;
MonitorTestCaseMonitorMode mode; MonitorTestCaseMonitorMode mode;
gboolean is_underscanning;
} MonitorTestCaseMonitor; } MonitorTestCaseMonitor;
typedef struct _MonitorTestCaseLogicalMonitor typedef struct _MonitorTestCaseLogicalMonitor
{ {
MetaRectangle layout; MetaRectangle layout;
gboolean is_primary;
gboolean is_presentation;
MonitorTestCaseMonitor monitors[MAX_N_MONITORS]; MonitorTestCaseMonitor monitors[MAX_N_MONITORS];
int n_monitors; int n_monitors;
} MonitorTestCaseLogicalMonitor; } MonitorTestCaseLogicalMonitor;
@ -136,6 +139,12 @@ check_monitor_configuration (MetaMonitorConfigStore *config_store,
g_assert (meta_rectangle_equal (&logical_monitor_config->layout, g_assert (meta_rectangle_equal (&logical_monitor_config->layout,
&config_expect->logical_monitors[i].layout)); &config_expect->logical_monitors[i].layout));
g_assert_cmpint (logical_monitor_config->is_primary,
==,
config_expect->logical_monitors[i].is_primary);
g_assert_cmpint (logical_monitor_config->is_presentation,
==,
config_expect->logical_monitors[i].is_presentation);
for (k = logical_monitor_config->monitor_configs, j = 0; for (k = logical_monitor_config->monitor_configs, j = 0;
k; k;
@ -204,6 +213,8 @@ meta_test_monitor_store_single (void)
.width = 1920, .width = 1920,
.height = 1080 .height = 1080
}, },
.is_primary = TRUE,
.is_presentation = FALSE,
.monitors = { .monitors = {
{ {
.connector = "DP-1", .connector = "DP-1",
@ -251,6 +262,8 @@ meta_test_monitor_store_vertical (void)
.width = 1024, .width = 1024,
.height = 768 .height = 768
}, },
.is_primary = TRUE,
.is_presentation = FALSE,
.monitors = { .monitors = {
{ {
.connector = "DP-1", .connector = "DP-1",
@ -273,6 +286,8 @@ meta_test_monitor_store_vertical (void)
.width = 800, .width = 800,
.height = 600 .height = 600
}, },
.is_primary = FALSE,
.is_presentation = FALSE,
.monitors = { .monitors = {
{ {
.connector = "DP-2", .connector = "DP-2",