Mike Kaplinskiy : ws2_32/tests: Fix the last failures on NT4.

Alexandre Julliard julliard at winehq.org
Wed Jul 22 09:33:53 CDT 2009


Module: wine
Branch: master
Commit: 7b683a9008697c948d58e88cc70d94a5b857ab39
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7b683a9008697c948d58e88cc70d94a5b857ab39

Author: Mike Kaplinskiy <mike.kaplinskiy at gmail.com>
Date:   Tue Jul 21 22:25:45 2009 -0400

ws2_32/tests: Fix the last failures on NT4.

---

 dlls/ws2_32/tests/sock.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index 21502c2..b1b85fe 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -2777,7 +2777,19 @@ static void test_AcceptEx(void)
     bret = pAcceptEx(listener, acceptor, buffer, 0,
         sizeof(struct sockaddr_in) + 16, sizeof(struct sockaddr_in) + 16,
         &bytesReturned, &overlapped);
-    ok(bret == FALSE && WSAGetLastError() == WSAEINVAL, "AcceptEx on already pending socket returned %d + errno %d\n", bret, WSAGetLastError());
+    ok((bret == FALSE && WSAGetLastError() == WSAEINVAL) || broken(bret == FALSE && WSAGetLastError() == ERROR_IO_PENDING) /* NT4 */,
+       "AcceptEx on already pending socket returned %d + errno %d\n", bret, WSAGetLastError());
+    if (bret == FALSE && WSAGetLastError() == ERROR_IO_PENDING) {
+        /* We need to cancel this call, otherwise things fail */
+        bret = CancelIo((HANDLE) listener);
+        ok(bret, "Failed to cancel failed test. Bailing...\n");
+        if (!bret) return;
+
+        bret = pAcceptEx(listener, acceptor, buffer, 0,
+            sizeof(struct sockaddr_in) + 16, sizeof(struct sockaddr_in) + 16,
+            &bytesReturned, &overlapped);
+        ok(bret == FALSE && WSAGetLastError() == ERROR_IO_PENDING, "AcceptEx returned %d + errno %d\n", bret, WSAGetLastError());
+    }
 
     iret = connect(connector, (struct sockaddr*)&bindAddress, sizeof(bindAddress));
     ok(iret == 0, "connecting to accepting socket failed, error %d\n", WSAGetLastError());




More information about the wine-cvs mailing list