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
7e4d075e
Commit
7e4d075e
authored
Jan 06, 2014
by
Bruno Jesus
Committed by
Alexandre Julliard
Jan 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32/tests: Add some FIONREAD tests.
parent
4ec773a0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
1 deletion
+27
-1
sock.c
dlls/ws2_32/tests/sock.c
+27
-1
No files found.
dlls/ws2_32/tests/sock.c
View file @
7e4d075e
...
...
@@ -3859,7 +3859,7 @@ static void test_addr_to_print(void)
static
void
test_ioctlsocket
(
void
)
{
SOCKET
sock
;
SOCKET
sock
,
src
,
dst
;
struct
tcp_keepalive
kalive
;
int
ret
,
optval
;
static
const
LONG
cmds
[]
=
{
FIONBIO
,
FIONREAD
,
SIOCATMARK
};
...
...
@@ -3943,6 +3943,32 @@ static void test_ioctlsocket(void)
ok
(
ret
==
0
||
broken
(
ret
==
SOCKET_ERROR
),
"WSAIoctl failed unexpectedly
\n
"
);
closesocket
(
sock
);
if
(
tcp_socketpair
(
&
src
,
&
dst
)
!=
0
)
{
ok
(
0
,
"creating socket pair failed, skipping test
\n
"
);
return
;
}
/* test FIONREAD on TCP sockets */
optval
=
0xdeadbeef
;
ret
=
WSAIoctl
(
dst
,
FIONREAD
,
NULL
,
0
,
&
optval
,
sizeof
(
optval
),
&
arg
,
NULL
,
NULL
);
ok
(
ret
==
0
,
"WSAIoctl failed unexpectedly with error %d
\n
"
,
WSAGetLastError
());
ok
(
optval
==
0
,
"FIONREAD should have returned 0 bytes, got %d instead
\n
"
,
optval
);
optval
=
0xdeadbeef
;
ok
(
send
(
src
,
"TEST"
,
4
,
0
)
==
4
,
"failed to send test data
\n
"
);
Sleep
(
100
);
ret
=
WSAIoctl
(
dst
,
FIONREAD
,
NULL
,
0
,
&
optval
,
sizeof
(
optval
),
&
arg
,
NULL
,
NULL
);
ok
(
ret
==
0
,
"WSAIoctl failed unexpectedly with error %d
\n
"
,
WSAGetLastError
());
ok
(
optval
==
4
,
"FIONREAD should have returned 4 bytes, got %d instead
\n
"
,
optval
);
closesocket
(
dst
);
optval
=
0xdeadbeef
;
ret
=
WSAIoctl
(
dst
,
FIONREAD
,
NULL
,
0
,
&
optval
,
sizeof
(
optval
),
&
arg
,
NULL
,
NULL
);
ok
(
ret
==
SOCKET_ERROR
,
"WSAIoctl succeeded unexpectedly
\n
"
);
ok
(
optval
==
0xdeadbeef
,
"FIONREAD should not have changed last error, got %d instead
\n
"
,
optval
);
closesocket
(
src
);
}
static
BOOL
drain_pause
=
FALSE
;
...
...
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