ws2_32/tests: Test selecting the same socket twice.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-12-29 15:45:57 -06:00 committed by Alexandre Julliard
parent 9d7f41e702
commit b4609ec199
1 changed files with 10 additions and 0 deletions

View File

@ -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);