From: Rémi Bernon rbernon@codeweavers.com
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/user32/tests/win.c | 48 ++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 25 deletions(-)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index ee347fd3e70..0f07e42ae0d 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -1161,10 +1161,11 @@ static LRESULT WINAPI tool_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPAR
static const WCHAR mainclassW[] = {'M','a','i','n','W','i','n','d','o','w','C','l','a','s','s','W',0};
-static BOOL RegisterWindowClasses(void) +static void RegisterWindowClasses(void) { WNDCLASSW clsW; WNDCLASSA cls; + BOOL ret;
cls.style = CS_DBLCLKS; cls.lpfnWndProc = main_window_procA; @@ -1177,7 +1178,8 @@ static BOOL RegisterWindowClasses(void) cls.lpszMenuName = NULL; cls.lpszClassName = "MainWindowClass";
- if(!RegisterClassA(&cls)) return FALSE; + ret = RegisterClassA(&cls); + ok(ret, "RegisterClassA failed, error %lu\n", GetLastError());
clsW.style = CS_DBLCLKS; clsW.lpfnWndProc = main_window_procW; @@ -1190,7 +1192,8 @@ static BOOL RegisterWindowClasses(void) clsW.lpszMenuName = NULL; clsW.lpszClassName = mainclassW;
- if(!RegisterClassW(&clsW)) return FALSE; + ret = RegisterClassW(&clsW); + ok(ret, "RegisterClassW failed, error %lu\n", GetLastError());
cls.style = 0; cls.lpfnWndProc = tool_window_procA; @@ -1203,9 +1206,8 @@ static BOOL RegisterWindowClasses(void) cls.lpszMenuName = NULL; cls.lpszClassName = "ToolWindowClass";
- if(!RegisterClassA(&cls)) return FALSE; - - return TRUE; + ret = RegisterClassA(&cls); + ok(ret, "RegisterClassA failed, error %lu\n", GetLastError()); }
static void verify_window_info(const char *hook, HWND hwnd, const WINDOWINFO *info) @@ -2499,9 +2501,10 @@ static LRESULT WINAPI mdi_main_wnd_procA(HWND hwnd, UINT msg, WPARAM wparam, LPA return DefFrameProcA(hwnd, mdi_client, msg, wparam, lparam); }
-static BOOL mdi_RegisterWindowClasses(void) +static void mdi_RegisterWindowClasses(void) { WNDCLASSA cls; + BOOL ret;
cls.style = 0; cls.lpfnWndProc = mdi_main_wnd_procA; @@ -2513,17 +2516,18 @@ static BOOL mdi_RegisterWindowClasses(void) cls.hbrBackground = GetStockObject(WHITE_BRUSH); cls.lpszMenuName = NULL; cls.lpszClassName = "MDI_parent_Class"; - if(!RegisterClassA(&cls)) return FALSE; + ret = RegisterClassA(&cls); + ok(ret, "RegisterClassA failed, error %lu\n", GetLastError());
cls.lpfnWndProc = mdi_child_wnd_proc_1; cls.lpszClassName = "MDI_child_Class_1"; - if(!RegisterClassA(&cls)) return FALSE; + ret = RegisterClassA(&cls); + ok(ret, "RegisterClassA failed, error %lu\n", GetLastError());
cls.lpfnWndProc = mdi_child_wnd_proc_2; cls.lpszClassName = "MDI_child_Class_2"; - if(!RegisterClassA(&cls)) return FALSE; - - return TRUE; + ret = RegisterClassA(&cls); + ok(ret, "RegisterClassA failed, error %lu\n", GetLastError()); }
static void test_mdi(void) @@ -2536,7 +2540,7 @@ static void test_mdi(void) MSG msg; HMENU frame_menu, child_menu;
- if (!mdi_RegisterWindowClasses()) assert(0); + mdi_RegisterWindowClasses();
mdi_hwndMain = CreateWindowExA(0, "MDI_parent_Class", "MDI parent window", WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | @@ -5994,9 +5998,10 @@ static void test_AWRwindow(LPCSTR class, LONG style, LONG exStyle, BOOL menu) DestroyWindow(hwnd); }
-static BOOL AWR_init(void) +static void AWR_init(void) { WNDCLASSA class; + BOOL ret;
class.style = CS_HREDRAW | CS_VREDRAW; class.lpfnWndProc = DefWindowProcA; @@ -6009,18 +6014,12 @@ static BOOL AWR_init(void) class.lpszMenuName = 0; class.lpszClassName = szAWRClass;
- if (!RegisterClassA(&class)) { - ok(FALSE, "RegisterClass failed\n"); - return FALSE; - } + ret = RegisterClassA(&class); + ok(ret, "RegisterClassA failed, error %lu\n", GetLastError());
hmenu = CreateMenu(); - if (!hmenu) - return FALSE; ok(hmenu != 0, "Failed to create menu\n"); ok(AppendMenuA(hmenu, MF_STRING, 1, "Test!"), "Failed to create menu item\n"); - - return TRUE; }
@@ -6087,8 +6086,7 @@ static void test_AWR_flags(void)
static void test_AdjustWindowRect(void) { - if (!AWR_init()) - return; + AWR_init();
SHOWSYSMETRIC(SM_CYCAPTION); SHOWSYSMETRIC(SM_CYSMCAPTION); @@ -13017,7 +13015,7 @@ START_TEST(win) return; }
- if (!RegisterWindowClasses()) assert(0); + RegisterWindowClasses();
hwndMain = CreateWindowExA(/*WS_EX_TOOLWINDOW*/ 0, "MainWindowClass", "Main window", WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX |