Module: wine Branch: master Commit: 5a6cda458d07435ba7dbe3434df6bff0804b0982 URL: http://source.winehq.org/git/wine.git/?a=commit;h=5a6cda458d07435ba7dbe3434d...
Author: Alexandre Julliard julliard@winehq.org Date: Tue Feb 24 21:55:09 2015 +0900
kernel32/tests: Try harder to empty the pipe for completion notification.
---
dlls/kernel32/tests/pipe.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/dlls/kernel32/tests/pipe.c b/dlls/kernel32/tests/pipe.c index 3570676..cf02e15 100644 --- a/dlls/kernel32/tests/pipe.c +++ b/dlls/kernel32/tests/pipe.c @@ -2079,20 +2079,17 @@ static void test_readfileex_pending(void) ok(completion_lpoverlapped == &overlapped, "completion called with wrong overlapped pointer\n");
/* free up some space in the pipe */ - ret = ReadFile(client, read_buf, sizeof(read_buf), &num_bytes, NULL); - 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) + for (i=0; i<256; i++) { ret = ReadFile(client, read_buf, sizeof(read_buf), &num_bytes, NULL); 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); + 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");