user32/tests: Skip some message tests if we fail to queue events.

This commit is contained in:
Alexandre Julliard 2009-02-20 16:56:16 +01:00
parent 9783f67625
commit 07d9d1fc1f
1 changed files with 14 additions and 2 deletions

View File

@ -9403,8 +9403,13 @@ static void test_PeekMessage2(void)
wait_move_event(hwnd, 100-STEP, 100-STEP); wait_move_event(hwnd, 100-STEP, 100-STEP);
ret = PeekMessageA(&msg, hwnd, WM_MOUSEMOVE, WM_MOUSEMOVE, PM_NOREMOVE); ret = PeekMessageA(&msg, hwnd, WM_MOUSEMOVE, WM_MOUSEMOVE, PM_NOREMOVE);
ok(ret, "no message available\n"); if (!ret)
if (ret) { {
skip( "queuing mouse events not supported\n" );
goto done;
}
else
{
trace("1st move event: %04x %x %d %d\n", msg.message, msg.time, msg.pt.x, msg.pt.y); trace("1st move event: %04x %x %d %d\n", msg.message, msg.time, msg.pt.x, msg.pt.y);
message = msg.message; message = msg.message;
time1 = msg.time; time1 = msg.time;
@ -9453,6 +9458,7 @@ static void test_PeekMessage2(void)
ok(x3 != x2 && y3 != y2, "coords not changed: (%d %d) (%d %d)\n", x2, y2, x3, y3); ok(x3 != x2 && y3 != y2, "coords not changed: (%d %d) (%d %d)\n", x2, y2, x3, y3);
} }
done:
DestroyWindow(hwnd); DestroyWindow(hwnd);
SetCursorPos(pos.x, pos.y); SetCursorPos(pos.x, pos.y);
flush_events(); flush_events();
@ -11269,6 +11275,11 @@ static void test_menu_messages(void)
TranslateMessage(&msg); TranslateMessage(&msg);
DispatchMessage(&msg); DispatchMessage(&msg);
} }
if (!sequence_cnt) /* we didn't get any message */
{
skip( "queuing key events not supported\n" );
goto done;
}
ok_sequence(wm_popup_menu_1, "popup menu command", FALSE); ok_sequence(wm_popup_menu_1, "popup menu command", FALSE);
/* Alt+F, Right, Enter */ /* Alt+F, Right, Enter */
@ -11322,6 +11333,7 @@ static void test_menu_messages(void)
} }
ok_sequence(wm_popup_menu_3, "submenu of a popup menu command", FALSE); ok_sequence(wm_popup_menu_3, "submenu of a popup menu command", FALSE);
done:
DestroyWindow(hwnd); DestroyWindow(hwnd);
DestroyMenu(hmenu); DestroyMenu(hmenu);
} }