Zebediah Figura : ws2_32/tests: Test selecting the same socket twice.

Alexandre Julliard julliard at winehq.org
Thu Dec 30 16:11:35 CST 2021


Module: wine
Branch: master
Commit: b4609ec199432327d678f2aee05503a95a5505f2
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=b4609ec199432327d678f2aee05503a95a5505f2

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Wed Dec 29 15:45:57 2021 -0600

ws2_32/tests: Test selecting the same socket twice.

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 5e16343a577..d4db48d1861 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -3272,6 +3272,16 @@ static void test_select(void)
     ok(ret == 1, "select returned %d\n", ret);
     ok(FD_ISSET(fdWrite, &writefds), "fdWrite socket is not in the set\n");
 
+    /* select the same socket twice */
+    writefds.fd_count = 2;
+    writefds.fd_array[0] = fdWrite;
+    writefds.fd_array[1] = fdWrite;
+    ret = select(0, NULL, &writefds, NULL, &select_timeout);
+    ok(ret == 1, "select returned %d\n", ret);
+    ok(writefds.fd_count == 1, "got count %u\n", writefds.fd_count);
+    ok(writefds.fd_array[0] == fdWrite, "got fd %#Ix\n", writefds.fd_array[0]);
+    ok(writefds.fd_array[1] == fdWrite, "got fd %#Ix\n", writefds.fd_array[1]);
+
     /* tests for overlapping fd_set pointers */
     FD_ZERO(&readfds);
     FD_SET(fdWrite, &readfds);




More information about the wine-cvs mailing list