Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
3d51b4eb
Commit
3d51b4eb
authored
Jun 07, 2015
by
Sebastian Lackner
Committed by
Alexandre Julliard
Jun 08, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32/tests: Add tests for calling select with zero timeout.
parent
d4bbcc44
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
11 deletions
+27
-11
sock.c
dlls/ws2_32/tests/sock.c
+27
-11
No files found.
dlls/ws2_32/tests/sock.c
View file @
3d51b4eb
...
...
@@ -3523,30 +3523,46 @@ static void test_select(void)
struct
sockaddr_in
address
;
select_thread_params
thread_params
;
HANDLE
thread_handle
;
DWORD
id
;
DWORD
ticks
,
id
;
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
()
);
maxfd
=
fdRead
;
if
(
fdWrite
>
maxfd
)
maxfd
=
fdWrite
;
FD_ZERO_ALL
();
FD_SET_ALL
(
fdRead
);
FD_SET_ALL
(
fdWrite
);
select_timeout
.
tv_sec
=
0
;
select_timeout
.
tv_usec
=
50
0
;
select_timeout
.
tv_usec
=
0
;
maxfd
=
fdRead
;
if
(
fdWrite
>
maxfd
)
maxfd
=
fdWrite
;
ticks
=
GetTickCount
();
ret
=
select
(
maxfd
+
1
,
&
readfds
,
&
writefds
,
&
exceptfds
,
&
select_timeout
);
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
"
);
ok
(
!
FD_ISSET
(
fdRead
,
&
exceptfds
),
"FD should not be set
\n
"
);
ok
(
!
FD_ISSET
(
fdWrite
,
&
exceptfds
),
"FD should not be set
\n
"
);
ticks
=
GetTickCount
()
-
ticks
;
ok
(
ret
==
0
,
"select should not return any socket handles
\n
"
);
ok
(
ticks
<
10
,
"select was blocking for %u ms, expected < 10 ms
\n
"
,
ticks
);
ok
(
!
FD_ISSET
(
fdRead
,
&
readfds
),
"FD should not be set
\n
"
);
ok
(
!
FD_ISSET
(
fdWrite
,
&
writefds
),
"FD should not be set
\n
"
);
ok
(
!
FD_ISSET
(
fdRead
,
&
exceptfds
),
"FD should not be set
\n
"
);
ok
(
!
FD_ISSET
(
fdWrite
,
&
exceptfds
),
"FD should not be set
\n
"
);
FD_ZERO_ALL
();
FD_SET_ALL
(
fdRead
);
FD_SET_ALL
(
fdWrite
);
select_timeout
.
tv_sec
=
0
;
select_timeout
.
tv_usec
=
500
;
ret
=
select
(
maxfd
+
1
,
&
readfds
,
&
writefds
,
&
exceptfds
,
&
select_timeout
);
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
"
);
ok
(
!
FD_ISSET
(
fdRead
,
&
exceptfds
),
"FD should not be set
\n
"
);
ok
(
!
FD_ISSET
(
fdWrite
,
&
exceptfds
),
"FD should not be set
\n
"
);
ok
((
listen
(
fdWrite
,
SOMAXCONN
)
==
SOCKET_ERROR
),
"listen did not fail
\n
"
);
ret
=
closesocket
(
fdWrite
);
ok
(
(
ret
==
0
),
"closesocket failed unexpectedly: %d
\n
"
,
ret
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment