Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
19666ef5
Commit
19666ef5
authored
Feb 20, 2017
by
Bruno Jesus
Committed by
Alexandre Julliard
Feb 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32/tests: Add IP_HDRINCL tests.
Signed-off-by:
Bruno Jesus
<
00cpxxx@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ad7a1a0e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
0 deletions
+72
-0
sock.c
dlls/ws2_32/tests/sock.c
+72
-0
No files found.
dlls/ws2_32/tests/sock.c
View file @
19666ef5
...
...
@@ -1565,6 +1565,8 @@ todo_wine
/* test SO_PROTOCOL_INFO structure returned for different protocols */
for
(
i
=
0
;
i
<
sizeof
(
prottest
)
/
sizeof
(
prottest
[
0
]);
i
++
)
{
int
k
;
s
=
socket
(
prottest
[
i
].
family
,
prottest
[
i
].
type
,
prottest
[
i
].
proto
);
if
(
s
==
INVALID_SOCKET
&&
prottest
[
i
].
family
==
AF_INET6
)
continue
;
...
...
@@ -1609,6 +1611,76 @@ todo_wine
ok
(
infoA
.
iProtocol
==
prottest
[
i
].
proto
,
"socket protocol invalid, expected %d received %d
\n
"
,
prottest
[
i
].
proto
,
infoA
.
iProtocol
);
/* IP_HDRINCL is supported only on SOCK_RAW but passed to SOCK_DGRAM by Impossible Creatures */
size
=
sizeof
(
i
);
k
=
1
;
SetLastError
(
0xdeadbeef
);
err
=
setsockopt
(
s
,
IPPROTO_IP
,
IP_HDRINCL
,
(
char
*
)
&
k
,
size
);
if
(
err
==
-
1
)
/* >= Vista */
{
todo_wine
{
ok
(
GetLastError
()
==
WSAEINVAL
,
"Expected 10022, got %d
\n
"
,
GetLastError
());
k
=
99
;
SetLastError
(
0xdeadbeef
);
err
=
getsockopt
(
s
,
IPPROTO_IP
,
IP_HDRINCL
,
(
char
*
)
&
k
,
&
size
);
ok
(
err
==
-
1
,
"Expected -1, got %d
\n
"
,
err
);
ok
(
GetLastError
()
==
WSAEINVAL
,
"Expected 10022, got %d
\n
"
,
GetLastError
());
ok
(
k
==
99
,
"Expected 99, got %d
\n
"
,
k
);
size
=
sizeof
(
k
);
k
=
0
;
SetLastError
(
0xdeadbeef
);
err
=
setsockopt
(
s
,
IPPROTO_IP
,
IP_HDRINCL
,
(
char
*
)
&
k
,
size
);
}
ok
(
err
==
-
1
,
"Expected -1, got %d
\n
"
,
err
);
todo_wine
{
ok
(
GetLastError
()
==
WSAEINVAL
,
"Expected 10022, got %d
\n
"
,
GetLastError
());
k
=
99
;
SetLastError
(
0xdeadbeef
);
err
=
getsockopt
(
s
,
IPPROTO_IP
,
IP_HDRINCL
,
(
char
*
)
&
k
,
&
size
);
ok
(
err
==
-
1
,
"Expected -1, got %d
\n
"
,
err
);
ok
(
GetLastError
()
==
WSAEINVAL
,
"Expected 10022, got %d
\n
"
,
GetLastError
());
ok
(
k
==
99
,
"Expected 99, got %d
\n
"
,
k
);
}
}
else
/* <= 2003 the tests differ between TCP and UDP, UDP silenty accepts */
{
SetLastError
(
0xdeadbeef
);
k
=
99
;
err
=
getsockopt
(
s
,
IPPROTO_IP
,
IP_HDRINCL
,
(
char
*
)
&
k
,
&
size
);
if
(
prottest
[
i
].
type
==
SOCK_DGRAM
)
{
ok
(
err
==
0
,
"Expected 0, got %d
\n
"
,
err
);
ok
(
k
==
1
,
"Expected 1, got %d
\n
"
,
k
);
}
else
{
/* contratry to what we could expect the function returns error but k is changed */
ok
(
err
==
-
1
,
"Expected -1, got %d
\n
"
,
err
);
ok
(
GetLastError
()
==
WSAENOPROTOOPT
,
"Expected 10042, got %d
\n
"
,
GetLastError
());
ok
(
k
==
0
,
"Expected 0, got %d
\n
"
,
k
);
}
k
=
0
;
err
=
setsockopt
(
s
,
IPPROTO_IP
,
IP_HDRINCL
,
(
char
*
)
&
k
,
size
);
ok
(
err
==
0
,
"Expected 0, got %d
\n
"
,
err
);
k
=
99
;
err
=
getsockopt
(
s
,
IPPROTO_IP
,
IP_HDRINCL
,
(
char
*
)
&
k
,
&
size
);
if
(
prottest
[
i
].
type
==
SOCK_DGRAM
)
{
ok
(
err
==
0
,
"Expected 0, got %d
\n
"
,
err
);
ok
(
k
==
0
,
"Expected 0, got %d
\n
"
,
k
);
}
else
{
/* contratry to what we could expect the function returns error but k is changed */
ok
(
err
==
-
1
,
"Expected -1, got %d
\n
"
,
err
);
ok
(
GetLastError
()
==
WSAENOPROTOOPT
,
"Expected 10042, got %d
\n
"
,
GetLastError
());
ok
(
k
==
0
,
"Expected 0, got %d
\n
"
,
k
);
}
}
closesocket
(
s
);
}
...
...
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