Module: wine Branch: master Commit: 1d8b70fca4224f324f878b286c3178a313e3aef3 URL: http://source.winehq.org/git/wine.git/?a=commit;h=1d8b70fca4224f324f878b286c...
Author: Hans Leidekker hans@codeweavers.com Date: Tue Jun 25 12:46:10 2013 +0200
ws2_32/tests: Avoid races.
---
dlls/ws2_32/tests/sock.c | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index 758fa7e..3e3167a 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -5468,6 +5468,8 @@ static void test_completion_port(void) ok(iret == SOCKET_ERROR, "WSARecv returned %d\n", iret); ok(GetLastError() == ERROR_IO_PENDING, "Last error was %d\n", GetLastError());
+ Sleep(100); + closesocket(src); src = INVALID_SOCKET;
@@ -5523,6 +5525,9 @@ static void test_completion_port(void)
closesocket(src); src = INVALID_SOCKET; + + Sleep(100); + num_bytes = 0xdeadbeef; SetLastError(0xdeadbeef);
@@ -5947,6 +5952,8 @@ static void test_completion_port(void) iret = send(connector, buf, 1, 0); ok(iret == 1, "could not send 1 byte: send %d errno %d\n", iret, WSAGetLastError());
+ Sleep(100); + closesocket(dest); dest = INVALID_SOCKET;
@@ -6022,12 +6029,15 @@ static void test_completion_port(void)
bret = GetQueuedCompletionStatus(io_port, &num_bytes, &key, &olp, 100); ok(bret == FALSE, "failed to get completion status %u\n", bret); - todo_wine ok((GetLastError() == ERROR_NETNAME_DELETED) || (GetLastError() == ERROR_CONNECTION_ABORTED), "Last error was %d\n", GetLastError()); + todo_wine ok(GetLastError() == ERROR_NETNAME_DELETED || + GetLastError() == ERROR_OPERATION_ABORTED || + GetLastError() == ERROR_CONNECTION_ABORTED, "Last error was %d\n", GetLastError()); ok(key == 125, "Key is %lu\n", key); ok(num_bytes == 0, "Number of bytes transferred is %u\n", num_bytes); ok(olp == &ov, "Overlapped structure is at %p\n", olp); - todo_wine ok(olp && ((olp->Internal == (ULONG)STATUS_LOCAL_DISCONNECT) - || (olp->Internal == (ULONG)STATUS_CONNECTION_ABORTED)), "Internal status is %lx\n", olp ? olp->Internal : 0); + todo_wine ok(olp && (olp->Internal == (ULONG)STATUS_LOCAL_DISCONNECT || + olp->Internal == (ULONG)STATUS_CANCELLED || + olp->Internal == (ULONG)STATUS_CONNECTION_ABORTED), "Internal status is %lx\n", olp ? olp->Internal : 0);
SetLastError(0xdeadbeef); key = 0xdeadbeef;