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
d06b1d59
Commit
d06b1d59
authored
Sep 24, 2010
by
Juan Lang
Committed by
Alexandre Julliard
Sep 28, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32/tests: Test SIO_ROUTING_INTERFACE_QUERY.
parent
dc4d6070
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
0 deletions
+69
-0
sock.c
dlls/ws2_32/tests/sock.c
+69
-0
No files found.
dlls/ws2_32/tests/sock.c
View file @
d06b1d59
...
@@ -4274,6 +4274,73 @@ static void test_getpeername(void)
...
@@ -4274,6 +4274,73 @@ static void test_getpeername(void)
closesocket
(
sock
);
closesocket
(
sock
);
}
}
static
void
test_sioRoutingInterfaceQuery
(
void
)
{
int
ret
;
SOCKET
sock
;
SOCKADDR_IN
sin
=
{
0
},
sout
=
{
0
};
DWORD
bytesReturned
;
sock
=
socket
(
PF_INET
,
SOCK_DGRAM
,
IPPROTO_IP
);
ok
(
sock
!=
INVALID_SOCKET
,
"Expected socket to return a valid socket
\n
"
);
if
(
sock
==
INVALID_SOCKET
)
{
skip
(
"Socket creation failed with %d
\n
"
,
WSAGetLastError
());
return
;
}
ret
=
WSAIoctl
(
sock
,
SIO_ROUTING_INTERFACE_QUERY
,
NULL
,
0
,
NULL
,
0
,
NULL
,
NULL
,
NULL
);
todo_wine
ok
(
ret
==
SOCKET_ERROR
&&
WSAGetLastError
()
==
WSAEFAULT
,
"expected WSAEFAULT, got %d
\n
"
,
WSAGetLastError
());
ret
=
WSAIoctl
(
sock
,
SIO_ROUTING_INTERFACE_QUERY
,
&
sin
,
sizeof
(
sin
),
NULL
,
0
,
NULL
,
NULL
,
NULL
);
todo_wine
ok
(
ret
==
SOCKET_ERROR
&&
WSAGetLastError
()
==
WSAEFAULT
,
"expected WSAEFAULT, got %d
\n
"
,
WSAGetLastError
());
ret
=
WSAIoctl
(
sock
,
SIO_ROUTING_INTERFACE_QUERY
,
&
sin
,
sizeof
(
sin
),
NULL
,
0
,
&
bytesReturned
,
NULL
,
NULL
);
todo_wine
ok
(
ret
==
SOCKET_ERROR
&&
(
WSAGetLastError
()
==
WSAEFAULT
/* Win98 */
||
WSAGetLastError
()
==
WSAEINVAL
/* NT4 */
||
WSAGetLastError
()
==
WSAEAFNOSUPPORT
),
"expected WSAEFAULT or WSAEINVAL or WSAEAFNOSUPPORT, got %d
\n
"
,
WSAGetLastError
());
sin
.
sin_family
=
AF_INET
;
ret
=
WSAIoctl
(
sock
,
SIO_ROUTING_INTERFACE_QUERY
,
&
sin
,
sizeof
(
sin
),
NULL
,
0
,
&
bytesReturned
,
NULL
,
NULL
);
todo_wine
ok
(
ret
==
SOCKET_ERROR
&&
(
WSAGetLastError
()
==
WSAEFAULT
/* Win98 */
||
WSAGetLastError
()
==
WSAEINVAL
),
"expected WSAEFAULT or WSAEINVAL, got %d
\n
"
,
WSAGetLastError
());
sin
.
sin_addr
.
s_addr
=
htonl
(
INADDR_LOOPBACK
);
ret
=
WSAIoctl
(
sock
,
SIO_ROUTING_INTERFACE_QUERY
,
&
sin
,
sizeof
(
sin
),
NULL
,
0
,
&
bytesReturned
,
NULL
,
NULL
);
todo_wine
ok
(
ret
==
SOCKET_ERROR
&&
(
WSAGetLastError
()
==
WSAEINVAL
/* NT4 */
||
WSAGetLastError
()
==
WSAEFAULT
),
"expected WSAEINVAL or WSAEFAULT, got %d
\n
"
,
WSAGetLastError
());
ret
=
WSAIoctl
(
sock
,
SIO_ROUTING_INTERFACE_QUERY
,
&
sin
,
sizeof
(
sin
),
&
sout
,
sizeof
(
sout
),
&
bytesReturned
,
NULL
,
NULL
);
todo_wine
ok
(
!
ret
||
broken
(
WSAGetLastError
()
==
WSAEINVAL
/* NT4 */
),
"WSAIoctl failed: %d
\n
"
,
WSAGetLastError
());
if
(
!
ret
)
{
ok
(
sout
.
sin_family
==
AF_INET
,
"expected AF_INET, got %d
\n
"
,
sout
.
sin_family
);
if
(
sout
.
sin_family
==
AF_INET
)
ok
(
sout
.
sin_addr
.
s_addr
==
htonl
(
INADDR_LOOPBACK
),
"expected %08x, got %08x
\n
"
,
htonl
(
INADDR_LOOPBACK
),
htonl
(
sout
.
sin_addr
.
s_addr
));
}
closesocket
(
sock
);
}
/**************** Main program ***************/
/**************** Main program ***************/
START_TEST
(
sock
)
START_TEST
(
sock
)
...
@@ -4331,6 +4398,8 @@ START_TEST( sock )
...
@@ -4331,6 +4398,8 @@ START_TEST( sock )
test_AcceptEx
();
test_AcceptEx
();
test_ConnectEx
();
test_ConnectEx
();
test_sioRoutingInterfaceQuery
();
/* this is a io heavy test, do it at the end so the kernel doesn't start dropping packets */
/* this is a io heavy test, do it at the end so the kernel doesn't start dropping packets */
test_send
();
test_send
();
...
...
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