Re: user32: Add test to check the MDI child switching
"Ilya Shpigor" <shpigor(a)etersoft.ru> wrote:
--- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -1674,9 +1674,78 @@ static BOOL mdi_RegisterWindowClasses(void) cls.lpszClassName = "MDI_child_Class_2"; if(!RegisterClassA(&cls)) return FALSE;
+ cls.lpfnWndProc = DefWindowProcW; + cls.lpszClassName = "MDI_parent_Class_def"; + if(!RegisterClassA(&cls)) return FALSE; + + cls.lpfnWndProc = DefMDIChildProcW; + cls.lpszClassName = "MDI_child_Class_def"; + if(!RegisterClassA(&cls)) return FALSE;
The above A/W mishmash can't work.
+HWND CreateNewMDIChild(HWND hMDIClient) +{ + HWND hChild; + + hChild=CreateMDIWindow("MDI_child_Class_def", "MDI child", WS_CHILD | WS_VISIBLE, + CW_USEDEFAULT, + CW_USEDEFAULT, + CW_USEDEFAULT, + CW_USEDEFAULT, + hMDIClient, + GetModuleHandle(NULL), 0); + + if(!hChild) + { + ok(0,"MDI child creation failed\n"); + }
It's better to not use ok(0) statements, and do the actual check inside of ok(), in this case ok(hChild != 0).
+ active = (HWND)SendMessageW(mdi_client, WM_MDIGETACTIVE, 0, 0); + SendMessageW(mdi_client, WM_MDINEXT, 0, 0); + SendMessageW(mdi_client, WM_MDINEXT, 0, 0); + ok(active != (HWND)SendMessageW(mdi_client, WM_MDIGETACTIVE, 0, 0), "MDI child switching error\n");
Wouldn't it be much easier to just add 4 lines above into existing tests? -- Dmitry.
participants (1)
-
Dmitry Timoshkov