[1/2] ws2_32/tests: Add one more SO_ERROR test

Bruno Jesus 00cpxxx at gmail.com
Tue Apr 14 00:02:08 CDT 2015


Spotted while testing bug https://bugs.winehq.org/show_bug.cgi?id=38399
-------------- next part --------------

---
 dlls/ws2_32/tests/sock.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index c7b3ea7..aa06a08 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -1387,6 +1387,16 @@ todo_wine
         err, WSAGetLastError());
 
     closesocket(s);
+    /* Test with the closed socket */
+    SetLastError(0xdeadbeef);
+    size = sizeof(i);
+    i = 1234;
+    err = getsockopt(s, SOL_SOCKET, SO_ERROR, (char *) &i, &size);
+todo_wine
+    ok( (err == SOCKET_ERROR) && (WSAGetLastError() == WSAENOTSOCK),
+        "got %d with %d (expected SOCKET_ERROR with WSAENOTSOCK)\n",
+        err, WSAGetLastError());
+    ok (i == 1234, "expected 1234, got %d\n", i);
 
     /* Test WS_IP_MULTICAST_TTL with 8, 16, 24 and 32 bits values */
     s = socket(AF_INET, SOCK_DGRAM, 0);
-- 
2.1.4



More information about the wine-patches mailing list