Commit 1d8b70fc authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

ws2_32/tests: Avoid races.

parent fb6b0f93
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment