Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/user32/tests/msg.c | 78 +++++++++++++++++++++-------------- dlls/user32/tests/resource.rc | 11 +++++ 2 files changed, 59 insertions(+), 30 deletions(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index b39d0b251b..baa8fe5286 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -123,6 +123,8 @@ static DWORD cbt_hook_thread_id; static const WCHAR testWindowClassW[] = { 'T','e','s','t','W','i','n','d','o','w','C','l','a','s','s','W',0 };
+static LRESULT WINAPI ParentMsgCheckProcA(HWND, UINT, WPARAM, LPARAM); + /* FIXME: add tests for these Window Edge Styles (Win31/Win95/98 look), in order of precedence: @@ -6188,7 +6190,24 @@ static LRESULT CALLBACK button_hook_proc(HWND hwnd, UINT message, WPARAM wParam, case BM_SETSTATE: if (GetCapture()) ok(GetCapture() == hwnd, "GetCapture() = %p\n", GetCapture()); + + lParam = (ULONG_PTR)GetMenu(hwnd); + goto log_it; + + case WM_GETDLGCODE: + if (lParam) + { + MSG *msg = (MSG *)lParam; + lParam = MAKELPARAM(msg->message, msg->wParam); + } + wParam = (ULONG_PTR)GetMenu(hwnd); + goto log_it; + + case BM_SETCHECK: + case BM_GETCHECK: + lParam = (ULONG_PTR)GetMenu(hwnd); /* fall through */ +log_it: default: msg.hwnd = hwnd; msg.message = message; @@ -6670,32 +6689,34 @@ static void test_button_bm_get_set_image(void) ReleaseDC(0, hdc); }
-#define ID_RADIO1 0x00e1 -#define ID_RADIO2 0x00e2 +#define ID_RADIO1 501 +#define ID_RADIO2 502 +#define ID_RADIO3 503 +#define ID_TEXT 504
-static const struct message auto_radio_button_WM_CLICK[] = +static const struct message auto_radio_button_BM_CLICK[] = { { BM_CLICK, sent|wparam|lparam, 0, 0 }, { WM_LBUTTONDOWN, sent|wparam|lparam|defwinproc, 0, 0 }, { EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam, 0, 0 }, - { BM_SETSTATE, sent|wparam|lparam|defwinproc, BST_CHECKED, 0 }, + { BM_SETSTATE, sent|wparam|lparam|defwinproc, BST_CHECKED, ID_RADIO2 }, { WM_CTLCOLORSTATIC, sent|parent }, { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 }, { WM_LBUTTONUP, sent|wparam|lparam|defwinproc, 0, 0 }, - { BM_SETSTATE, sent|wparam|lparam|defwinproc, BST_UNCHECKED, 0 }, + { BM_SETSTATE, sent|wparam|lparam|defwinproc, BST_UNCHECKED, ID_RADIO2 }, { WM_CTLCOLORSTATIC, sent|parent }, { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 }, - { WM_GETDLGCODE, sent|wparam|lparam|defwinproc, 0, 0 }, - { BM_SETCHECK, sent|wparam|lparam|defwinproc, BST_CHECKED, 0 }, - { WM_GETDLGCODE, sent|wparam|lparam|defwinproc, 0, 0 }, - { BM_SETCHECK, sent|wparam|lparam|defwinproc, 0, 0 }, + { WM_GETDLGCODE, sent|wparam|lparam|defwinproc, ID_RADIO2, 0 }, + { BM_SETCHECK, sent|wparam|lparam|defwinproc, BST_CHECKED, ID_RADIO2 }, + { WM_GETDLGCODE, sent|wparam|lparam|defwinproc, ID_RADIO1, 0 }, + { BM_SETCHECK, sent|wparam|lparam|defwinproc, 0, ID_RADIO1 }, { WM_CTLCOLORSTATIC, sent|parent }, { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 }, - { WM_GETDLGCODE, sent|wparam|lparam|defwinproc, 0, 0 }, - { BM_SETCHECK, sent|wparam|lparam|defwinproc, 0, 0 }, + { WM_GETDLGCODE, sent|wparam|lparam|defwinproc, ID_RADIO3, 0 }, + { BM_SETCHECK, sent|wparam|lparam|defwinproc, 0, ID_RADIO3 }, { WM_CTLCOLORSTATIC, sent|parent }, { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 }, - { WM_GETDLGCODE, sent|wparam|lparam|defwinproc, 0, 0 }, + { WM_GETDLGCODE, sent|wparam|lparam|defwinproc, ID_TEXT, 0 }, { EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam, 0, 0 }, { WM_CAPTURECHANGED, sent|wparam|lparam|defwinproc, 0, 0 }, { WM_COMMAND, sent|wparam|parent, MAKEWPARAM(ID_RADIO2, BN_CLICKED) }, @@ -6705,30 +6726,27 @@ static const struct message auto_radio_button_WM_CLICK[] = { 0 } };
-static void test_autoradio_messages(void) +static INT_PTR WINAPI radio_test_dlg_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) { - HWND parent, radio1, radio2, radio3, child; + ParentMsgCheckProcA(hwnd, msg, wp, lp); + return 1; +} + +static void test_autoradio_BM_CLICK(void) +{ + HWND parent, radio1, radio2, radio3; RECT rc; MSG msg; DWORD ret;
subclass_button();
- parent = CreateWindowExA(0, "TestParentClass", "Test parent", WS_OVERLAPPEDWINDOW | WS_VISIBLE, - 100, 100, 200, 200, 0, 0, 0, NULL); + parent = CreateDialogParamA(0, "AUTORADIO_TEST_DIALOG_1", 0, radio_test_dlg_proc, 0); ok(parent != 0, "failed to create parent window\n"); - radio1 = CreateWindowExA(0, "my_button_class", "radio1", WS_VISIBLE | WS_CHILD | WS_GROUP | BS_AUTORADIOBUTTON | BS_NOTIFY, - 0, 0, 70, 18, parent, (HMENU)ID_RADIO1, 0, NULL); - ok(radio1 != 0, "failed to create child window\n"); - radio3 = CreateWindowExA(0, "my_button_class", "radio3", WS_VISIBLE | WS_CHILD | BS_RADIOBUTTON | BS_NOTIFY, - 0, 25, 70, 18, parent, (HMENU)-1, 0, NULL); - ok(radio3 != 0, "failed to create child window\n"); - child = CreateWindowExA(0, "my_button_class", "text", WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON | BS_NOTIFY, - 0, 50, 70, 18, parent, (HMENU)-1, 0, NULL); - ok(child != 0, "failed to create child window\n"); - radio2 = CreateWindowExA(0, "my_button_class", "radio2", WS_VISIBLE | WS_CHILD | BS_AUTORADIOBUTTON | BS_NOTIFY, - 0, 75, 70, 18, parent, (HMENU)ID_RADIO2, 0, NULL); - ok(radio2 != 0, "failed to create child window\n"); + + radio1 = GetDlgItem(parent, ID_RADIO1); + radio2 = GetDlgItem(parent, ID_RADIO2); + radio3 = GetDlgItem(parent, ID_RADIO3);
/* this avoids focus messages in the generated sequence */ SetFocus(radio2); @@ -6780,7 +6798,7 @@ static void test_autoradio_messages(void)
SendMessageA(radio2, BM_CLICK, 0, 0); while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); - ok_sequence(auto_radio_button_WM_CLICK, "BM_CLICK on auto-radio button", FALSE); + ok_sequence(auto_radio_button_BM_CLICK, "BM_CLICK on auto-radio button", FALSE);
log_all_parent_messages--;
@@ -17254,7 +17272,7 @@ START_TEST(msg) test_mdi_messages(); test_button_messages(); test_button_bm_get_set_image(); - test_autoradio_messages(); + test_autoradio_BM_CLICK(); test_static_messages(); test_listbox_messages(); test_combobox_messages(); diff --git a/dlls/user32/tests/resource.rc b/dlls/user32/tests/resource.rc index a9e45e90ce..1557291c14 100644 --- a/dlls/user32/tests/resource.rc +++ b/dlls/user32/tests/resource.rc @@ -75,6 +75,17 @@ FONT 8, "MS Shell Dlg" PUSHBUTTON "Cancel", IDCANCEL,109,20,50,14, WS_TABSTOP | WS_GROUP }
+AUTORADIO_TEST_DIALOG_1 DIALOGEX 0, 0, 200, 200 +STYLE DS_SETFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_VISIBLE +CAPTION "Radio Button Test Dialog" +FONT 8, "MS Shell Dlg" +{ + CONTROL "Radio1",501,"my_button_class",WS_VISIBLE | WS_CHILD | WS_GROUP | BS_AUTORADIOBUTTON | BS_NOTIFY | WS_TABSTOP,10,10,70,18 + CONTROL "Radio3",503,"my_button_class",WS_VISIBLE | WS_CHILD | BS_RADIOBUTTON | BS_NOTIFY | WS_TABSTOP,10,35,70,18 + CONTROL "Text",504,"my_button_class",WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON | BS_NOTIFY | WS_TABSTOP,10,60,70,18 + CONTROL "Radio2",502,"my_button_class",WS_VISIBLE | WS_CHILD | BS_AUTORADIOBUTTON | BS_NOTIFY | WS_TABSTOP,10,85,70,18 +} + CLASS_TEST_DIALOG DIALOG 0, 0, 91, 28 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "CreateDialogParams Test"
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=45071
Your paranoid android.
=== wvistau64 (32 bit report) ===
user32: dce.c:648: Test failed: wrong window
=== wvistau64_he (32 bit report) ===
user32: dce.c:127: Test failed: wrong window
=== w7u (32 bit report) ===
user32: dce.c:658: Test failed: DC for destroyed window not reused
=== w2003std (32 bit report) ===
user32: dde: Timeout
=== w8adm (32 bit report) ===
user32: msg.c:16463: Test failed: SetFocus on a child window: 4: the msg 0x001c was expected, but got msg 0x0047 instead
=== w2003std (32 bit report) ===
user32: sysparams: Timeout
=== wvistau64 (task log) ===
Task errors: TestBot process got stuck or died unexpectedly The previous 1 run(s) terminated abnormally
=== w8 (32 bit report) ===
user32: sysparams.c:2514: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2525: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w8adm (32 bit report) ===
user32: sysparams.c:2514: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2525: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w864 (32 bit report) ===
user32: sysparams.c:2514: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2525: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== wvistau64 (task log) ===
Task errors: TestBot process got stuck or died unexpectedly The previous 1 run(s) terminated abnormally
=== wvistau64 (task log) ===
Task errors: TestBot process got stuck or died unexpectedly The previous 1 run(s) terminated abnormally
=== debian9 (32 bit French report) ===
user32: menu.c:2354: Test failed: test 27 menu: Timeout
=== debian9 (32 bit WoW report) ===
user32: msg.c:8405: Test failed: WaitForSingleObject failed 102 msg.c:8411: Test failed: destroy child on thread exit: 0: the msg 0x0082 was expected, but got msg 0x000f instead msg.c:8411: Test failed: destroy child on thread exit: 1: the msg 0x000f was expected, but got msg 0x0014 instead msg.c:8411: Test failed: destroy child on thread exit: 2: the msg sequence is not complete: expected 0014 - actual 0000