Commit 466de4f4 authored by Alexandre Julliard's avatar Alexandre Julliard

user32/tests: Make sure the message test doesn't hang if the window doesn't have focus.

parent 13eb7342
...@@ -9220,19 +9220,25 @@ todo_wine { ...@@ -9220,19 +9220,25 @@ todo_wine {
qstatus = GetQueueStatus(qs_all_input); qstatus = GetQueueStatus(qs_all_input);
ok(qstatus == MAKELONG(QS_POSTMESSAGE, QS_POSTMESSAGE|QS_KEY), "wrong qstatus %08x\n", qstatus); ok(qstatus == MAKELONG(QS_POSTMESSAGE, QS_POSTMESSAGE|QS_KEY), "wrong qstatus %08x\n", qstatus);
ret = GetMessageA( &msg, 0, 0, 0 ); if (qstatus)
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 = GetMessageA( &msg, 0, 0, 0 );
ret, msg.message, msg.wParam); ok(ret && msg.message == WM_CHAR && msg.wParam == 'z',
qstatus = GetQueueStatus(qs_all_input); "got %d and %04x wParam %08lx instead of TRUE and WM_CHAR wParam 'z'\n",
ok(qstatus == MAKELONG(0, QS_KEY), "wrong qstatus %08x\n", qstatus); 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 ); if (qstatus)
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 = GetMessageA( &msg, 0, 0, 0 );
ret, msg.message, msg.wParam); ok(ret && msg.message == WM_KEYDOWN && msg.wParam == 'N',
qstatus = GetQueueStatus(qs_all_input); "got %d and %04x wParam %08lx instead of TRUE and WM_KEYDOWN wParam 'N'\n",
ok(qstatus == 0, "wrong qstatus %08x\n", qstatus); ret, msg.message, msg.wParam);
qstatus = GetQueueStatus(qs_all_input);
ok(qstatus == 0, "wrong qstatus %08x\n", qstatus);
}
keybd_event('N', 0, 0, 0); keybd_event('N', 0, 0, 0);
qstatus = GetQueueStatus(qs_all_input); qstatus = GetQueueStatus(qs_all_input);
...@@ -9242,19 +9248,25 @@ todo_wine { ...@@ -9242,19 +9248,25 @@ todo_wine {
qstatus = GetQueueStatus(qs_all_input); qstatus = GetQueueStatus(qs_all_input);
ok(qstatus == MAKELONG(QS_POSTMESSAGE, QS_POSTMESSAGE|QS_KEY), "wrong qstatus %08x\n", qstatus); ok(qstatus == MAKELONG(QS_POSTMESSAGE, QS_POSTMESSAGE|QS_KEY), "wrong qstatus %08x\n", qstatus);
ret = GetMessageA( &msg, 0, WM_KEYDOWN, WM_KEYUP ); if (qstatus & (QS_KEY << 16))
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 = GetMessageA( &msg, 0, WM_KEYDOWN, WM_KEYUP );
ret, msg.message, msg.wParam); ok(ret && msg.message == WM_KEYDOWN && msg.wParam == 'N',
qstatus = GetQueueStatus(qs_all_input); "got %d and %04x wParam %08lx instead of TRUE and WM_KEYDOWN wParam 'N'\n",
ok(qstatus == MAKELONG(0, QS_POSTMESSAGE), "wrong qstatus %08x\n", qstatus); 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 ); if (qstatus)
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 = GetMessageA( &msg, 0, WM_CHAR, WM_CHAR );
ret, msg.message, msg.wParam); ok(ret && msg.message == WM_CHAR && msg.wParam == 'z',
qstatus = GetQueueStatus(qs_all_input); "got %d and %04x wParam %08lx instead of TRUE and WM_CHAR wParam 'z'\n",
ok(qstatus == 0, "wrong qstatus %08x\n", qstatus); 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); keybd_event('N', 0, KEYEVENTF_KEYUP, 0);
qstatus = GetQueueStatus(qs_all_input); qstatus = GetQueueStatus(qs_all_input);
...@@ -9271,21 +9283,26 @@ todo_wine { ...@@ -9271,21 +9283,26 @@ todo_wine {
ok(qstatus == MAKELONG(QS_SENDMESSAGE, QS_SENDMESSAGE|QS_POSTMESSAGE|QS_KEY), ok(qstatus == MAKELONG(QS_SENDMESSAGE, QS_SENDMESSAGE|QS_POSTMESSAGE|QS_KEY),
"wrong qstatus %08x\n", qstatus); "wrong qstatus %08x\n", qstatus);
ret = GetMessageA( &msg, 0, WM_KEYDOWN, WM_KEYUP ); if (qstatus & (QS_KEY << 16))
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 = GetMessageA( &msg, 0, WM_KEYDOWN, WM_KEYUP );
ret, msg.message, msg.wParam); ok(ret && msg.message == WM_KEYUP && msg.wParam == 'N',
ok_sequence(WmUser, "WmUser", FALSE); "got %d and %04x wParam %08lx instead of TRUE and WM_KEYDOWN wParam 'N'\n",
qstatus = GetQueueStatus(qs_all_input); ret, msg.message, msg.wParam);
ok(qstatus == MAKELONG(0, QS_POSTMESSAGE), "wrong qstatus %08x\n", qstatus); ok_sequence(WmUser, "WmUser", FALSE);
qstatus = GetQueueStatus(qs_all_input);
ret = GetMessageA( &msg, 0, WM_CHAR, WM_CHAR ); ok(qstatus == MAKELONG(0, QS_POSTMESSAGE), "wrong qstatus %08x\n", qstatus);
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);
if (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: done:
trace("signalling to exit\n"); trace("signalling to exit\n");
SetEvent(info.hevent[EV_STOP]); 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