[COMCTL32_WINETEST] Sync with Wine Staging 1.9.23. CORE-12409
authorAmine Khaldi <amine.khaldi@reactos.org>
Tue, 22 Nov 2016 12:11:38 +0000 (12:11 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Tue, 22 Nov 2016 12:11:38 +0000 (12:11 +0000)
svn path=/trunk/; revision=73336

rostests/winetests/comctl32/listview.c
rostests/winetests/comctl32/status.c
rostests/winetests/comctl32/syslink.c
rostests/winetests/comctl32/toolbar.c
rostests/winetests/comctl32/tooltips.c
rostests/winetests/comctl32/treeview.c

index fddce6e..85c45cf 100644 (file)
@@ -5785,6 +5785,7 @@ static void test_oneclickactivate(void)
     HWND hwnd, fg;
     RECT rect;
     INT r;
     HWND hwnd, fg;
     RECT rect;
     INT r;
+    POINT orig_pos;
 
     hwnd = CreateWindowExA(0, "SysListView32", "foo", WS_VISIBLE|WS_CHILD|LVS_LIST,
             10, 10, 100, 200, hwndparent, NULL, NULL, NULL);
 
     hwnd = CreateWindowExA(0, "SysListView32", "foo", WS_VISIBLE|WS_CHILD|LVS_LIST,
             10, 10, 100, 200, hwndparent, NULL, NULL, NULL);
@@ -5811,6 +5812,7 @@ static void test_oneclickactivate(void)
     ok(r == 0, "should not fail\n");
 
     GetWindowRect(hwnd, &rect);
     ok(r == 0, "should not fail\n");
 
     GetWindowRect(hwnd, &rect);
+    GetCursorPos(&orig_pos);
     SetCursorPos(rect.left+5, rect.top+5);
     flush_events();
     r = SendMessageA(hwnd, WM_MOUSEMOVE, MAKELONG(1, 1), 0);
     SetCursorPos(rect.left+5, rect.top+5);
     flush_events();
     r = SendMessageA(hwnd, WM_MOUSEMOVE, MAKELONG(1, 1), 0);
@@ -5830,6 +5832,7 @@ static void test_oneclickactivate(void)
     expect(1, r);
 
     DestroyWindow(hwnd);
     expect(1, r);
 
     DestroyWindow(hwnd);
+    SetCursorPos(orig_pos.x, orig_pos.y);
 }
 
 static void test_callback_mask(void)
 }
 
 static void test_callback_mask(void)
index 13d68f8..6db6bf5 100644 (file)
@@ -291,7 +291,7 @@ static void test_status_control(void)
     expect(5,LOWORD(r));
     expect(SBT_POPOUT,HIWORD(r));
     r = SendMessageW(hWndStatus, WM_GETTEXTLENGTH, 0, 0);
     expect(5,LOWORD(r));
     expect(SBT_POPOUT,HIWORD(r));
     r = SendMessageW(hWndStatus, WM_GETTEXTLENGTH, 0, 0);
-    ok(r == 5 || broken(0x02000005 /* NT4 */), "Expected 5, got %d\n", r);
+    ok(r == 5, "Expected 5, got %d\n", r);
     r = SendMessageA(hWndStatus, SB_GETTEXTLENGTHA, 1, 0);
     expect(0,LOWORD(r));
     expect(SBT_OWNERDRAW,HIWORD(r));
     r = SendMessageA(hWndStatus, SB_GETTEXTLENGTHA, 1, 0);
     expect(0,LOWORD(r));
     expect(SBT_OWNERDRAW,HIWORD(r));
index a65283a..0e523b9 100644 (file)
@@ -195,6 +195,7 @@ START_TEST(syslink)
     BOOL rc;
     HWND hWndSysLink;
     LONG oldstyle;
     BOOL rc;
     HWND hWndSysLink;
     LONG oldstyle;
+    POINT orig_pos;
 
     if (!load_v6_module(&ctx_cookie, &hCtx))
         return;
 
     if (!load_v6_module(&ctx_cookie, &hCtx))
         return;
@@ -217,6 +218,10 @@ START_TEST(syslink)
         return;
     }
 
         return;
     }
 
+    /* Move the cursor off the parent window */
+    GetCursorPos(&orig_pos);
+    SetCursorPos(400, 400);
+
     init_msg_sequences(sequences, NUM_MSG_SEQUENCE);
 
     /* Create parent window */
     init_msg_sequences(sequences, NUM_MSG_SEQUENCE);
 
     /* Create parent window */
@@ -254,4 +259,5 @@ START_TEST(syslink)
     DestroyWindow(hWndSysLink);
     DestroyWindow(hWndParent);
     unload_v6_module(ctx_cookie, hCtx);
     DestroyWindow(hWndSysLink);
     DestroyWindow(hWndParent);
     unload_v6_module(ctx_cookie, hCtx);
+    SetCursorPos(orig_pos.x, orig_pos.y);
 }
 }
index efad00a..7dcdadb 100644 (file)
@@ -1235,11 +1235,8 @@ static DWORD tbsize_alt_numtests = 0;
                        EqualRect(&rc, &tbsize_alt_results[tbsize_alt_numtests].rcButton))) { \
                 win_skip("Alternate rect found\n"); \
                 tbsize_alt_numtests++; \
                        EqualRect(&rc, &tbsize_alt_results[tbsize_alt_numtests].rcButton))) { \
                 win_skip("Alternate rect found\n"); \
                 tbsize_alt_numtests++; \
-            } else if (!(mask&1)) { \
+            } else todo_wine_if(mask&1) \
                 check_rect("button = %d, tbsize_numtests = %d", rc, res->prcButtons[i], i, tbsize_numtests); \
                 check_rect("button = %d, tbsize_numtests = %d", rc, res->prcButtons[i], i, tbsize_numtests); \
-            } else {\
-                todo_wine { check_rect("button = %d, tbsize_numtests = %d", rc, res->prcButtons[i], i, tbsize_numtests); } \
-            } \
             mask >>= 1; \
         } \
         tbsize_numtests++; \
             mask >>= 1; \
         } \
         tbsize_numtests++; \
index 48d0cbd..a6d5a2c 100644 (file)
@@ -156,6 +156,7 @@ static void test_customdraw(void) {
    DWORD       iterationNumber;
    WNDCLASSA wc;
    LRESULT   lResult;
    DWORD       iterationNumber;
    WNDCLASSA wc;
    LRESULT   lResult;
+   POINT orig_pos;
 
    /* Create a class to use the custom draw wndproc */
    wc.style = CS_HREDRAW | CS_VREDRAW;
 
    /* Create a class to use the custom draw wndproc */
    wc.style = CS_HREDRAW | CS_VREDRAW;
@@ -170,6 +171,8 @@ static void test_customdraw(void) {
    wc.lpfnWndProc = custom_draw_wnd_proc;
    RegisterClassA(&wc);
 
    wc.lpfnWndProc = custom_draw_wnd_proc;
    RegisterClassA(&wc);
 
+   GetCursorPos(&orig_pos);
+
    for (iterationNumber = 0;
         iterationNumber < sizeof(expectedResults)/sizeof(expectedResults[0]);
         iterationNumber++) {
    for (iterationNumber = 0;
         iterationNumber < sizeof(expectedResults)/sizeof(expectedResults[0]);
         iterationNumber++) {
@@ -242,7 +245,7 @@ static void test_customdraw(void) {
        DestroyWindow(parent);
    }
 
        DestroyWindow(parent);
    }
 
-
+   SetCursorPos(orig_pos.x, orig_pos.y);
 }
 
 static const CHAR testcallbackA[]  = "callback";
 }
 
 static const CHAR testcallbackA[]  = "callback";
index f1c227e..59036b6 100644 (file)
@@ -2369,6 +2369,30 @@ static void test_WM_KEYDOWN(void)
     DestroyWindow(hwnd);
 }
 
     DestroyWindow(hwnd);
 }
 
+static void test_TVS_FULLROWSELECT(void)
+{
+    DWORD style;
+    HWND hwnd;
+
+    /* try to create both with TVS_HASLINES and TVS_FULLROWSELECT */
+    hwnd = create_treeview_control(TVS_FULLROWSELECT);
+
+    style = GetWindowLongA(hwnd, GWL_STYLE);
+    ok((style & (TVS_FULLROWSELECT | TVS_HASLINES)) == (TVS_FULLROWSELECT | TVS_HASLINES), "got style 0x%08x\n", style);
+
+    DestroyWindow(hwnd);
+
+    /* create just with TVS_HASLINES, try to enable TVS_FULLROWSELECT later */
+    hwnd = create_treeview_control(0);
+
+    style = GetWindowLongA(hwnd, GWL_STYLE);
+    SetWindowLongA(hwnd, GWL_STYLE, style | TVS_FULLROWSELECT);
+    style = GetWindowLongA(hwnd, GWL_STYLE);
+    ok(style & TVS_FULLROWSELECT, "got style 0x%08x\n", style);
+
+    DestroyWindow(hwnd);
+}
+
 START_TEST(treeview)
 {
     HMODULE hComctl32;
 START_TEST(treeview)
 {
     HMODULE hComctl32;
@@ -2444,6 +2468,7 @@ START_TEST(treeview)
     test_WM_GETDLGCODE();
     test_customdraw();
     test_WM_KEYDOWN();
     test_WM_GETDLGCODE();
     test_customdraw();
     test_WM_KEYDOWN();
+    test_TVS_FULLROWSELECT();
 
     if (!load_v6_module(&ctx_cookie, &hCtx))
     {
 
     if (!load_v6_module(&ctx_cookie, &hCtx))
     {