Brendan Shanks : user32/tests: Test additional flag values with GetDisplayConfigBufferSizes().

Alexandre Julliard julliard at winehq.org
Wed Jul 1 15:22:49 CDT 2020


Module: wine
Branch: master
Commit: 2e1c48f3517fa967ae9f9a0794c88e6d4e5e77f2
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=2e1c48f3517fa967ae9f9a0794c88e6d4e5e77f2

Author: Brendan Shanks <bshanks at codeweavers.com>
Date:   Mon Jun 29 21:55:22 2020 -0700

user32/tests: Test additional flag values with GetDisplayConfigBufferSizes().

Signed-off-by: Brendan Shanks <bshanks at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user32/tests/monitor.c | 37 ++++++++++++++++++++++++++++---------
 1 file changed, 28 insertions(+), 9 deletions(-)

diff --git a/dlls/user32/tests/monitor.c b/dlls/user32/tests/monitor.c
index afde67cd03..3e711ce1ef 100644
--- a/dlls/user32/tests/monitor.c
+++ b/dlls/user32/tests/monitor.c
@@ -1126,15 +1126,6 @@ static void test_GetDisplayConfigBufferSizes(void)
     ok(ret == ERROR_INVALID_PARAMETER, "got %d\n", ret);
     ok(modes == 100, "got %u\n", modes);
 
-    paths = modes = 0;
-    ret = pGetDisplayConfigBufferSizes(QDC_ALL_PATHS, &paths, &modes);
-    if (!ret)
-        ok(paths > 0 && modes > 0, "got %u, %u\n", paths, modes);
-    else
-        ok(ret == ERROR_NOT_SUPPORTED, "got %d\n", ret);
-
-    /* Invalid flags, non-zero invalid flags validation is version (or driver?) dependent,
-       it's unreliable to use in tests. */
     ret = pGetDisplayConfigBufferSizes(0, NULL, NULL);
     ok(ret == ERROR_INVALID_PARAMETER, "got %d\n", ret);
 
@@ -1148,10 +1139,38 @@ static void test_GetDisplayConfigBufferSizes(void)
     ok(ret == ERROR_INVALID_PARAMETER, "got %d\n", ret);
     ok(modes == 100, "got %u\n", modes);
 
+    /* Flag validation on Windows is driver-dependent */
     paths = modes = 100;
     ret = pGetDisplayConfigBufferSizes(0, &paths, &modes);
     ok(ret == ERROR_INVALID_PARAMETER || ret == ERROR_NOT_SUPPORTED, "got %d\n", ret);
     ok((modes == 0 || modes == 100) && paths == 0, "got %u, %u\n", modes, paths);
+
+    paths = modes = 100;
+    ret = pGetDisplayConfigBufferSizes(0xFF, &paths, &modes);
+    ok(ret == ERROR_INVALID_PARAMETER || ret == ERROR_NOT_SUPPORTED, "got %d\n", ret);
+    ok((modes == 0 || modes == 100) && paths == 0, "got %u, %u\n", modes, paths);
+
+    /* Test success */
+    paths = modes = 0;
+    ret = pGetDisplayConfigBufferSizes(QDC_ALL_PATHS, &paths, &modes);
+    if (!ret)
+        ok(paths > 0 && modes > 0, "got %u, %u\n", paths, modes);
+    else
+        ok(ret == ERROR_NOT_SUPPORTED, "got %d\n", ret);
+
+    paths = modes = 0;
+    ret = pGetDisplayConfigBufferSizes(QDC_ONLY_ACTIVE_PATHS, &paths, &modes);
+    if (!ret)
+        ok(paths > 0 && modes > 0, "got %u, %u\n", paths, modes);
+    else
+        ok(ret == ERROR_NOT_SUPPORTED, "got %d\n", ret);
+
+    paths = modes = 0;
+    ret = pGetDisplayConfigBufferSizes(QDC_DATABASE_CURRENT, &paths, &modes);
+    if (!ret)
+        ok(paths > 0 && modes > 0, "got %u, %u\n", paths, modes);
+    else
+        ok(ret == ERROR_NOT_SUPPORTED, "got %d\n", ret);
 }
 
 static BOOL CALLBACK test_EnumDisplayMonitors_normal_cb(HMONITOR monitor, HDC hdc, LPRECT rect,




More information about the wine-cvs mailing list