diff --git a/src/tests/monitor-configs/max-bpc.xml b/src/tests/monitor-configs/max-bpc.xml new file mode 100644 index 000000000..c98e6605c --- /dev/null +++ b/src/tests/monitor-configs/max-bpc.xml @@ -0,0 +1,23 @@ + + + + 0 + 0 + yes + + + DP-1 + MetaProduct's Inc. + MetaMonitor + 0x123456 + + + 1024 + 768 + 60.000495910644531 + + 12 + + + + diff --git a/src/tests/monitor-store-unit-tests.c b/src/tests/monitor-store-unit-tests.c index 38f4bc52f..f8fd2b262 100644 --- a/src/tests/monitor-store-unit-tests.c +++ b/src/tests/monitor-store-unit-tests.c @@ -48,6 +48,7 @@ typedef struct _MonitorStoreTestCaseMonitor const char *serial; MonitorStoreTestCaseMonitorMode mode; gboolean is_underscanning; + unsigned int max_bpc; } MonitorStoreTestCaseMonitor; typedef struct _MonitorStoreTestCaseLogicalMonitor @@ -196,6 +197,12 @@ check_monitor_store_configuration (MetaMonitorConfigStore *config_store, g_assert_cmpint (monitor_config->enable_underscanning, ==, test_monitor->is_underscanning); + g_assert_cmpint (monitor_config->has_max_bpc, + ==, + !!test_monitor->max_bpc); + g_assert_cmpint (monitor_config->max_bpc, + ==, + test_monitor->max_bpc); } } } @@ -446,6 +453,51 @@ meta_test_monitor_store_underscanning (void) check_monitor_store_configurations (&expect); } +static void +meta_test_monitor_store_max_bpc (void) +{ + MonitorStoreTestExpect expect = { + .configurations = { + { + .logical_monitors = { + { + .layout = { + .x = 0, + .y = 0, + .width = 1024, + .height = 768 + }, + .scale = 1, + .is_primary = TRUE, + .is_presentation = FALSE, + .monitors = { + { + .connector = "DP-1", + .vendor = "MetaProduct's Inc.", + .product = "MetaMonitor", + .serial = "0x123456", + .max_bpc = 12, + .mode = { + .width = 1024, + .height = 768, + .refresh_rate = 60.000495910644531 + } + } + }, + .n_monitors = 1, + }, + }, + .n_logical_monitors = 1 + } + }, + .n_configurations = 1 + }; + + meta_set_custom_monitor_config (test_context, "max-bpc.xml"); + + check_monitor_store_configurations (&expect); +} + static void meta_test_monitor_store_scale (void) { @@ -1013,6 +1065,8 @@ init_monitor_store_tests (void) meta_test_monitor_store_primary); g_test_add_func ("/backends/monitor-store/underscanning", meta_test_monitor_store_underscanning); + g_test_add_func ("/backends/monitor-store/max-bpc", + meta_test_monitor_store_max_bpc); g_test_add_func ("/backends/monitor-store/scale", meta_test_monitor_store_scale); g_test_add_func ("/backends/monitor-store/fractional-scale",