From 213419961ce5095f5fd9ba9904ca82e7da71da67 Mon Sep 17 00:00:00 2001 From: Bruno Jesus <00cpxxx@gmail.com> Date: Mon, 15 Jun 2015 10:10:20 -0300 Subject: [PATCH] ws2_32/tests: Add UDP select() test for unbound socket. --- dlls/ws2_32/tests/sock.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index 610a5637453..7335faa3dea 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