user32/tests: Ignore other messages in test_broadcast.
If the SendMessageTimeout call takes a long time, we can get other messages which also set the observed wparam value. Apparently, this is especially likely on Windows 7. This also removes the (wParam == 0xbaadbeef) check which may have been intended to serve the same goal but doesn't work because the observed wParam value is still assigned. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54194
This commit is contained in:
parent
f081205b92
commit
b61ff6df21
1 changed files with 5 additions and 4 deletions
|
@ -17847,14 +17847,13 @@ static void test_PostMessage(void)
|
|||
}
|
||||
|
||||
static WPARAM g_broadcast_wparam;
|
||||
static UINT g_broadcast_msg;
|
||||
static LRESULT WINAPI broadcast_test_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
WNDPROC oldproc = (WNDPROC)GetWindowLongPtrA(hwnd, GWLP_USERDATA);
|
||||
|
||||
if (wParam == 0xbaadbeef)
|
||||
if (message == g_broadcast_msg)
|
||||
g_broadcast_wparam = wParam;
|
||||
else
|
||||
g_broadcast_wparam = 0;
|
||||
|
||||
return CallWindowProcA(oldproc, hwnd, message, wParam, lParam);
|
||||
}
|
||||
|
@ -17864,7 +17863,8 @@ static LRESULT WINAPI broadcast_test_sub_proc(HWND hwnd, UINT message, WPARAM wP
|
|||
{
|
||||
int sub_index = GetWindowLongPtrA(hwnd, GWLP_USERDATA);
|
||||
|
||||
g_broadcast_sub_wparam[sub_index] = (wParam == 0xbaadbeef) ? wParam : 0;
|
||||
if (message == g_broadcast_msg)
|
||||
g_broadcast_sub_wparam[sub_index] = wParam;
|
||||
|
||||
return CallWindowProcA(g_oldproc_sub[sub_index], hwnd, message, wParam, lParam);
|
||||
}
|
||||
|
@ -17966,6 +17966,7 @@ static void test_broadcast(void)
|
|||
g_broadcast_wparam = 0xdead;
|
||||
for (j = 0; j < ARRAY_SIZE(bcast_expect); j++)
|
||||
g_broadcast_sub_wparam[j] = 0xdead;
|
||||
g_broadcast_msg = messages[i];
|
||||
ret = SendMessageTimeoutA(HWND_BROADCAST, messages[i], 0xbaadbeef, 0, SMTO_NORMAL, 2000, NULL);
|
||||
if (!ret && GetLastError() == ERROR_TIMEOUT)
|
||||
win_skip("broadcasting test %d, timeout\n", i);
|
||||
|
|
Loading…
Add table
Reference in a new issue