tests/monitor-store-unit-tests: Rename some structs

We're going to move some structs from monitor-unit-tests.c to
monitor-test-utils.h and some names are currently clashing with the
struct names here, so rename those to be specific to the
MonitorStoreUnitTests.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1243
This commit is contained in:
Jonas Dreßler 2020-05-08 22:46:54 +02:00 committed by Jonas Ådahl
parent ae7cb7a3bf
commit 3c35a78769

View File

@ -31,38 +31,38 @@
#define MAX_N_LOGICAL_MONITORS 10 #define MAX_N_LOGICAL_MONITORS 10
#define MAX_N_CONFIGURATIONS 10 #define MAX_N_CONFIGURATIONS 10
typedef struct _MonitorTestCaseMonitorMode typedef struct _MonitorStoreTestCaseMonitorMode
{ {
int width; int width;
int height; int height;
float refresh_rate; float refresh_rate;
MetaCrtcModeFlag flags; MetaCrtcModeFlag flags;
} MonitorTestCaseMonitorMode; } MonitorStoreTestCaseMonitorMode;
typedef struct _MonitorTestCaseMonitor typedef struct _MonitorStoreTestCaseMonitor
{ {
const char *connector; const char *connector;
const char *vendor; const char *vendor;
const char *product; const char *product;
const char *serial; const char *serial;
MonitorTestCaseMonitorMode mode; MonitorStoreTestCaseMonitorMode mode;
gboolean is_underscanning; gboolean is_underscanning;
} MonitorTestCaseMonitor; } MonitorStoreTestCaseMonitor;
typedef struct _MonitorTestCaseLogicalMonitor typedef struct _MonitorStoreTestCaseLogicalMonitor
{ {
MetaRectangle layout; MetaRectangle layout;
float scale; float scale;
MetaMonitorTransform transform; MetaMonitorTransform transform;
gboolean is_primary; gboolean is_primary;
gboolean is_presentation; gboolean is_presentation;
MonitorTestCaseMonitor monitors[MAX_N_MONITORS]; MonitorStoreTestCaseMonitor monitors[MAX_N_MONITORS];
int n_monitors; int n_monitors;
} MonitorTestCaseLogicalMonitor; } MonitorStoreTestCaseLogicalMonitor;
typedef struct _MonitorStoreTestConfiguration typedef struct _MonitorStoreTestConfiguration
{ {
MonitorTestCaseLogicalMonitor logical_monitors[MAX_N_LOGICAL_MONITORS]; MonitorStoreTestCaseLogicalMonitor logical_monitors[MAX_N_LOGICAL_MONITORS];
int n_logical_monitors; int n_logical_monitors;
} MonitorStoreTestConfiguration; } MonitorStoreTestConfiguration;
@ -87,7 +87,7 @@ create_config_key_from_expect (MonitorStoreTestConfiguration *expect_config)
for (j = 0; j < expect_config->logical_monitors[i].n_monitors; j++) for (j = 0; j < expect_config->logical_monitors[i].n_monitors; j++)
{ {
MetaMonitorSpec *monitor_spec; MetaMonitorSpec *monitor_spec;
MonitorTestCaseMonitor *test_monitor = MonitorStoreTestCaseMonitor *test_monitor =
&expect_config->logical_monitors[i].monitors[j]; &expect_config->logical_monitors[i].monitors[j];
monitor_spec = g_new0 (MetaMonitorSpec, 1); monitor_spec = g_new0 (MetaMonitorSpec, 1);
@ -115,7 +115,7 @@ create_config_key_from_expect (MonitorStoreTestConfiguration *expect_config)
} }
static void static void
check_monitor_configuration (MetaMonitorConfigStore *config_store, check_monitor_store_configuration (MetaMonitorConfigStore *config_store,
MonitorStoreTestConfiguration *config_expect) MonitorStoreTestConfiguration *config_expect)
{ {
MetaMonitorsConfigKey *config_key; MetaMonitorsConfigKey *config_key;
@ -164,7 +164,7 @@ check_monitor_configuration (MetaMonitorConfigStore *config_store,
k = k->next, j++) k = k->next, j++)
{ {
MetaMonitorConfig *monitor_config = k->data; MetaMonitorConfig *monitor_config = k->data;
MonitorTestCaseMonitor *test_monitor = MonitorStoreTestCaseMonitor *test_monitor =
&config_expect->logical_monitors[i].monitors[j]; &config_expect->logical_monitors[i].monitors[j];
g_assert_cmpstr (monitor_config->monitor_spec->connector, g_assert_cmpstr (monitor_config->monitor_spec->connector,
@ -200,7 +200,7 @@ check_monitor_configuration (MetaMonitorConfigStore *config_store,
} }
static void static void
check_monitor_configurations (MonitorStoreTestExpect *expect) check_monitor_store_configurations (MonitorStoreTestExpect *expect)
{ {
MetaBackend *backend = meta_get_backend (); MetaBackend *backend = meta_get_backend ();
MetaMonitorManager *monitor_manager = MetaMonitorManager *monitor_manager =
@ -215,7 +215,7 @@ check_monitor_configurations (MonitorStoreTestExpect *expect)
expect->n_configurations); expect->n_configurations);
for (i = 0; i < expect->n_configurations; i++) for (i = 0; i < expect->n_configurations; i++)
check_monitor_configuration (config_store, &expect->configurations[i]); check_monitor_store_configuration (config_store, &expect->configurations[i]);
} }
static void static void
@ -259,7 +259,7 @@ meta_test_monitor_store_single (void)
set_custom_monitor_config ("single.xml"); set_custom_monitor_config ("single.xml");
check_monitor_configurations (&expect); check_monitor_store_configurations (&expect);
} }
static void static void
@ -328,7 +328,7 @@ meta_test_monitor_store_vertical (void)
set_custom_monitor_config ("vertical.xml"); set_custom_monitor_config ("vertical.xml");
check_monitor_configurations (&expect); check_monitor_store_configurations (&expect);
} }
static void static void
@ -397,7 +397,7 @@ meta_test_monitor_store_primary (void)
set_custom_monitor_config ("primary.xml"); set_custom_monitor_config ("primary.xml");
check_monitor_configurations (&expect); check_monitor_store_configurations (&expect);
} }
static void static void
@ -442,7 +442,7 @@ meta_test_monitor_store_underscanning (void)
set_custom_monitor_config ("underscanning.xml"); set_custom_monitor_config ("underscanning.xml");
check_monitor_configurations (&expect); check_monitor_store_configurations (&expect);
} }
static void static void
@ -492,7 +492,7 @@ meta_test_monitor_store_scale (void)
set_custom_monitor_config ("scale.xml"); set_custom_monitor_config ("scale.xml");
check_monitor_configurations (&expect); check_monitor_store_configurations (&expect);
} }
static void static void
@ -542,7 +542,7 @@ meta_test_monitor_store_fractional_scale (void)
set_custom_monitor_config ("fractional-scale.xml"); set_custom_monitor_config ("fractional-scale.xml");
check_monitor_configurations (&expect); check_monitor_store_configurations (&expect);
} }
static void static void
@ -592,7 +592,7 @@ meta_test_monitor_store_high_precision_fractional_scale (void)
set_custom_monitor_config ("high-precision-fractional-scale.xml"); set_custom_monitor_config ("high-precision-fractional-scale.xml");
check_monitor_configurations (&expect); check_monitor_store_configurations (&expect);
} }
static void static void
@ -646,7 +646,7 @@ meta_test_monitor_store_mirrored (void)
set_custom_monitor_config ("mirrored.xml"); set_custom_monitor_config ("mirrored.xml");
check_monitor_configurations (&expect); check_monitor_store_configurations (&expect);
} }
static void static void
@ -717,7 +717,7 @@ meta_test_monitor_store_first_rotated (void)
set_custom_monitor_config ("first-rotated.xml"); set_custom_monitor_config ("first-rotated.xml");
check_monitor_configurations (&expect); check_monitor_store_configurations (&expect);
} }
static void static void
@ -788,7 +788,7 @@ meta_test_monitor_store_second_rotated (void)
set_custom_monitor_config ("second-rotated.xml"); set_custom_monitor_config ("second-rotated.xml");
check_monitor_configurations (&expect); check_monitor_store_configurations (&expect);
} }
static void static void
@ -833,7 +833,7 @@ meta_test_monitor_store_interlaced (void)
set_custom_monitor_config ("interlaced.xml"); set_custom_monitor_config ("interlaced.xml");
check_monitor_configurations (&expect); check_monitor_store_configurations (&expect);
} }
void void