winsock/tests: select() conformance test improvements.
Add OK tests around more function calls. Add two more todo_wine tests that fail.
This commit is contained in:
parent
38290cf977
commit
96a46367a9
|
@ -1319,26 +1319,45 @@ static void test_WSAStringToAddressW(void)
|
||||||
|
|
||||||
static void test_select(void)
|
static void test_select(void)
|
||||||
{
|
{
|
||||||
SOCKET fd;
|
SOCKET fdRead, fdWrite;
|
||||||
|
fd_set readfds, writefds, exceptfds;
|
||||||
fd = socket(AF_INET, SOCK_STREAM, 0);
|
int maxfd;
|
||||||
if (fd != INVALID_SOCKET)
|
int ret;
|
||||||
{
|
|
||||||
fd_set readfds;
|
|
||||||
struct timeval select_timeout;
|
struct timeval select_timeout;
|
||||||
|
|
||||||
|
fdRead = socket(AF_INET, SOCK_STREAM, 0);
|
||||||
|
ok( (fdRead != INVALID_SOCKET), "socket failed unexpectedly: %d\n", WSAGetLastError() );
|
||||||
|
fdWrite = socket(AF_INET, SOCK_STREAM, 0);
|
||||||
|
ok( (fdWrite != INVALID_SOCKET), "socket failed unexpectedly: %d\n", WSAGetLastError() );
|
||||||
|
|
||||||
FD_ZERO(&readfds);
|
FD_ZERO(&readfds);
|
||||||
FD_SET(fd, &readfds);
|
FD_ZERO(&writefds);
|
||||||
|
FD_ZERO(&exceptfds);
|
||||||
|
FD_SET(fdRead, &readfds);
|
||||||
|
FD_SET(fdWrite, &writefds);
|
||||||
|
FD_SET(fdRead, &exceptfds);
|
||||||
|
FD_SET(fdWrite, &exceptfds);
|
||||||
select_timeout.tv_sec=2;
|
select_timeout.tv_sec=2;
|
||||||
select_timeout.tv_usec=0;
|
select_timeout.tv_usec=0;
|
||||||
|
|
||||||
|
maxfd = fdRead;
|
||||||
|
if (fdWrite > maxfd)
|
||||||
|
maxfd = fdWrite;
|
||||||
|
|
||||||
todo_wine {
|
todo_wine {
|
||||||
if (select((int) fd+1, &readfds, NULL, NULL, &select_timeout) != SOCKET_ERROR)
|
ret = select(maxfd+1, &readfds, &writefds, &exceptfds, &select_timeout);
|
||||||
ok(!FD_ISSET(fd, &readfds), "FD should not be set\n");
|
ok ( (ret == 0), "select should not return any socket handles\n");
|
||||||
|
ok ( !FD_ISSET(fdRead, &readfds), "FD should not be set\n");
|
||||||
|
ok ( !FD_ISSET(fdWrite, &writefds), "FD should not be set\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
closesocket(fd);
|
ok ( !FD_ISSET(fdRead, &exceptfds), "FD should not be set\n");
|
||||||
}
|
ok ( !FD_ISSET(fdWrite, &exceptfds), "FD should not be set\n");
|
||||||
|
|
||||||
|
ret = closesocket(fdRead);
|
||||||
|
ok ( (ret == 0), "closesocket failed unexpectedly: %d\n", ret);
|
||||||
|
ret = closesocket(fdWrite);
|
||||||
|
ok ( (ret == 0), "closesocket failed unexpectedly: %d\n", ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************** Main program ***************/
|
/**************** Main program ***************/
|
||||||
|
|
Loading…
Reference in New Issue