Commit 929dcfaa authored by Alexandre Julliard's avatar Alexandre Julliard

user32: Add a bunch of tests for GetQueueStatus and GetMessage combinations.

parent 7804129e
......@@ -9212,6 +9212,82 @@ todo_wine {
ok(qstatus == 0,
"wrong qstatus %08x\n", qstatus);
/* some GetMessage tests */
keybd_event('N', 0, 0, 0);
qstatus = GetQueueStatus(qs_all_input);
ok(qstatus == MAKELONG(QS_KEY, QS_KEY), "wrong qstatus %08x\n", qstatus);
PostMessageA(info.hwnd, WM_CHAR, 'z', 0);
qstatus = GetQueueStatus(qs_all_input);
ok(qstatus == MAKELONG(QS_POSTMESSAGE, QS_POSTMESSAGE|QS_KEY), "wrong qstatus %08x\n", qstatus);
ret = GetMessageA( &msg, 0, 0, 0 );
ok(ret && msg.message == WM_CHAR && msg.wParam == 'z',
"got %d and %04x wParam %08lx instead of TRUE and WM_CHAR wParam 'z'\n",
ret, msg.message, msg.wParam);
qstatus = GetQueueStatus(qs_all_input);
ok(qstatus == MAKELONG(0, QS_KEY), "wrong qstatus %08x\n", qstatus);
ret = GetMessageA( &msg, 0, 0, 0 );
ok(ret && msg.message == WM_KEYDOWN && msg.wParam == 'N',
"got %d and %04x wParam %08lx instead of TRUE and WM_KEYDOWN wParam 'N'\n",
ret, msg.message, msg.wParam);
qstatus = GetQueueStatus(qs_all_input);
ok(qstatus == 0, "wrong qstatus %08x\n", qstatus);
keybd_event('N', 0, 0, 0);
qstatus = GetQueueStatus(qs_all_input);
ok(qstatus == MAKELONG(QS_KEY, QS_KEY), "wrong qstatus %08x\n", qstatus);
PostMessageA(info.hwnd, WM_CHAR, 'z', 0);
qstatus = GetQueueStatus(qs_all_input);
ok(qstatus == MAKELONG(QS_POSTMESSAGE, QS_POSTMESSAGE|QS_KEY), "wrong qstatus %08x\n", qstatus);
ret = GetMessageA( &msg, 0, WM_KEYDOWN, WM_KEYUP );
ok(ret && msg.message == WM_KEYDOWN && msg.wParam == 'N',
"got %d and %04x wParam %08lx instead of TRUE and WM_KEYDOWN wParam 'N'\n",
ret, msg.message, msg.wParam);
qstatus = GetQueueStatus(qs_all_input);
ok(qstatus == MAKELONG(0, QS_POSTMESSAGE), "wrong qstatus %08x\n", qstatus);
ret = GetMessageA( &msg, 0, WM_CHAR, WM_CHAR );
ok(ret && msg.message == WM_CHAR && msg.wParam == 'z',
"got %d and %04x wParam %08lx instead of TRUE and WM_CHAR wParam 'z'\n",
ret, msg.message, msg.wParam);
qstatus = GetQueueStatus(qs_all_input);
ok(qstatus == 0, "wrong qstatus %08x\n", qstatus);
keybd_event('N', 0, KEYEVENTF_KEYUP, 0);
qstatus = GetQueueStatus(qs_all_input);
ok(qstatus == MAKELONG(QS_KEY, QS_KEY), "wrong qstatus %08x\n", qstatus);
PostMessageA(info.hwnd, WM_CHAR, 'z', 0);
qstatus = GetQueueStatus(qs_all_input);
ok(qstatus == MAKELONG(QS_POSTMESSAGE, QS_POSTMESSAGE|QS_KEY), "wrong qstatus %08x\n", qstatus);
trace("signalling to send message\n");
SetEvent(info.hevent[EV_SENDMSG]);
WaitForSingleObject(info.hevent[EV_ACK], INFINITE);
qstatus = GetQueueStatus(qs_all_input);
ok(qstatus == MAKELONG(QS_SENDMESSAGE, QS_SENDMESSAGE|QS_POSTMESSAGE|QS_KEY),
"wrong qstatus %08x\n", qstatus);
ret = GetMessageA( &msg, 0, WM_KEYDOWN, WM_KEYUP );
ok(ret && msg.message == WM_KEYUP && msg.wParam == 'N',
"got %d and %04x wParam %08lx instead of TRUE and WM_KEYDOWN wParam 'N'\n",
ret, msg.message, msg.wParam);
ok_sequence(WmUser, "WmUser", FALSE);
qstatus = GetQueueStatus(qs_all_input);
ok(qstatus == MAKELONG(0, QS_POSTMESSAGE), "wrong qstatus %08x\n", qstatus);
ret = GetMessageA( &msg, 0, WM_CHAR, WM_CHAR );
ok(ret && msg.message == WM_CHAR && msg.wParam == 'z',
"got %d and %04x wParam %08lx instead of TRUE and WM_CHAR wParam 'z'\n",
ret, msg.message, msg.wParam);
qstatus = GetQueueStatus(qs_all_input);
ok(qstatus == 0, "wrong qstatus %08x\n", qstatus);
done:
trace("signalling to exit\n");
SetEvent(info.hevent[EV_STOP]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment