Nikolay Sivov : user32/tests: Simplify some tests using todo_wine_if().

Alexandre Julliard julliard at wine.codeweavers.com
Thu Feb 11 09:59:46 CST 2016


Module: wine
Branch: master
Commit: 8a7e7ec6a14c49deee8cc461a7ad05ab7ea0f416
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8a7e7ec6a14c49deee8cc461a7ad05ab7ea0f416

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Thu Feb 11 05:26:32 2016 +0300

user32/tests: Simplify some tests using todo_wine_if().

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user32/tests/dialog.c     | 11 +----------
 dlls/user32/tests/menu.c       | 14 ++------------
 dlls/user32/tests/monitor.c    |  6 +++---
 dlls/user32/tests/msg.c        | 12 ++----------
 dlls/user32/tests/sysparams.c  |  4 +---
 dlls/user32/tests/win.c        |  4 +---
 dlls/user32/tests/winstation.c | 12 +++---------
 7 files changed, 13 insertions(+), 50 deletions(-)

diff --git a/dlls/user32/tests/dialog.c b/dlls/user32/tests/dialog.c
index 3488f31..eede834 100644
--- a/dlls/user32/tests/dialog.c
+++ b/dlls/user32/tests/dialog.c
@@ -394,17 +394,8 @@ static void test_GetNextDlgItem(void)
     {
         HWND a;
         a = (p->tab ? GetNextDlgTabItem : GetNextDlgGroupItem) (hwnd[p->dlg], hwnd[p->ctl], p->prev);
-        if (p->isok)
-        {
+        todo_wine_if (!p->isok)
             ok (a == hwnd[p->res], "Test %d: %s %s item of %d in %d was %d instead of %d\n", p->test, p->prev ? "Prev" : "Next", p->tab ? "Tab" : "Group", p->ctl, p->dlg, id(a), p->res);
-        }
-        else
-        {
-            todo_wine
-            {
-                ok (a == hwnd[p->res], "Test %d: %s %s item of %d in %d was actually  %d matching expected %d\n", p->test, p->prev ? "Prev" : "Next", p->tab ? "Tab" : "Group", p->ctl, p->dlg, id(a), p->res);
-            }
-        }
         p++;
     }
 }
diff --git a/dlls/user32/tests/menu.c b/dlls/user32/tests/menu.c
index 33d8eb8..88b9df9 100644
--- a/dlls/user32/tests/menu.c
+++ b/dlls/user32/tests/menu.c
@@ -2382,13 +2382,7 @@ static DWORD WINAPI test_menu_input_thread(LPVOID lpParameter)
             return 0;
         }
 
-        if (menu_tests[i]._todo_wine)
-        {
-            todo_wine {
-                ok(menu_tests[i].bMenuVisible == bMenuVisible, "test %d\n", i);
-            }
-        }
-        else
+        todo_wine_if (menu_tests[i]._todo_wine)
             ok(menu_tests[i].bMenuVisible == bMenuVisible, "test %d\n", i);
     }
     return 0;
@@ -2450,11 +2444,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam,
         if (pGetMenuInfo) /* Skip on NT */
         {
             /* Native returns handle to destroyed window */
-            if (msg==WM_UNINITMENUPOPUP && popmenu==1)
-                todo_wine ok(!mbi.hwndMenu == !popmenu,
-                        "msg %x: GetMenuBarInfo.hwndMenu wrong: %p expected %sNULL\n",
-                        msg, mbi.hwndMenu, popmenu ? "not " : "");
-            else
+            todo_wine_if (msg==WM_UNINITMENUPOPUP && popmenu==1)
                 ok(!mbi.hwndMenu == !popmenu,
                         "msg %x: GetMenuBarInfo.hwndMenu wrong: %p expected %sNULL\n",
                         msg, mbi.hwndMenu, popmenu ? "not " : "");
diff --git a/dlls/user32/tests/monitor.c b/dlls/user32/tests/monitor.c
index 864eb85..d0c9a8c 100644
--- a/dlls/user32/tests/monitor.c
+++ b/dlls/user32/tests/monitor.c
@@ -524,11 +524,11 @@ static void test_work_area(void)
           wp.rcNormalPosition.left, wp.rcNormalPosition.top,
           wp.rcNormalPosition.right, wp.rcNormalPosition.bottom);
     OffsetRect(&wp.rcNormalPosition, rc_work.left, rc_work.top);
-    if (mi.rcMonitor.left != mi.rcWork.left ||
+    todo_wine_if (mi.rcMonitor.left != mi.rcWork.left ||
         mi.rcMonitor.top != mi.rcWork.top)  /* FIXME: remove once Wine is fixed */
-        todo_wine ok(EqualRect(&rc_normal, &wp.rcNormalPosition), "normal pos is different\n");
-    else
+    {
         ok(EqualRect(&rc_normal, &wp.rcNormalPosition), "normal pos is different\n");
+    }
 
     SetWindowLongA(hwnd, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
 
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index 9990bcc..d15a8e7 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -11805,13 +11805,7 @@ static void test_ShowWindow(void)
        "expected -1,-1 got %d,%d\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
     ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
        "expected -1,-1 got %d,%d\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
-    if (work_rc.left || work_rc.top) todo_wine /* FIXME: remove once Wine is fixed */
-    ok(EqualRect(&win_rc, &wp.rcNormalPosition),
-       "expected %d,%d-%d,%d got %d,%d-%d,%d\n",
-        win_rc.left, win_rc.top, win_rc.right, win_rc.bottom,
-        wp.rcNormalPosition.left, wp.rcNormalPosition.top,
-        wp.rcNormalPosition.right, wp.rcNormalPosition.bottom);
-    else
+    todo_wine_if (work_rc.left || work_rc.top) /* FIXME: remove once Wine is fixed */
     ok(EqualRect(&win_rc, &wp.rcNormalPosition),
        "expected %d,%d-%d,%d got %d,%d-%d,%d\n",
         win_rc.left, win_rc.top, win_rc.right, win_rc.bottom,
@@ -15106,9 +15100,7 @@ static void test_SendMessage_other_thread(int thread_n)
 
     ret = GetQueueStatus(QS_SENDMESSAGE|QS_POSTMESSAGE);
     /* FIXME: remove once Wine is fixed */
-if (thread_n == 2) todo_wine
-    ok(ret == 0, "wrong status %08x\n", ret);
-else
+todo_wine_if (thread_n == 2)
     ok(ret == 0, "wrong status %08x\n", ret);
 
     trace("main: call PeekMessage\n");
diff --git a/dlls/user32/tests/sysparams.c b/dlls/user32/tests/sysparams.c
index 6fc24a6..cffc815 100644
--- a/dlls/user32/tests/sysparams.c
+++ b/dlls/user32/tests/sysparams.c
@@ -2495,9 +2495,7 @@ static void test_WM_DISPLAYCHANGE(void)
             continue;
         }
 
-        if(start_bpp != test_bpps[i]) {
-            todo_wine ok(last_bpp == test_bpps[i], "Set bpp %d, but WM_DISPLAYCHANGE reported bpp %d\n", test_bpps[i], last_bpp);
-        } else {
+        todo_wine_if(start_bpp != test_bpps[i]) {
             ok(last_bpp == test_bpps[i], "Set bpp %d, but WM_DISPLAYCHANGE reported bpp %d\n", test_bpps[i], last_bpp);
         }
         last_set_bpp = test_bpps[i];
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index b202544..70c07e0 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -7702,9 +7702,7 @@ static void test_child_window_from_point(void)
         ok(hwnd != 0, "RealChildWindowFromPoint failed\n");
         ret = window_to_index(hwnd, window, sizeof(window)/sizeof(window[0]));
         /* FIXME: remove once Wine is fixed */
-        if (ret != real_child_pos[i])
-            todo_wine ok(ret == real_child_pos[i] || broken(ret == real_child_pos_nt4[i]), "expected %d, got %d\n", real_child_pos[i], ret);
-        else
+        todo_wine_if (ret != real_child_pos[i])
             ok(ret == real_child_pos[i] || broken(ret == real_child_pos_nt4[i]), "expected %d, got %d\n", real_child_pos[i], ret);
 
         get_window_attributes(hwnd, &attrs);
diff --git a/dlls/user32/tests/winstation.c b/dlls/user32/tests/winstation.c
index 35c9d0d..e49420b 100644
--- a/dlls/user32/tests/winstation.c
+++ b/dlls/user32/tests/winstation.c
@@ -942,10 +942,8 @@ static void test_foregroundwindow(void)
                     if (input_desk_id == thread_desk_id)
                     {
                         ok(ret, "SetForegroundWindow failed!\n");
-                        if (hwnd)
+                        todo_wine_if (!hwnd)
                             ok(hwnd == hwnd_test , "unexpected foreground window %p\n", hwnd);
-                        else
-                            todo_wine ok(hwnd == hwnd_test , "unexpected foreground window %p\n", hwnd);
                     }
                     else
                     {
@@ -958,18 +956,14 @@ static void test_foregroundwindow(void)
                     if (input_desk_id == thread_desk_id)
                     {
                         ok(!ret, "SetForegroundWindow should fail!\n");
-                        if (hwnd)
+                        todo_wine_if (!hwnd)
                             ok(hwnd == partners[input_desk_id] , "unexpected foreground window %p\n", hwnd);
-                        else
-                            todo_wine ok(hwnd == partners[input_desk_id] , "unexpected foreground window %p\n", hwnd);
                     }
                     else
                     {
                         todo_wine ok(!ret, "SetForegroundWindow should fail!\n");
-                        if (!hwnd)
+                        todo_wine_if (hwnd)
                             ok(hwnd == 0, "unexpected foreground window %p\n", hwnd);
-                        else
-                            todo_wine ok(hwnd == 0, "unexpected foreground window %p\n", hwnd);
                     }
                 }
             }




More information about the wine-cvs mailing list