user32: Remove side effect code out of asserts() (Coverity).

This commit is contained in:
Marcus Meissner 2011-02-23 17:38:23 +01:00 committed by Alexandre Julliard
parent 89e662084f
commit a91b0e4544
1 changed files with 18 additions and 9 deletions

View File

@ -2038,6 +2038,7 @@ static void test_menu_input(void) {
HINSTANCE hInstance = GetModuleHandleA( NULL ); HINSTANCE hInstance = GetModuleHandleA( NULL );
HANDLE hThread, hWnd; HANDLE hThread, hWnd;
DWORD tid; DWORD tid;
ATOM aclass;
if (!pSendInput) if (!pSendInput)
{ {
@ -2055,11 +2056,14 @@ static void test_menu_input(void) {
wclass.lpszMenuName = 0; wclass.lpszMenuName = 0;
wclass.cbClsExtra = 0; wclass.cbClsExtra = 0;
wclass.cbWndExtra = 0; wclass.cbWndExtra = 0;
assert (RegisterClassA( &wclass )); aclass = RegisterClassA( &wclass );
assert (hWnd = CreateWindowA( wclass.lpszClassName, "MenuTest", ok (aclass, "MenuTest class not created\n");
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, if (!aclass) return;
400, 200, NULL, NULL, hInstance, NULL) ); hWnd = CreateWindowA( wclass.lpszClassName, "MenuTest",
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0,
400, 200, NULL, NULL, hInstance, NULL);
ok (hWnd != NULL, "MenuTest window not created\n");
if (!hWnd) return;
/* fixed menus */ /* fixed menus */
hMenus[3] = CreatePopupMenu(); hMenus[3] = CreatePopupMenu();
AppendMenu(hMenus[3], MF_STRING, 0, "&Enabled"); AppendMenu(hMenus[3], MF_STRING, 0, "&Enabled");
@ -2125,6 +2129,7 @@ static void test_menu_hilitemenuitem( void )
HMENU hMenu, hPopupMenu; HMENU hMenu, hPopupMenu;
WNDCLASSA wclass; WNDCLASSA wclass;
HWND hWnd; HWND hWnd;
ATOM aclass;
wclass.lpszClassName = "HiliteMenuTestClass"; wclass.lpszClassName = "HiliteMenuTestClass";
wclass.style = CS_HREDRAW | CS_VREDRAW; wclass.style = CS_HREDRAW | CS_VREDRAW;
@ -2136,10 +2141,14 @@ static void test_menu_hilitemenuitem( void )
wclass.lpszMenuName = 0; wclass.lpszMenuName = 0;
wclass.cbClsExtra = 0; wclass.cbClsExtra = 0;
wclass.cbWndExtra = 0; wclass.cbWndExtra = 0;
assert (RegisterClassA( &wclass )); aclass = RegisterClassA( &wclass );
assert (hWnd = CreateWindowA( wclass.lpszClassName, "HiliteMenuTest", ok (aclass, "HiliteMenuTest class could not be created\n");
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, if (!aclass) return;
400, 200, NULL, NULL, wclass.hInstance, NULL) ); hWnd = CreateWindowA( wclass.lpszClassName, "HiliteMenuTest",
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0,
400, 200, NULL, NULL, wclass.hInstance, NULL);
ok (hWnd != NULL, "HiliteMenuTest window could not be created\n");
if (!hWnd) return;
hMenu = CreateMenu(); hMenu = CreateMenu();
hPopupMenu = CreatePopupMenu(); hPopupMenu = CreatePopupMenu();