ws2_32/tests: Add UDP select() test for unbound socket

Bruno Jesus 00cpxxx at gmail.com
Mon Jun 15 08:10:20 CDT 2015


Required for https://bugs.winehq.org/show_bug.cgi?id=38752
-------------- next part --------------
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index 610a563..7335faa 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -3868,6 +3868,20 @@ todo_wine
     ok(GetLastError() == WSAENOTSOCK, "expected 10038, got %d\n", GetLastError());
     WaitForSingleObject (thread_handle, 1000);
     closesocket(fdRead);
+
+    /* test UDP behavior of unbound sockets */
+    select_timeout.tv_sec = 0;
+    select_timeout.tv_usec = 250000;
+    fdWrite = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
+    ok(fdWrite != INVALID_SOCKET, "socket call failed\n");
+    FD_ZERO_ALL();
+    FD_SET_ALL(fdWrite);
+    ret = select(0, &readfds, &writefds, &exceptfds, &select_timeout);
+todo_wine
+    ok(ret == 1, "expected 1, got %d\n", ret);
+todo_wine
+    ok(FD_ISSET(fdWrite, &writefds), "fdWrite socket is not in the set\n");
+    closesocket(fdWrite);
 }
 #undef FD_SET_ALL
 #undef FD_ZERO_ALL


More information about the wine-patches mailing list