mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 11:43:31 +00:00
ws2_32/tests: Fix the GetAcceptExSockaddrs() test.
This commit is contained in:
parent
665717ae75
commit
867615419e
1 changed files with 8 additions and 6 deletions
|
@ -4771,6 +4771,7 @@ static void test_AcceptEx(void)
|
|||
ok(!iret, "getsockopt failed %d\n", WSAGetLastError());
|
||||
ok(connect_time == ~0u, "unexpected connect time %u\n", connect_time);
|
||||
|
||||
/* AcceptEx() still won't complete until we send data */
|
||||
iret = connect(connector, (struct sockaddr*)&bindAddress, sizeof(bindAddress));
|
||||
ok(iret == 0, "connecting to accepting socket failed, error %d\n", WSAGetLastError());
|
||||
|
||||
|
@ -4786,6 +4787,13 @@ static void test_AcceptEx(void)
|
|||
iret = getsockname( connector, (struct sockaddr *)&peerAddress, &remoteSize);
|
||||
ok( !iret, "getsockname failed.\n");
|
||||
|
||||
/* AcceptEx() could complete any time now */
|
||||
iret = send(connector, buffer, 1, 0);
|
||||
ok(iret == 1, "could not send 1 byte: send %d errno %d\n", iret, WSAGetLastError());
|
||||
|
||||
dwret = WaitForSingleObject(overlapped.hEvent, 1000);
|
||||
ok(dwret == WAIT_OBJECT_0, "Waiting for accept event failed with %d + errno %d\n", dwret, GetLastError());
|
||||
|
||||
/* Check if the buffer from AcceptEx is decoded correctly */
|
||||
pGetAcceptExSockaddrs(buffer, 2, sizeof(struct sockaddr_in) + 16, sizeof(struct sockaddr_in) + 16,
|
||||
(struct sockaddr **)&readBindAddress, &localSize,
|
||||
|
@ -4805,12 +4813,6 @@ static void test_AcceptEx(void)
|
|||
"Remote socket port is different: %d != %d\n",
|
||||
readRemoteAddress->sin_port, peerAddress.sin_port);
|
||||
|
||||
iret = send(connector, buffer, 1, 0);
|
||||
ok(iret == 1, "could not send 1 byte: send %d errno %d\n", iret, WSAGetLastError());
|
||||
|
||||
dwret = WaitForSingleObject(overlapped.hEvent, 1000);
|
||||
ok(dwret == WAIT_OBJECT_0, "Waiting for accept event failed with %d + errno %d\n", dwret, GetLastError());
|
||||
|
||||
bret = GetOverlappedResult((HANDLE)listener, &overlapped, &bytesReturned, FALSE);
|
||||
ok(bret, "GetOverlappedResult failed, error %d\n", GetLastError());
|
||||
ok(bytesReturned == 1, "bytesReturned isn't supposed to be %d\n", bytesReturned);
|
||||
|
|
Loading…
Reference in a new issue