Zhiyi Zhang : user32/tests: Fix a test failure.

Alexandre Julliard julliard at winehq.org
Tue Sep 15 15:40:12 CDT 2020


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

Author: Zhiyi Zhang <zzhang at codeweavers.com>
Date:   Tue Sep 15 18:34:43 2020 +0800

user32/tests: Fix a test failure.

Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user32/tests/monitor.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/dlls/user32/tests/monitor.c b/dlls/user32/tests/monitor.c
index 9a7efb8e9b..7ae10fcf84 100644
--- a/dlls/user32/tests/monitor.c
+++ b/dlls/user32/tests/monitor.c
@@ -702,16 +702,18 @@ static void test_ChangeDisplaySettingsEx(void)
         dm2.dmSize = sizeof(dm2);
         for (mode = 0; EnumDisplaySettingsA(devices[device].name, mode, &dm2); ++mode)
         {
-            if (dm2.dmPelsWidth != dm.dmPelsWidth && dm2.dmPelsHeight != dm.dmPelsHeight)
+            /* Use the same color depth because the win2008 TestBots are unable to change it */
+            if (dm2.dmPelsWidth != dm.dmPelsWidth && dm2.dmPelsHeight != dm.dmPelsHeight &&
+                    dm2.dmBitsPerPel == dm.dmBitsPerPel)
                 break;
         }
-        ok(dm2.dmPelsWidth != dm.dmPelsWidth && dm2.dmPelsHeight != dm.dmPelsHeight, "Failed to find a different mode.\n");
+        ok(dm2.dmPelsWidth != dm.dmPelsWidth && dm2.dmPelsHeight != dm.dmPelsHeight &&
+                dm2.dmBitsPerPel == dm.dmBitsPerPel, "Failed to find a different mode.\n");
 
         /* Test normal operation */
+        dm = dm2;
+        dm.dmFields |= DM_POSITION;
         dm.dmPosition = position;
-        dm.dmPelsWidth = dm2.dmPelsWidth;
-        dm.dmPelsHeight = dm2.dmPelsHeight;
-        dm.dmDisplayFrequency = dm2.dmDisplayFrequency;
         res = ChangeDisplaySettingsExA(devices[device].name, &dm, NULL, CDS_UPDATEREGISTRY | CDS_NORESET, NULL);
         ok(res == DISP_CHANGE_SUCCESSFUL ||
                 broken(res == DISP_CHANGE_FAILED), /* win8 TestBot */




More information about the wine-cvs mailing list