Module: wine Branch: master Commit: 008a2b46f5360eea86bf94f46dcc30f4714000cb URL: http://source.winehq.org/git/wine.git/?a=commit;h=008a2b46f5360eea86bf94f46d...
Author: Piotr Caban piotr@codeweavers.com Date: Tue Feb 3 16:58:05 2015 +0100
user32/tests: Added GetMessagePos tests.
---
dlls/user32/tests/win.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 404017f..c6dee75 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -7979,6 +7979,67 @@ static void test_smresult(void) CloseHandle(data.thread_replied); }
+static void test_GetMessagePos(void) +{ + HWND button; + DWORD pos; + MSG msg; + + button = CreateWindowExA(0, "button", "button", WS_VISIBLE, + 100, 100, 100, 100, 0, 0, 0, NULL); + ok(button != 0, "CreateWindowExA failed\n"); + + SetCursorPos(120, 140); + flush_events(TRUE); + pos = GetMessagePos(); + ok(pos == MAKELONG(120, 140), "pos = %08x\n", pos); + + SetCursorPos(340, 320); + pos = GetMessagePos(); + ok(pos == MAKELONG(120, 140), "pos = %08x\n", pos); + + SendMessageW(button, WM_APP, 0, 0); + pos = GetMessagePos(); + ok(pos == MAKELONG(120, 140), "pos = %08x\n", pos); + + PostMessageA(button, WM_APP, 0, 0); + GetMessageA(&msg, button, 0, 0); + ok(msg.message == WM_APP, "msg.message = %x\n", msg.message); + pos = GetMessagePos(); + todo_wine ok(pos == MAKELONG(340, 320), "pos = %08x\n", pos); + + PostMessageA(button, WM_APP, 0, 0); + SetCursorPos(350, 330); + GetMessageA(&msg, button, 0, 0); + ok(msg.message == WM_APP, "msg.message = %x\n", msg.message); + pos = GetMessagePos(); + todo_wine ok(pos == MAKELONG(340, 320), "pos = %08x\n", pos); + + PostMessageA(button, WM_APP, 0, 0); + SetCursorPos(320, 340); + PostMessageA(button, WM_APP+1, 0, 0); + pos = GetMessagePos(); + todo_wine ok(pos == MAKELONG(340, 320), "pos = %08x\n", pos); + GetMessageA(&msg, button, 0, 0); + ok(msg.message == WM_APP, "msg.message = %x\n", msg.message); + pos = GetMessagePos(); + todo_wine ok(pos == MAKELONG(350, 330), "pos = %08x\n", pos); + GetMessageA(&msg, button, 0, 0); + ok(msg.message == WM_APP+1, "msg.message = %x\n", msg.message); + pos = GetMessagePos(); + todo_wine ok(pos == MAKELONG(320, 340), "pos = %08x\n", pos); + + SetTimer(button, 1, 250, NULL); + SetCursorPos(330, 350); + GetMessageA(&msg, button, 0, 0); + ok(msg.message == WM_TIMER, "msg.message = %x\n", msg.message); + pos = GetMessagePos(); + todo_wine ok(pos == MAKELONG(330, 350), "pos = %08x\n", pos); + KillTimer(button, 1); + + DestroyWindow(button); +} + START_TEST(win) { char **argv; @@ -8110,6 +8171,7 @@ START_TEST(win) test_update_region(); test_window_without_child_style(); test_smresult(); + test_GetMessagePos();
/* add the tests above this line */ if (hhook) UnhookWindowsHookEx(hhook);