[PATCH 1/3] user32/tests: Separate display config test functions.

Zhiyi Zhang zzhang at codeweavers.com
Thu Aug 26 03:19:58 CDT 2021


Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
---
 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 dfb57d3e2c2..bc4bc53502a 100644
--- a/dlls/user32/tests/monitor.c
+++ b/dlls/user32/tests/monitor.c
@@ -1400,6 +1400,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 %d\n", ret);
 
@@ -1643,6 +1649,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;
@@ -1767,6 +1779,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 %d\n", ret);
 
@@ -1864,6 +1882,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 %d\n", ret);
 
@@ -1944,21 +1968,6 @@ static void test_DisplayConfigGetDeviceInfo(void)
     ok(ret == ERROR_GEN_FAILURE || ret == ERROR_INVALID_PARAMETER || ret == ERROR_NOT_SUPPORTED, "got %d\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 BOOL CALLBACK test_handle_proc(HMONITOR full_monitor, HDC hdc, LPRECT rect, LPARAM lparam)
 {
     MONITORINFO monitor_info = {sizeof(monitor_info)};
@@ -2283,10 +2292,12 @@ START_TEST(monitor)
     init_function_pointers();
     test_enumdisplaydevices();
     test_ChangeDisplaySettingsEx();
+    test_DisplayConfigGetDeviceInfo();
     test_EnumDisplayMonitors();
+    test_GetDisplayConfigBufferSizes();
+    test_QueryDisplayConfig();
     test_monitors();
     test_work_area();
-    test_display_config();
     test_handles();
     test_display_dc();
 }
-- 
2.30.2




More information about the wine-devel mailing list