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
b9bf0060
Commit
b9bf0060
authored
Jun 30, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Jul 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32/tests: Add tests for options which can only be set.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1ccab719
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
sock.c
dlls/ws2_32/tests/sock.c
+42
-0
No files found.
dlls/ws2_32/tests/sock.c
View file @
b9bf0060
...
...
@@ -11011,6 +11011,47 @@ static void test_so_debug(void)
closesocket
(
s
);
}
static
void
test_set_only_options
(
void
)
{
unsigned
int
i
;
int
ret
,
len
;
int
value
;
SOCKET
s
;
static
const
struct
{
int
level
;
int
option
;
}
tests
[]
=
{
{
IPPROTO_IP
,
IP_ADD_MEMBERSHIP
},
{
IPPROTO_IP
,
IP_DROP_MEMBERSHIP
},
{
IPPROTO_IPV6
,
IPV6_ADD_MEMBERSHIP
},
{
IPPROTO_IPV6
,
IPV6_DROP_MEMBERSHIP
},
};
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
tests
);
++
i
)
{
if
(
tests
[
i
].
level
==
IPPROTO_IPV6
)
{
s
=
socket
(
AF_INET6
,
SOCK_STREAM
,
IPPROTO_TCP
);
if
(
s
==
INVALID_SOCKET
)
continue
;
}
else
{
s
=
socket
(
AF_INET
,
SOCK_STREAM
,
IPPROTO_TCP
);
}
len
=
sizeof
(
value
);
ret
=
getsockopt
(
s
,
tests
[
i
].
level
,
tests
[
i
].
option
,
(
char
*
)
&
value
,
&
len
);
ok
(
ret
==
-
1
,
"expected failure
\n
"
);
ok
(
WSAGetLastError
()
==
WSAENOPROTOOPT
,
"got error %u
\n
"
,
WSAGetLastError
());
closesocket
(
s
);
}
}
START_TEST
(
sock
)
{
int
i
;
...
...
@@ -11027,6 +11068,7 @@ START_TEST( sock )
test_ip_pktinfo
();
test_extendedSocketOptions
();
test_so_debug
();
test_set_only_options
();
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
tests
);
i
++
)
do_test
(
&
tests
[
i
]);
...
...
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