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
9a664632
Commit
9a664632
authored
Sep 06, 2016
by
Bruno Jesus
Committed by
Alexandre Julliard
Sep 07, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32/tests: Add non-interactive SIO_ADDRESS_LIST_CHANGE tests.
Signed-off-by:
Bruno Jesus
<
00cpxxx@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
761d2449
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
98 additions
and
7 deletions
+98
-7
sock.c
dlls/ws2_32/tests/sock.c
+98
-7
No files found.
dlls/ws2_32/tests/sock.c
View file @
9a664632
...
...
@@ -8336,17 +8336,11 @@ static void test_sioAddressListChange(void)
struct
in_addr
net_address
;
WSAOVERLAPPED
overlapped
;
struct
hostent
*
h
;
DWORD
num_bytes
;
DWORD
num_bytes
,
error
;
SOCKET
sock
;
int
acount
;
int
ret
;
if
(
!
winetest_interactive
)
{
skip
(
"Cannot test SIO_ADDRESS_LIST_CHANGE, interactive tests must be enabled
\n
"
);
return
;
}
/* Use gethostbyname to find the list of local network interfaces */
h
=
gethostbyname
(
""
);
if
(
!
h
)
...
...
@@ -8361,8 +8355,105 @@ static void test_sioAddressListChange(void)
skip
(
"Cannot test SIO_ADDRESS_LIST_CHANGE, test requires a network card.
\n
"
);
return
;
}
net_address
.
s_addr
=
*
(
ULONG
*
)
h
->
h_addr_list
[
0
];
sock
=
socket
(
AF_INET
,
0
,
IPPROTO_TCP
);
ok
(
sock
!=
INVALID_SOCKET
,
"socket() failed
\n
"
);
memset
(
&
bindAddress
,
0
,
sizeof
(
bindAddress
));
bindAddress
.
sin_family
=
AF_INET
;
bindAddress
.
sin_addr
.
s_addr
=
net_address
.
s_addr
;
SetLastError
(
0xdeadbeef
);
ret
=
bind
(
sock
,
(
struct
sockaddr
*
)
&
bindAddress
,
sizeof
(
bindAddress
));
ok
(
!
ret
,
"bind() failed with error %d
\n
"
,
GetLastError
());
set_blocking
(
sock
,
FALSE
);
memset
(
&
overlapped
,
0
,
sizeof
(
overlapped
));
overlapped
.
hEvent
=
CreateEventA
(
NULL
,
FALSE
,
FALSE
,
NULL
);
SetLastError
(
0xdeadbeef
);
ret
=
WSAIoctl
(
sock
,
SIO_ADDRESS_LIST_CHANGE
,
NULL
,
0
,
NULL
,
0
,
&
num_bytes
,
&
overlapped
,
NULL
);
error
=
GetLastError
();
ok
(
ret
==
SOCKET_ERROR
,
"WSAIoctl(SIO_ADDRESS_LIST_CHANGE) failed with error %d
\n
"
,
error
);
todo_wine
ok
(
error
==
ERROR_IO_PENDING
,
"expected 0x3e5, got 0x%x
\n
"
,
error
);
CloseHandle
(
overlapped
.
hEvent
);
closesocket
(
sock
);
sock
=
socket
(
AF_INET
,
0
,
IPPROTO_TCP
);
ok
(
sock
!=
INVALID_SOCKET
,
"socket() failed
\n
"
);
memset
(
&
bindAddress
,
0
,
sizeof
(
bindAddress
));
bindAddress
.
sin_family
=
AF_INET
;
bindAddress
.
sin_addr
.
s_addr
=
net_address
.
s_addr
;
SetLastError
(
0xdeadbeef
);
ret
=
bind
(
sock
,
(
struct
sockaddr
*
)
&
bindAddress
,
sizeof
(
bindAddress
));
ok
(
!
ret
,
"bind() failed with error %d
\n
"
,
GetLastError
());
set_blocking
(
sock
,
TRUE
);
memset
(
&
overlapped
,
0
,
sizeof
(
overlapped
));
overlapped
.
hEvent
=
CreateEventA
(
NULL
,
FALSE
,
FALSE
,
NULL
);
SetLastError
(
0xdeadbeef
);
ret
=
WSAIoctl
(
sock
,
SIO_ADDRESS_LIST_CHANGE
,
NULL
,
0
,
NULL
,
0
,
&
num_bytes
,
&
overlapped
,
NULL
);
error
=
GetLastError
();
ok
(
ret
==
SOCKET_ERROR
,
"WSAIoctl(SIO_ADDRESS_LIST_CHANGE) failed with error %d
\n
"
,
error
);
ok
(
error
==
ERROR_IO_PENDING
,
"expected 0x3e5, got 0x%x
\n
"
,
error
);
CloseHandle
(
overlapped
.
hEvent
);
closesocket
(
sock
);
sock
=
WSASocketW
(
AF_INET
,
SOCK_STREAM
,
IPPROTO_TCP
,
NULL
,
0
,
WSA_FLAG_OVERLAPPED
);
ok
(
sock
!=
INVALID_SOCKET
,
"socket() failed
\n
"
);
memset
(
&
bindAddress
,
0
,
sizeof
(
bindAddress
));
bindAddress
.
sin_family
=
AF_INET
;
bindAddress
.
sin_addr
.
s_addr
=
net_address
.
s_addr
;
SetLastError
(
0xdeadbeef
);
ret
=
bind
(
sock
,
(
struct
sockaddr
*
)
&
bindAddress
,
sizeof
(
bindAddress
));
ok
(
!
ret
,
"bind() failed with error %d
\n
"
,
GetLastError
());
set_blocking
(
sock
,
FALSE
);
memset
(
&
overlapped
,
0
,
sizeof
(
overlapped
));
overlapped
.
hEvent
=
CreateEventA
(
NULL
,
FALSE
,
FALSE
,
NULL
);
SetLastError
(
0xdeadbeef
);
ret
=
WSAIoctl
(
sock
,
SIO_ADDRESS_LIST_CHANGE
,
NULL
,
0
,
NULL
,
0
,
&
num_bytes
,
&
overlapped
,
NULL
);
error
=
GetLastError
();
ok
(
ret
==
SOCKET_ERROR
,
"WSAIoctl(SIO_ADDRESS_LIST_CHANGE) failed with error %d
\n
"
,
error
);
todo_wine
ok
(
error
==
ERROR_IO_PENDING
,
"expected 0x3e5, got 0x%x
\n
"
,
error
);
CloseHandle
(
overlapped
.
hEvent
);
closesocket
(
sock
);
sock
=
WSASocketW
(
AF_INET
,
SOCK_STREAM
,
IPPROTO_TCP
,
NULL
,
0
,
WSA_FLAG_OVERLAPPED
);
ok
(
sock
!=
INVALID_SOCKET
,
"socket() failed
\n
"
);
memset
(
&
bindAddress
,
0
,
sizeof
(
bindAddress
));
bindAddress
.
sin_family
=
AF_INET
;
bindAddress
.
sin_addr
.
s_addr
=
net_address
.
s_addr
;
SetLastError
(
0xdeadbeef
);
ret
=
bind
(
sock
,
(
struct
sockaddr
*
)
&
bindAddress
,
sizeof
(
bindAddress
));
ok
(
!
ret
,
"bind() failed with error %d
\n
"
,
GetLastError
());
set_blocking
(
sock
,
TRUE
);
memset
(
&
overlapped
,
0
,
sizeof
(
overlapped
));
overlapped
.
hEvent
=
CreateEventA
(
NULL
,
FALSE
,
FALSE
,
NULL
);
SetLastError
(
0xdeadbeef
);
ret
=
WSAIoctl
(
sock
,
SIO_ADDRESS_LIST_CHANGE
,
NULL
,
0
,
NULL
,
0
,
&
num_bytes
,
&
overlapped
,
NULL
);
error
=
GetLastError
();
ok
(
ret
==
SOCKET_ERROR
,
"WSAIoctl(SIO_ADDRESS_LIST_CHANGE) failed with error %d
\n
"
,
error
);
ok
(
error
==
ERROR_IO_PENDING
,
"expected 0x3e5, got 0x%x
\n
"
,
error
);
CloseHandle
(
overlapped
.
hEvent
);
closesocket
(
sock
);
if
(
!
winetest_interactive
)
{
skip
(
"Cannot test SIO_ADDRESS_LIST_CHANGE, interactive tests must be enabled
\n
"
);
return
;
}
/* Bind an overlapped socket to the first found network interface */
sock
=
WSASocketW
(
AF_INET
,
SOCK_STREAM
,
IPPROTO_TCP
,
NULL
,
0
,
WSA_FLAG_OVERLAPPED
);
ok
(
sock
!=
INVALID_SOCKET
,
"Expected socket to return a valid socket
\n
"
);
...
...
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