ws2_32/tests: Avoid races.
This commit is contained in:
parent
fb6b0f93c2
commit
1d8b70fca4
|
@ -5468,6 +5468,8 @@ static void test_completion_port(void)
|
||||||
ok(iret == SOCKET_ERROR, "WSARecv returned %d\n", iret);
|
ok(iret == SOCKET_ERROR, "WSARecv returned %d\n", iret);
|
||||||
ok(GetLastError() == ERROR_IO_PENDING, "Last error was %d\n", GetLastError());
|
ok(GetLastError() == ERROR_IO_PENDING, "Last error was %d\n", GetLastError());
|
||||||
|
|
||||||
|
Sleep(100);
|
||||||
|
|
||||||
closesocket(src);
|
closesocket(src);
|
||||||
src = INVALID_SOCKET;
|
src = INVALID_SOCKET;
|
||||||
|
|
||||||
|
@ -5523,6 +5525,9 @@ static void test_completion_port(void)
|
||||||
|
|
||||||
closesocket(src);
|
closesocket(src);
|
||||||
src = INVALID_SOCKET;
|
src = INVALID_SOCKET;
|
||||||
|
|
||||||
|
Sleep(100);
|
||||||
|
|
||||||
num_bytes = 0xdeadbeef;
|
num_bytes = 0xdeadbeef;
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
|
|
||||||
|
@ -5947,6 +5952,8 @@ static void test_completion_port(void)
|
||||||
iret = send(connector, buf, 1, 0);
|
iret = send(connector, buf, 1, 0);
|
||||||
ok(iret == 1, "could not send 1 byte: send %d errno %d\n", iret, WSAGetLastError());
|
ok(iret == 1, "could not send 1 byte: send %d errno %d\n", iret, WSAGetLastError());
|
||||||
|
|
||||||
|
Sleep(100);
|
||||||
|
|
||||||
closesocket(dest);
|
closesocket(dest);
|
||||||
dest = INVALID_SOCKET;
|
dest = INVALID_SOCKET;
|
||||||
|
|
||||||
|
@ -6022,12 +6029,15 @@ static void test_completion_port(void)
|
||||||
|
|
||||||
bret = GetQueuedCompletionStatus(io_port, &num_bytes, &key, &olp, 100);
|
bret = GetQueuedCompletionStatus(io_port, &num_bytes, &key, &olp, 100);
|
||||||
ok(bret == FALSE, "failed to get completion status %u\n", bret);
|
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(key == 125, "Key is %lu\n", key);
|
||||||
ok(num_bytes == 0, "Number of bytes transferred is %u\n", num_bytes);
|
ok(num_bytes == 0, "Number of bytes transferred is %u\n", num_bytes);
|
||||||
ok(olp == &ov, "Overlapped structure is at %p\n", olp);
|
ok(olp == &ov, "Overlapped structure is at %p\n", olp);
|
||||||
todo_wine ok(olp && ((olp->Internal == (ULONG)STATUS_LOCAL_DISCONNECT)
|
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);
|
olp->Internal == (ULONG)STATUS_CANCELLED ||
|
||||||
|
olp->Internal == (ULONG)STATUS_CONNECTION_ABORTED), "Internal status is %lx\n", olp ? olp->Internal : 0);
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
key = 0xdeadbeef;
|
key = 0xdeadbeef;
|
||||||
|
|
Loading…
Reference in New Issue