kernel32/tests: Try harder to empty the pipe for completion notification.
This commit is contained in:
parent
a5ec8bf8b0
commit
5a6cda458d
|
@ -2079,20 +2079,17 @@ static void test_readfileex_pending(void)
|
||||||
ok(completion_lpoverlapped == &overlapped, "completion called with wrong overlapped pointer\n");
|
ok(completion_lpoverlapped == &overlapped, "completion called with wrong overlapped pointer\n");
|
||||||
|
|
||||||
/* free up some space in the pipe */
|
/* free up some space in the pipe */
|
||||||
ret = ReadFile(client, read_buf, sizeof(read_buf), &num_bytes, NULL);
|
for (i=0; i<256; i++)
|
||||||
ok(ret == TRUE, "ReadFile failed\n");
|
|
||||||
|
|
||||||
ok(completion_called == 0, "completion routine called during ReadFile\n");
|
|
||||||
|
|
||||||
wait = WaitForSingleObjectEx(event, 0, TRUE);
|
|
||||||
ok(wait == WAIT_IO_COMPLETION || wait == WAIT_OBJECT_0, "WaitForSingleObject returned %x\n", wait);
|
|
||||||
if (wait == WAIT_TIMEOUT)
|
|
||||||
{
|
{
|
||||||
ret = ReadFile(client, read_buf, sizeof(read_buf), &num_bytes, NULL);
|
ret = ReadFile(client, read_buf, sizeof(read_buf), &num_bytes, NULL);
|
||||||
ok(ret == TRUE, "ReadFile failed\n");
|
ok(ret == TRUE, "ReadFile failed\n");
|
||||||
|
|
||||||
ok(completion_called == 0, "completion routine called during ReadFile\n");
|
ok(completion_called == 0, "completion routine called during ReadFile\n");
|
||||||
|
|
||||||
wait = WaitForSingleObjectEx(event, 0, TRUE);
|
wait = WaitForSingleObjectEx(event, 0, TRUE);
|
||||||
ok(wait == WAIT_IO_COMPLETION || wait == WAIT_OBJECT_0, "WaitForSingleObject returned %x\n", wait);
|
ok(wait == WAIT_IO_COMPLETION || wait == WAIT_OBJECT_0 || wait == WAIT_TIMEOUT,
|
||||||
|
"WaitForSingleObject returned %x\n", wait);
|
||||||
|
if (wait != WAIT_TIMEOUT) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ok(completion_called == 1, "completion routine not called\n");
|
ok(completion_called == 1, "completion routine not called\n");
|
||||||
|
|
Loading…
Reference in New Issue