ws2_32/tests: Avoid races.

Hans Leidekker hans at codeweavers.com
Tue Jun 25 05:46:10 CDT 2013


---
 dlls/ws2_32/tests/sock.c |   16 +++++++++++++---
 1 file 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;
-- 
1.7.10.4






More information about the wine-patches mailing list