Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
65dee2d2
Commit
65dee2d2
authored
Jul 05, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Jul 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32/tests: Fix some connection timeout tests.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
780e5c83
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
10 deletions
+26
-10
afd.c
dlls/ws2_32/tests/afd.c
+4
-2
sock.c
dlls/ws2_32/tests/sock.c
+22
-8
No files found.
dlls/ws2_32/tests/afd.c
View file @
65dee2d2
...
...
@@ -448,7 +448,8 @@ static void test_poll(void)
addr
.
sin_port
=
255
;
ret
=
connect
(
client
,
(
struct
sockaddr
*
)
&
addr
,
sizeof
(
addr
));
ok
(
!
ret
||
WSAGetLastError
()
==
WSAEWOULDBLOCK
,
"got error %u
\n
"
,
WSAGetLastError
());
ok
(
ret
==
-
1
,
"got %d
\n
"
,
ret
);
ok
(
WSAGetLastError
()
==
WSAEWOULDBLOCK
,
"got error %u
\n
"
,
WSAGetLastError
());
ret
=
WaitForSingleObject
(
event
,
10000
);
ok
(
!
ret
,
"got %#x
\n
"
,
ret
);
...
...
@@ -474,6 +475,7 @@ static void test_poll(void)
server
=
accept
(
listener
,
NULL
,
NULL
);
ok
(
server
!=
-
1
,
"got error %u
\n
"
,
WSAGetLastError
());
in_params
->
timeout
=
-
1000
*
10000
;
in_params
->
count
=
2
;
in_params
->
sockets
[
0
].
socket
=
client
;
in_params
->
sockets
[
0
].
flags
=
AFD_POLL_READ
;
...
...
@@ -1310,7 +1312,7 @@ static void test_get_events(void)
ok
(
ret
==
-
1
,
"expected failure
\n
"
);
ok
(
WSAGetLastError
()
==
WSAEWOULDBLOCK
,
"got error %u
\n
"
,
WSAGetLastError
());
ret
=
WaitForSingleObject
(
event
,
2
000
);
ret
=
WaitForSingleObject
(
event
,
10
000
);
ok
(
!
ret
,
"got %#x
\n
"
,
ret
);
memset
(
&
params
,
0xcc
,
sizeof
(
params
));
...
...
dlls/ws2_32/tests/sock.c
View file @
65dee2d2
...
...
@@ -3252,17 +3252,20 @@ static void test_select(void)
FD_SET
(
fdWrite
,
&
exceptfds
);
select_timeout
.
tv_sec
=
10
;
ret
=
select
(
0
,
&
readfds
,
&
writefds
,
&
exceptfds
,
&
select_timeout
);
ok
(
ret
==
1
,
"expected 1, got %d
\n
"
,
ret
);
todo_wine
ok
(
ret
==
1
,
"expected 1, got %d
\n
"
,
ret
);
len
=
sizeof
(
id
);
id
=
0xdeadbeef
;
ret
=
getsockopt
(
fdWrite
,
SOL_SOCKET
,
SO_ERROR
,
(
char
*
)
&
id
,
&
len
);
ok
(
!
ret
,
"getsockopt failed with %d
\n
"
,
WSAGetLastError
());
ok
(
id
==
WSAECONNREFUSED
,
"expected 10061, got %d
\n
"
,
id
);
ok
(
FD_ISSET
(
fdWrite
,
&
exceptfds
),
"fdWrite socket is not in the set
\n
"
);
todo_wine
ok
(
id
==
WSAECONNREFUSED
,
"got error %u
\n
"
,
id
);
todo_wine
ok
(
FD_ISSET
(
fdWrite
,
&
exceptfds
),
"fdWrite socket is not in the set
\n
"
);
ok
(
select_timeout
.
tv_usec
==
250000
,
"select timeout should not have changed
\n
"
);
closesocket
(
fdWrite
);
}
select_timeout
.
tv_sec
=
1
;
select_timeout
.
tv_usec
=
250000
;
/* Try select() on a closed socket after connection */
tcp_socketpair
(
&
fdRead
,
&
fdWrite
);
closesocket
(
fdRead
);
...
...
@@ -6372,22 +6375,33 @@ static void test_WSAPoll(void)
* so make the test interactive-only. */
if
(
winetest_interactive
)
{
const
struct
sockaddr_in
invalid_addr
=
{.
sin_family
=
AF_INET
,
.
sin_addr
.
s_addr
=
inet_addr
(
"192.0.2.0"
)};
const
struct
sockaddr_in
invalid_addr
=
{
.
sin_family
=
AF_INET
,
.
sin_addr
.
s_addr
=
htonl
(
INADDR_LOOPBACK
),
.
sin_port
=
255
,
};
SOCKET
client
;
client
=
setup_connector_socket
(
&
invalid_addr
,
sizeof
(
invalid_addr
),
TRUE
);
client
=
socket
(
AF_INET
,
SOCK_STREAM
,
IPPROTO_TCP
);
set_blocking
(
client
,
FALSE
);
ret
=
connect
(
client
,
(
const
struct
sockaddr
*
)
&
invalid_addr
,
sizeof
(
invalid_addr
));
ok
(
ret
==
-
1
,
"got %d
\n
"
,
ret
);
ok
(
WSAGetLastError
()
==
WSAEWOULDBLOCK
,
"got error %u
\n
"
,
WSAGetLastError
());
fds
[
0
].
fd
=
client
;
fds
[
0
].
events
=
POLLRDNORM
|
POLLRDBAND
|
POLLWRNORM
;
fds
[
0
].
revents
=
0xdead
;
ret
=
pWSAPoll
(
fds
,
1
,
10000
);
ok
(
ret
==
1
,
"got %d
\n
"
,
ret
);
ok
(
fds
[
0
].
revents
==
POLLERR
,
"got events %#x
\n
"
,
fds
[
0
].
revents
);
todo_wine
ok
(
ret
==
1
,
"got %d
\n
"
,
ret
);
todo_wine
ok
(
fds
[
0
].
revents
==
(
POLLWRNORM
|
POLLHUP
|
POLLERR
)
,
"got events %#x
\n
"
,
fds
[
0
].
revents
);
len
=
sizeof
(
err
);
err
=
0xdeadbeef
;
ret
=
getsockopt
(
client
,
SOL_SOCKET
,
SO_ERROR
,
(
char
*
)
&
err
,
&
len
);
ok
(
!
ret
,
"getsockopt failed with %d
\n
"
,
WSAGetLastError
());
ok
(
err
==
WSAECONNREFUSED
,
"expected 10061, got %d
\n
"
,
err
);
todo_wine
ok
(
err
==
WSAECONNREFUSED
,
"got error %u
\n
"
,
err
);
closesocket
(
client
);
}
...
...
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