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
13b66d3d
Commit
13b66d3d
authored
Feb 25, 2018
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Feb 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32/tests: Add ioctlsocket(FIONREAD) tests with listening socket.
Signed-off-by:
Akihiro Sagawa
<
sagawa.aki@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0c87c1c4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
sock.c
dlls/ws2_32/tests/sock.c
+33
-0
No files found.
dlls/ws2_32/tests/sock.c
View file @
13b66d3d
...
@@ -5120,6 +5120,7 @@ static void test_ioctlsocket(void)
...
@@ -5120,6 +5120,7 @@ static void test_ioctlsocket(void)
{
{
SOCKET
sock
,
src
,
dst
;
SOCKET
sock
,
src
,
dst
;
struct
tcp_keepalive
kalive
;
struct
tcp_keepalive
kalive
;
struct
sockaddr_in
address
;
int
ret
,
optval
;
int
ret
,
optval
;
static
const
LONG
cmds
[]
=
{
FIONBIO
,
FIONREAD
,
SIOCATMARK
};
static
const
LONG
cmds
[]
=
{
FIONBIO
,
FIONREAD
,
SIOCATMARK
};
UINT
i
,
bytes_rec
;
UINT
i
,
bytes_rec
;
...
@@ -5205,6 +5206,38 @@ static void test_ioctlsocket(void)
...
@@ -5205,6 +5206,38 @@ static void test_ioctlsocket(void)
closesocket
(
sock
);
closesocket
(
sock
);
sock
=
socket
(
AF_INET
,
SOCK_STREAM
,
IPPROTO_TCP
);
ok
(
sock
!=
INVALID_SOCKET
,
"Creating the socket failed: %d
\n
"
,
WSAGetLastError
());
if
(
sock
==
INVALID_SOCKET
)
{
skip
(
"Can't continue without a socket.
\n
"
);
return
;
}
/* test FIONREAD with a fresh and non-connected socket */
arg
=
0xdeadbeef
;
ret
=
ioctlsocket
(
sock
,
FIONREAD
,
&
arg
);
ok
(
ret
==
0
,
"ioctlsocket failed unexpectedly with error %d
\n
"
,
WSAGetLastError
());
ok
(
arg
==
0
,
"expected 0, got %u
\n
"
,
arg
);
memset
(
&
address
,
0
,
sizeof
(
address
));
address
.
sin_family
=
AF_INET
;
address
.
sin_addr
.
s_addr
=
inet_addr
(
SERVERIP
);
address
.
sin_port
=
htons
(
SERVERPORT
);
ret
=
bind
(
sock
,
(
struct
sockaddr
*
)
&
address
,
sizeof
(
address
));
ok
(
ret
==
0
,
"bind failed unexpectedly with error %d
\n
"
,
WSAGetLastError
());
ret
=
listen
(
sock
,
SOMAXCONN
);
ok
(
ret
==
0
,
"listen failed unexpectedly with error %d
\n
"
,
WSAGetLastError
());
/* test FIONREAD with listening socket */
arg
=
0xdeadbeef
;
ret
=
ioctlsocket
(
sock
,
FIONREAD
,
&
arg
);
todo_wine
ok
(
ret
==
0
,
"ioctlsocket failed unexpectedly with error %d
\n
"
,
WSAGetLastError
());
todo_wine
ok
(
arg
==
0
,
"expected 0, got %u
\n
"
,
arg
);
closesocket
(
sock
);
if
(
tcp_socketpair
(
&
src
,
&
dst
)
!=
0
)
if
(
tcp_socketpair
(
&
src
,
&
dst
)
!=
0
)
{
{
ok
(
0
,
"creating socket pair failed, skipping test
\n
"
);
ok
(
0
,
"creating socket pair failed, skipping test
\n
"
);
...
...
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