Sven Baars : comctl32/tests: Prevent some test failures by moving the cursor away from the window.

Alexandre Julliard julliard at winehq.org
Mon Oct 7 17:02:15 CDT 2019


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

Author: Sven Baars <sven.wine at gmail.com>
Date:   Mon Oct  7 11:19:40 2019 +0200

comctl32/tests: Prevent some test failures by moving the cursor away from the window.

Signed-off-by: Sven Baars <sven.wine at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/comctl32/tests/edit.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/dlls/comctl32/tests/edit.c b/dlls/comctl32/tests/edit.c
index f454434a0c..6013cafb59 100644
--- a/dlls/comctl32/tests/edit.c
+++ b/dlls/comctl32/tests/edit.c
@@ -3315,6 +3315,9 @@ static void test_change_focus(void)
     HWND hwnd, parent_wnd;
     WNDPROC oldproc;
     MSG msg;
+    POINT orig_pos;
+
+    GetCursorPos(&orig_pos);
 
     parent_wnd = CreateWindowA("ParentWnd", "", WS_OVERLAPPEDWINDOW,
             0, 0, 200, 200, NULL, NULL, GetModuleHandleA(NULL), NULL);
@@ -3329,6 +3332,8 @@ static void test_change_focus(void)
     oldproc = (WNDPROC)SetWindowLongPtrA(hwnd, GWLP_WNDPROC, (LONG_PTR)edit_subclass_proc);
     SetWindowLongPtrA(hwnd, GWLP_USERDATA, (LONG_PTR)oldproc);
 
+    SetCursorPos(400, 400);
+
     SetFocus(parent_wnd);
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
     SetFocus(hwnd);
@@ -3340,6 +3345,8 @@ static void test_change_focus(void)
     while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
     ok_sequence(sequences, COMBINED_SEQ_INDEX, killfocus_combined_seq, "Kill focus", TRUE);
 
+    SetCursorPos(orig_pos.x, orig_pos.y);
+
     DestroyWindow(hwnd);
 }
 




More information about the wine-cvs mailing list