From 3e9f24813a899dba7e632ded55c90e74a8e8bd30 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Fri, 15 Oct 2021 09:56:50 +0800 Subject: [PATCH 36/51] user32/tests: Separate display config test functions. To: wine-devel@winehq.org Signed-off-by: Zhiyi Zhang --- dlls/user32/tests/monitor.c | 43 +++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/dlls/user32/tests/monitor.c b/dlls/user32/tests/monitor.c index 86b5945dcb9..e90fe8dc8f4 100644 --- a/dlls/user32/tests/monitor.c +++ b/dlls/user32/tests/monitor.c @@ -1525,6 +1525,12 @@ static void test_GetDisplayConfigBufferSizes(void) UINT32 paths, modes; LONG ret; + if (!pGetDisplayConfigBufferSizes) + { + win_skip("GetDisplayConfigBufferSizes() is not supported\n"); + return; + } + ret = pGetDisplayConfigBufferSizes(QDC_ALL_PATHS, NULL, NULL); ok(ret == ERROR_INVALID_PARAMETER, "got %ld\n", ret); @@ -1768,6 +1774,12 @@ static void test_QueryDisplayConfig_result(UINT32 flags, DISPLAYCONFIG_TARGET_PREFERRED_MODE preferred_mode; DISPLAYCONFIG_ADAPTER_NAME adapter_name; + if (!pDisplayConfigGetDeviceInfo) + { + win_skip("DisplayConfigGetDeviceInfo() is not supported\n"); + return; + } + for (i = 0; i < paths; i++) { source_name.header.type = DISPLAYCONFIG_DEVICE_INFO_GET_SOURCE_NAME; @@ -1892,6 +1904,12 @@ static void test_QueryDisplayConfig(void) DISPLAYCONFIG_TOPOLOGY_ID topologyid; LONG ret; + if (!pQueryDisplayConfig) + { + win_skip("QueryDisplayConfig() is not supported\n"); + return; + } + ret = pQueryDisplayConfig(QDC_ALL_PATHS, NULL, NULL, NULL, NULL, NULL); ok(ret == ERROR_INVALID_PARAMETER, "got %ld\n", ret); @@ -1989,6 +2007,12 @@ static void test_DisplayConfigGetDeviceInfo(void) DISPLAYCONFIG_TARGET_PREFERRED_MODE preferred_mode; DISPLAYCONFIG_ADAPTER_NAME adapter_name; + if (!pDisplayConfigGetDeviceInfo) + { + win_skip("DisplayConfigGetDeviceInfo() is not supported\n"); + return; + } + ret = pDisplayConfigGetDeviceInfo(NULL); ok(ret == ERROR_GEN_FAILURE, "got %ld\n", ret); @@ -2069,21 +2093,6 @@ static void test_DisplayConfigGetDeviceInfo(void) ok(ret == ERROR_GEN_FAILURE || ret == ERROR_INVALID_PARAMETER || ret == ERROR_NOT_SUPPORTED, "got %ld\n", ret); } -static void test_display_config(void) -{ - if (!pGetDisplayConfigBufferSizes || - !pQueryDisplayConfig || - !pDisplayConfigGetDeviceInfo) - { - win_skip("DisplayConfig APIs are not supported\n"); - return; - } - - test_GetDisplayConfigBufferSizes(); - test_QueryDisplayConfig(); - test_DisplayConfigGetDeviceInfo(); -} - static void test_DisplayConfigSetDeviceInfo(void) { static const unsigned int scales[] = {100, 125, 150, 175, 200, 225, 250, 300, 350, 400, 450, 500}; @@ -2663,10 +2672,12 @@ START_TEST(monitor) test_enumdisplaydevices(); test_ChangeDisplaySettingsEx(); test_DisplayConfigSetDeviceInfo(); + test_DisplayConfigGetDeviceInfo(); test_EnumDisplayMonitors(); + test_GetDisplayConfigBufferSizes(); + test_QueryDisplayConfig(); test_monitors(); test_work_area(); - test_display_config(); test_handles(); test_display_dc(); } -- 2.32.0