ws2_32/tests: Fix yet another test failure with Vista or older.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
f921ae8bc6
commit
faf66ae944
|
@ -200,6 +200,23 @@ static void tcp_socketpair(SOCKET *src, SOCKET *dst)
|
|||
tcp_socketpair_flags(src, dst, WSA_FLAG_OVERLAPPED);
|
||||
}
|
||||
|
||||
#define check_poll(a, b) check_poll_(__LINE__, a, POLLRDNORM | POLLRDBAND | POLLWRNORM, b, FALSE)
|
||||
#define check_poll_todo(a, b) check_poll_(__LINE__, a, POLLRDNORM | POLLRDBAND | POLLWRNORM, b, TRUE)
|
||||
#define check_poll_mask(a, b, c) check_poll_(__LINE__, a, b, c, FALSE)
|
||||
#define check_poll_mask_todo(a, b, c) check_poll_(__LINE__, a, b, c, TRUE)
|
||||
static void check_poll_(int line, SOCKET s, short mask, short expect, BOOL todo)
|
||||
{
|
||||
WSAPOLLFD pollfd;
|
||||
int ret;
|
||||
|
||||
pollfd.fd = s;
|
||||
pollfd.events = mask;
|
||||
pollfd.revents = 0xdead;
|
||||
ret = pWSAPoll(&pollfd, 1, 1000);
|
||||
ok_(__FILE__, line)(ret == (pollfd.revents ? 1 : 0), "WSAPoll() returned %d\n", ret);
|
||||
todo_wine_if (todo) ok_(__FILE__, line)(pollfd.revents == expect, "got wrong events %#x\n", pollfd.revents);
|
||||
}
|
||||
|
||||
static void set_so_opentype ( BOOL overlapped )
|
||||
{
|
||||
int optval = !overlapped, newval, len = sizeof (int);
|
||||
|
@ -3763,11 +3780,17 @@ static void test_fionread_siocatmark(void)
|
|||
ret = send(server, "data", 5, 0);
|
||||
ok(ret == 5, "got %d\n", ret);
|
||||
|
||||
/* wait for the data to be available */
|
||||
check_poll_mask(client, POLLRDNORM, POLLRDNORM);
|
||||
|
||||
check_fionread_siocatmark(client, 5, TRUE);
|
||||
|
||||
ret = send(server, "a", 1, MSG_OOB);
|
||||
ok(ret == 1, "got %d\n", ret);
|
||||
|
||||
/* wait for the data to be available */
|
||||
check_poll_mask(client, POLLRDBAND, POLLRDBAND);
|
||||
|
||||
check_fionread_siocatmark_todo_oob(client, 5, FALSE);
|
||||
|
||||
ret = send(server, "a", 1, MSG_OOB);
|
||||
|
@ -5871,23 +5894,6 @@ static void test_write_watch(void)
|
|||
VirtualFree( base, 0, MEM_FREE );
|
||||
}
|
||||
|
||||
#define check_poll(a, b) check_poll_(__LINE__, a, POLLRDNORM | POLLRDBAND | POLLWRNORM, b, FALSE)
|
||||
#define check_poll_todo(a, b) check_poll_(__LINE__, a, POLLRDNORM | POLLRDBAND | POLLWRNORM, b, TRUE)
|
||||
#define check_poll_mask(a, b, c) check_poll_(__LINE__, a, b, c, FALSE)
|
||||
#define check_poll_mask_todo(a, b, c) check_poll_(__LINE__, a, b, c, TRUE)
|
||||
static void check_poll_(int line, SOCKET s, short mask, short expect, BOOL todo)
|
||||
{
|
||||
WSAPOLLFD pollfd;
|
||||
int ret;
|
||||
|
||||
pollfd.fd = s;
|
||||
pollfd.events = mask;
|
||||
pollfd.revents = 0xdead;
|
||||
ret = pWSAPoll(&pollfd, 1, 1000);
|
||||
ok_(__FILE__, line)(ret == (pollfd.revents ? 1 : 0), "WSAPoll() returned %d\n", ret);
|
||||
todo_wine_if (todo) ok_(__FILE__, line)(pollfd.revents == expect, "got wrong events %#x\n", pollfd.revents);
|
||||
}
|
||||
|
||||
static void test_WSAPoll(void)
|
||||
{
|
||||
const struct sockaddr_in bind_addr = {.sin_family = AF_INET, .sin_addr.s_addr = htonl(INADDR_LOOPBACK)};
|
||||
|
|
Loading…
Reference in New Issue