[PATCH 3/3] user32/tests: Use todo_wine for failing z-order tests.

Zebediah Figura zfigura at codeweavers.com
Tue Jul 11 10:38:35 CDT 2017


Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
 dlls/user32/tests/win.c | 62 +++++++++++++++++++++++++++++++++----------------
 1 file changed, 42 insertions(+), 20 deletions(-)

diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index b32be2e356e..36fadc2ced5 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -2865,13 +2865,18 @@ static void test_children_zorder(HWND parent)
 
 #define check_z_order(hwnd, next, prev, owner, topmost) \
         check_z_order_debug((hwnd), (next), (prev), (owner), (topmost), \
-                            __FILE__, __LINE__)
+                            FALSE, __FILE__, __LINE__)
+
+#define check_z_order_todo(hwnd, next, prev, owner, topmost) \
+        check_z_order_debug((hwnd), (next), (prev), (owner), (topmost), \
+                            TRUE, __FILE__, __LINE__)
 
 static void check_z_order_debug(HWND hwnd, HWND next, HWND prev, HWND owner,
-                                BOOL topmost, const char *file, int line)
+                                BOOL topmost, BOOL todo, const char *file, int line)
 {
     HWND test;
     DWORD ex_style;
+    int failcount = 0;
 
     test = GetWindow(hwnd, GW_HWNDNEXT);
     /* skip foreign windows */
@@ -2883,7 +2888,11 @@ static void check_z_order_debug(HWND hwnd, HWND next, HWND prev, HWND owner,
         /*trace("skipping next %p (%p)\n", test, UlongToHandle(GetWindowLongPtr(test, GWLP_HINSTANCE)));*/
         test = GetWindow(test, GW_HWNDNEXT);
     }
-    ok_(file, line)(next == test, "%p: expected next %p, got %p\n", hwnd, next, test);
+    if (next != test)
+    {
+        todo_wine_if(todo) ok_(file, line)(next == test, "%p: expected next %p, got %p\n", hwnd, next, test);
+        failcount++;
+    }
 
     test = GetWindow(hwnd, GW_HWNDPREV);
     /* skip foreign windows */
@@ -2895,14 +2904,29 @@ static void check_z_order_debug(HWND hwnd, HWND next, HWND prev, HWND owner,
         /*trace("skipping prev %p (%p)\n", test, UlongToHandle(GetWindowLongPtr(test, GWLP_HINSTANCE)));*/
         test = GetWindow(test, GW_HWNDPREV);
     }
-    ok_(file, line)(prev == test, "%p: expected prev %p, got %p\n", hwnd, prev, test);
+    if (prev != test)
+    {
+        todo_wine_if(todo) ok_(file, line)(prev == test, "%p: expected prev %p, got %p\n", hwnd, prev, test);
+        failcount++;
+    }
 
     test = GetWindow(hwnd, GW_OWNER);
-    ok_(file, line)(owner == test, "%p: expected owner %p, got %p\n", hwnd, owner, test);
+    if (owner != test)
+    {
+        todo_wine_if(todo) ok_(file, line)(owner == test, "%p: expected owner %p, got %p\n", hwnd, owner, test);
+        failcount++;
+    }
 
     ex_style = GetWindowLongA(hwnd, GWL_EXSTYLE);
-    ok_(file, line)(!(ex_style & WS_EX_TOPMOST) == !topmost, "%p: expected %stopmost\n",
-                    hwnd, topmost ? "" : "NOT ");
+    if (!(ex_style & WS_EX_TOPMOST) != !topmost)
+    {
+        todo_wine_if(todo) ok_(file, line)(!(ex_style & WS_EX_TOPMOST) == !topmost, "%p: expected %stopmost\n",
+                                           hwnd, topmost ? "" : "NOT ");
+        failcount++;
+    }
+
+    if(todo && !failcount)
+        todo_wine ok_(file, line)(TRUE, "%p: marked todo but succeeds\n", hwnd);
 }
 
 static void test_popup_zorder(HWND hwnd_D, HWND hwnd_E, DWORD style)
@@ -2973,15 +2997,13 @@ static void test_popup_zorder(HWND hwnd_D, HWND hwnd_E, DWORD style)
     check_z_order(hwnd_A, hwnd_B, 0, 0, TRUE);
 
     /* move hwnd_F and its popups down */
-#if 0 /* enable once Wine is fixed to pass this test */
     SetWindowPos(hwnd_F, HWND_BOTTOM, 0,0,0,0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE);
-    check_z_order(hwnd_F, 0, hwnd_C, 0, FALSE);
-    check_z_order(hwnd_C, hwnd_F, hwnd_B, hwnd_F, FALSE);
-    check_z_order(hwnd_B, hwnd_C, hwnd_E, hwnd_F, FALSE);
-    check_z_order(hwnd_E, hwnd_B, hwnd_D, 0, FALSE);
-    check_z_order(hwnd_D, hwnd_E, hwnd_A, 0, FALSE);
-    check_z_order(hwnd_A, hwnd_D, 0, 0, TRUE);
-#endif
+    check_z_order_todo(hwnd_F, 0, hwnd_C, 0, FALSE);
+    check_z_order_todo(hwnd_C, hwnd_F, hwnd_B, hwnd_F, FALSE);
+    check_z_order_todo(hwnd_B, hwnd_C, hwnd_E, hwnd_F, FALSE);
+    check_z_order_todo(hwnd_E, hwnd_B, hwnd_D, 0, FALSE);
+    check_z_order_todo(hwnd_D, hwnd_E, hwnd_A, 0, FALSE);
+    check_z_order_todo(hwnd_A, hwnd_D, 0, 0, TRUE);
 
     /* make hwnd_C owned by a topmost window */
     DestroyWindow( hwnd_C );
@@ -2990,11 +3012,11 @@ static void test_popup_zorder(HWND hwnd_D, HWND hwnd_E, DWORD style)
                             100, 100, 100, 100,
                             hwnd_A, 0, GetModuleHandleA(NULL), NULL);
     trace("hwnd_C %p\n", hwnd_C);
-    check_z_order(hwnd_E, 0, hwnd_D, 0, FALSE);
-    check_z_order(hwnd_D, hwnd_E, hwnd_F, 0, FALSE);
-    check_z_order(hwnd_F, hwnd_D, hwnd_B, 0, FALSE);
-    check_z_order(hwnd_B, hwnd_F, hwnd_A, hwnd_F, TRUE);
-    check_z_order(hwnd_A, hwnd_B, hwnd_C, 0, TRUE);
+    check_z_order_todo(hwnd_F, 0, hwnd_B, 0, FALSE);
+    check_z_order_todo(hwnd_B, hwnd_F, hwnd_E, hwnd_F, FALSE);
+    check_z_order_todo(hwnd_E, hwnd_B, hwnd_D, 0, FALSE);
+    check_z_order_todo(hwnd_D, hwnd_E, hwnd_A, 0, FALSE);
+    check_z_order_todo(hwnd_A, hwnd_D, hwnd_C, 0, TRUE);
     check_z_order(hwnd_C, hwnd_A, 0, hwnd_A, TRUE);
 
     DestroyWindow(hwnd_A);
-- 
2.13.2




More information about the wine-patches mailing list