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
efb1b16d
Commit
efb1b16d
authored
Oct 05, 2015
by
Sebastian Lackner
Committed by
Alexandre Julliard
Oct 05, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32/tests: Add tests for InetPtonW.
Signed-off-by:
Sebastian Lackner
<
sebastian@fds-team.de
>
parent
af8c7934
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
4 deletions
+26
-4
sock.c
dlls/ws2_32/tests/sock.c
+26
-4
No files found.
dlls/ws2_32/tests/sock.c
View file @
efb1b16d
...
@@ -67,7 +67,8 @@ static int (WINAPI *pgetaddrinfo)(LPCSTR,LPCSTR,const struct addrinfo *,struct
...
@@ -67,7 +67,8 @@ static int (WINAPI *pgetaddrinfo)(LPCSTR,LPCSTR,const struct addrinfo *,struct
static
void
(
WINAPI
*
pFreeAddrInfoW
)(
PADDRINFOW
);
static
void
(
WINAPI
*
pFreeAddrInfoW
)(
PADDRINFOW
);
static
int
(
WINAPI
*
pGetAddrInfoW
)(
LPCWSTR
,
LPCWSTR
,
const
ADDRINFOW
*
,
PADDRINFOW
*
);
static
int
(
WINAPI
*
pGetAddrInfoW
)(
LPCWSTR
,
LPCWSTR
,
const
ADDRINFOW
*
,
PADDRINFOW
*
);
static
PCSTR
(
WINAPI
*
pInetNtop
)(
INT
,
LPVOID
,
LPSTR
,
ULONG
);
static
PCSTR
(
WINAPI
*
pInetNtop
)(
INT
,
LPVOID
,
LPSTR
,
ULONG
);
static
int
(
WINAPI
*
pInetPton
)(
INT
,
LPSTR
,
LPVOID
);
static
int
(
WINAPI
*
pInetPtonA
)(
INT
,
LPCSTR
,
LPVOID
);
static
int
(
WINAPI
*
pInetPtonW
)(
INT
,
LPWSTR
,
LPVOID
);
static
int
(
WINAPI
*
pWSALookupServiceBeginW
)(
LPWSAQUERYSETW
,
DWORD
,
LPHANDLE
);
static
int
(
WINAPI
*
pWSALookupServiceBeginW
)(
LPWSAQUERYSETW
,
DWORD
,
LPHANDLE
);
static
int
(
WINAPI
*
pWSALookupServiceEnd
)(
HANDLE
);
static
int
(
WINAPI
*
pWSALookupServiceEnd
)(
HANDLE
);
static
int
(
WINAPI
*
pWSALookupServiceNextW
)(
HANDLE
,
DWORD
,
LPDWORD
,
LPWSAQUERYSETW
);
static
int
(
WINAPI
*
pWSALookupServiceNextW
)(
HANDLE
,
DWORD
,
LPDWORD
,
LPWSAQUERYSETW
);
...
@@ -1159,7 +1160,8 @@ static void Init (void)
...
@@ -1159,7 +1160,8 @@ static void Init (void)
pFreeAddrInfoW
=
(
void
*
)
GetProcAddress
(
hws2_32
,
"FreeAddrInfoW"
);
pFreeAddrInfoW
=
(
void
*
)
GetProcAddress
(
hws2_32
,
"FreeAddrInfoW"
);
pGetAddrInfoW
=
(
void
*
)
GetProcAddress
(
hws2_32
,
"GetAddrInfoW"
);
pGetAddrInfoW
=
(
void
*
)
GetProcAddress
(
hws2_32
,
"GetAddrInfoW"
);
pInetNtop
=
(
void
*
)
GetProcAddress
(
hws2_32
,
"inet_ntop"
);
pInetNtop
=
(
void
*
)
GetProcAddress
(
hws2_32
,
"inet_ntop"
);
pInetPton
=
(
void
*
)
GetProcAddress
(
hws2_32
,
"inet_pton"
);
pInetPtonA
=
(
void
*
)
GetProcAddress
(
hws2_32
,
"inet_pton"
);
pInetPtonW
=
(
void
*
)
GetProcAddress
(
hws2_32
,
"InetPtonW"
);
pWSALookupServiceBeginW
=
(
void
*
)
GetProcAddress
(
hws2_32
,
"WSALookupServiceBeginW"
);
pWSALookupServiceBeginW
=
(
void
*
)
GetProcAddress
(
hws2_32
,
"WSALookupServiceBeginW"
);
pWSALookupServiceEnd
=
(
void
*
)
GetProcAddress
(
hws2_32
,
"WSALookupServiceEnd"
);
pWSALookupServiceEnd
=
(
void
*
)
GetProcAddress
(
hws2_32
,
"WSALookupServiceEnd"
);
pWSALookupServiceNextW
=
(
void
*
)
GetProcAddress
(
hws2_32
,
"WSALookupServiceNextW"
);
pWSALookupServiceNextW
=
(
void
*
)
GetProcAddress
(
hws2_32
,
"WSALookupServiceNextW"
);
...
@@ -4698,10 +4700,11 @@ static void test_inet_pton(void)
...
@@ -4698,10 +4700,11 @@ static void test_inet_pton(void)
int
i
,
ret
;
int
i
,
ret
;
DWORD
err
;
DWORD
err
;
char
buffer
[
64
],
str
[
64
];
char
buffer
[
64
],
str
[
64
];
WCHAR
printableW
[
64
];
const
char
*
ptr
;
const
char
*
ptr
;
/* InetNtop and InetPton became available in Vista and Win2008 */
/* InetNtop and InetPton became available in Vista and Win2008 */
if
(
!
pInetNtop
||
!
pInetPton
)
if
(
!
pInetNtop
||
!
pInetPton
A
||
!
pInetPtonW
)
{
{
win_skip
(
"InetNtop and/or InetPton not present, not executing tests
\n
"
);
win_skip
(
"InetNtop and/or InetPton not present, not executing tests
\n
"
);
return
;
return
;
...
@@ -4710,7 +4713,7 @@ static void test_inet_pton(void)
...
@@ -4710,7 +4713,7 @@ static void test_inet_pton(void)
for
(
i
=
0
;
i
<
sizeof
(
tests
)
/
sizeof
(
tests
[
0
]);
i
++
)
for
(
i
=
0
;
i
<
sizeof
(
tests
)
/
sizeof
(
tests
[
0
]);
i
++
)
{
{
WSASetLastError
(
0xdeadbeef
);
WSASetLastError
(
0xdeadbeef
);
ret
=
pInetPton
(
tests
[
i
].
family
,
(
char
*
)
tests
[
i
].
printable
,
buffer
);
ret
=
pInetPton
A
(
tests
[
i
].
family
,
tests
[
i
].
printable
,
buffer
);
ok
(
ret
==
tests
[
i
].
ret
,
"Test [%d]: Expected %d, got %d
\n
"
,
i
,
tests
[
i
].
ret
,
ret
);
ok
(
ret
==
tests
[
i
].
ret
,
"Test [%d]: Expected %d, got %d
\n
"
,
i
,
tests
[
i
].
ret
,
ret
);
if
(
tests
[
i
].
ret
==
-
1
)
if
(
tests
[
i
].
ret
==
-
1
)
{
{
...
@@ -4731,6 +4734,25 @@ static void test_inet_pton(void)
...
@@ -4731,6 +4734,25 @@ static void test_inet_pton(void)
ok
(
strcmp
(
ptr
,
tests
[
i
].
collapsed
)
==
0
,
"Test [%d]: Expected '%s', got '%s'
\n
"
,
ok
(
strcmp
(
ptr
,
tests
[
i
].
collapsed
)
==
0
,
"Test [%d]: Expected '%s', got '%s'
\n
"
,
i
,
tests
[
i
].
collapsed
,
ptr
);
i
,
tests
[
i
].
collapsed
,
ptr
);
}
}
for
(
i
=
0
;
i
<
sizeof
(
tests
)
/
sizeof
(
tests
[
0
]);
i
++
)
{
if
(
tests
[
i
].
printable
)
MultiByteToWideChar
(
CP_ACP
,
0
,
tests
[
i
].
printable
,
-
1
,
printableW
,
sizeof
(
printableW
)
/
sizeof
(
printableW
[
0
]));
WSASetLastError
(
0xdeadbeef
);
ret
=
pInetPtonW
(
tests
[
i
].
family
,
tests
[
i
].
printable
?
printableW
:
NULL
,
buffer
);
ok
(
ret
==
tests
[
i
].
ret
,
"Test [%d]: Expected %d, got %d
\n
"
,
i
,
tests
[
i
].
ret
,
ret
);
if
(
tests
[
i
].
ret
==
-
1
)
{
err
=
WSAGetLastError
();
ok
(
tests
[
i
].
err
==
err
,
"Test [%d]: Expected 0x%x, got 0x%x
\n
"
,
i
,
tests
[
i
].
err
,
err
);
}
if
(
tests
[
i
].
ret
!=
1
)
continue
;
ok
(
memcmp
(
buffer
,
tests
[
i
].
raw_data
,
tests
[
i
].
family
==
AF_INET
?
sizeof
(
struct
in_addr
)
:
sizeof
(
struct
in6_addr
))
==
0
,
"Test [%d]: Expected binary data differs
\n
"
,
i
);
}
}
}
static
void
test_ioctlsocket
(
void
)
static
void
test_ioctlsocket
(
void
)
...
...
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