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
26136fda
Commit
26136fda
authored
Feb 29, 2024
by
Florian Will
Committed by
Alexandre Julliard
Mar 04, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32/tests: Test TCP_KEEP{ALIVE,CNT,INTVL} options.
parent
6d2a9004
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
1 deletion
+43
-1
sock.c
dlls/ws2_32/tests/sock.c
+43
-1
No files found.
dlls/ws2_32/tests/sock.c
View file @
26136fda
...
...
@@ -1193,6 +1193,7 @@ static void test_set_getsockopt(void)
DWORD
values
[
3
];
BOOL
accepts_large_value
;
BOOL
bool_value
;
BOOL
allow_noprotoopt
;
/* for old windows or wine todo */
}
test_optsize
[]
=
{
...
...
@@ -1210,6 +1211,9 @@ static void test_set_getsockopt(void)
{
AF_INET
,
SOCK_STREAM
,
SOL_SOCKET
,
SO_SNDTIMEO
,
FALSE
,
{
1
,
2
,
4
},
{
0
},
TRUE
},
{
AF_INET
,
SOCK_STREAM
,
SOL_SOCKET
,
SO_OPENTYPE
,
FALSE
,
{
1
,
2
,
4
},
{
0
},
TRUE
},
{
AF_INET
,
SOCK_STREAM
,
IPPROTO_TCP
,
TCP_NODELAY
,
TRUE
,
{
1
,
1
,
1
},
{
0
},
TRUE
},
{
AF_INET
,
SOCK_STREAM
,
IPPROTO_TCP
,
TCP_KEEPALIVE
,
FALSE
,
{
0
,
0
,
4
},
{
0
},
TRUE
,
FALSE
,
TRUE
},
/* wine todo */
{
AF_INET
,
SOCK_STREAM
,
IPPROTO_TCP
,
TCP_KEEPCNT
,
FALSE
,
{
0
,
0
,
4
},
{
0
},
FALSE
,
FALSE
,
TRUE
},
/* win10+, wine todo*/
{
AF_INET
,
SOCK_STREAM
,
IPPROTO_TCP
,
TCP_KEEPINTVL
,
FALSE
,
{
0
,
0
,
4
},
{
0
},
TRUE
,
FALSE
,
TRUE
},
/* win10+, wine todo */
{
AF_INET
,
SOCK_DGRAM
,
IPPROTO_IP
,
IP_MULTICAST_LOOP
,
TRUE
,
{
1
,
1
,
4
},
{
0
},
TRUE
,
TRUE
},
{
AF_INET
,
SOCK_DGRAM
,
IPPROTO_IP
,
IP_MULTICAST_TTL
,
TRUE
,
{
1
,
1
,
4
},
{
0
},
FALSE
},
{
AF_INET
,
SOCK_DGRAM
,
IPPROTO_IP
,
IP_PKTINFO
,
FALSE
,
{
0
,
0
,
4
},
{
0
},
TRUE
,
TRUE
},
...
...
@@ -1453,6 +1457,36 @@ static void test_set_getsockopt(void)
ok
(
!
err
,
"getsockopt TCP_NODELAY failed
\n
"
);
ok
(
!
value
,
"TCP_NODELAY should be 0
\n
"
);
size
=
sizeof
(
DWORD
);
value
=
3600
;
err
=
setsockopt
(
s
,
IPPROTO_TCP
,
TCP_KEEPALIVE
,
(
char
*
)
&
value
,
4
);
todo_wine
ok
(
!
err
,
"setsockopt TCP_KEEPALIVE failed
\n
"
);
value
=
0
;
err
=
getsockopt
(
s
,
IPPROTO_TCP
,
TCP_KEEPALIVE
,
(
char
*
)
&
value
,
&
size
);
todo_wine
ok
(
!
err
,
"getsockopt TCP_KEEPALIVE failed
\n
"
);
todo_wine
ok
(
value
==
3600
,
"TCP_KEEPALIVE should be 3600, is %ld
\n
"
,
value
);
/* TCP_KEEPCNT and TCP_KEEPINTVL are supported on win10 and later */
value
=
5
;
err
=
setsockopt
(
s
,
IPPROTO_TCP
,
TCP_KEEPCNT
,
(
char
*
)
&
value
,
4
);
todo_wine
ok
(
!
err
||
broken
(
WSAGetLastError
()
==
WSAENOPROTOOPT
),
"setsockopt TCP_KEEPCNT failed: %d
\n
"
,
WSAGetLastError
());
if
(
!
err
)
{
value
=
0
;
err
=
getsockopt
(
s
,
IPPROTO_TCP
,
TCP_KEEPCNT
,
(
char
*
)
&
value
,
&
size
);
ok
(
!
err
,
"getsockopt TCP_KEEPCNT failed
\n
"
);
ok
(
value
==
5
,
"TCP_KEEPCNT should be 5, is %ld
\n
"
,
value
);
err
=
setsockopt
(
s
,
IPPROTO_TCP
,
TCP_KEEPINTVL
,
(
char
*
)
&
value
,
4
);
ok
(
!
err
,
"setsockopt TCP_KEEPINTVL failed
\n
"
);
value
=
0
;
err
=
getsockopt
(
s
,
IPPROTO_TCP
,
TCP_KEEPINTVL
,
(
char
*
)
&
value
,
&
size
);
ok
(
!
err
,
"getsockopt TCP_KEEPINTVL failed
\n
"
);
ok
(
value
==
5
,
"TCP_KEEPINTVL should be 5, is %ld
\n
"
,
value
);
}
/* Test for erroneously passing a value instead of a pointer as optval */
size
=
sizeof
(
char
);
err
=
setsockopt
(
s
,
SOL_SOCKET
,
SO_DONTROUTE
,
(
char
*
)
1
,
size
);
...
...
@@ -1517,7 +1551,15 @@ static void test_set_getsockopt(void)
size
=
sizeof
(
save_value
);
err
=
getsockopt
(
s2
,
test_optsize
[
i
].
level
,
test_optsize
[
i
].
optname
,
(
char
*
)
&
save_value
,
&
size
);
ok
(
!
err
,
"Unexpected getsockopt result %d.
\n
"
,
err
);
ok
(
!
err
||
(
test_optsize
[
i
].
allow_noprotoopt
&&
WSAGetLastError
()
==
WSAENOPROTOOPT
),
"Unexpected getsockopt result %d.
\n
"
,
err
);
if
(
err
)
{
closesocket
(
s2
);
winetest_pop_context
();
continue
;
}
value64
=
0xffffffff00000001
;
err
=
setsockopt
(
s2
,
test_optsize
[
i
].
level
,
test_optsize
[
i
].
optname
,
(
char
*
)
&
value64
,
sizeof
(
value64
));
...
...
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