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
6e32b615
Commit
6e32b615
authored
Jul 23, 2016
by
Bruno Jesus
Committed by
Alexandre Julliard
Jul 25, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32/tests: Add tests for InetNtopW.
Signed-off-by:
Bruno Jesus
<
00cpxxx@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8397e3da
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
sock.c
dlls/ws2_32/tests/sock.c
+17
-2
No files found.
dlls/ws2_32/tests/sock.c
View file @
6e32b615
...
@@ -68,6 +68,7 @@ static int (WINAPI *pgetaddrinfo)(LPCSTR,LPCSTR,const struct addrinfo *,struct
...
@@ -68,6 +68,7 @@ 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
PCWSTR
(
WINAPI
*
pInetNtopW
)(
INT
,
LPVOID
,
LPWSTR
,
ULONG
);
static
int
(
WINAPI
*
pInetPtonA
)(
INT
,
LPCSTR
,
LPVOID
);
static
int
(
WINAPI
*
pInetPtonA
)(
INT
,
LPCSTR
,
LPVOID
);
static
int
(
WINAPI
*
pInetPtonW
)(
INT
,
LPWSTR
,
LPVOID
);
static
int
(
WINAPI
*
pInetPtonW
)(
INT
,
LPWSTR
,
LPVOID
);
static
int
(
WINAPI
*
pWSALookupServiceBeginW
)(
LPWSAQUERYSETW
,
DWORD
,
LPHANDLE
);
static
int
(
WINAPI
*
pWSALookupServiceBeginW
)(
LPWSAQUERYSETW
,
DWORD
,
LPHANDLE
);
...
@@ -1227,6 +1228,7 @@ static void Init (void)
...
@@ -1227,6 +1228,7 @@ 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"
);
pInetNtopW
=
(
void
*
)
GetProcAddress
(
hws2_32
,
"InetNtopW"
);
pInetPtonA
=
(
void
*
)
GetProcAddress
(
hws2_32
,
"inet_pton"
);
pInetPtonA
=
(
void
*
)
GetProcAddress
(
hws2_32
,
"inet_pton"
);
pInetPtonW
=
(
void
*
)
GetProcAddress
(
hws2_32
,
"InetPtonW"
);
pInetPtonW
=
(
void
*
)
GetProcAddress
(
hws2_32
,
"InetPtonW"
);
pWSALookupServiceBeginW
=
(
void
*
)
GetProcAddress
(
hws2_32
,
"WSALookupServiceBeginW"
);
pWSALookupServiceBeginW
=
(
void
*
)
GetProcAddress
(
hws2_32
,
"WSALookupServiceBeginW"
);
...
@@ -4869,11 +4871,12 @@ static void test_inet_pton(void)
...
@@ -4869,11 +4871,12 @@ 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
];
WCHAR
printableW
[
64
]
,
collapsedW
[
64
]
;
const
char
*
ptr
;
const
char
*
ptr
;
const
WCHAR
*
ptrW
;
/* InetNtop and InetPton became available in Vista and Win2008 */
/* InetNtop and InetPton became available in Vista and Win2008 */
if
(
!
pInetNtop
||
!
pInetPtonA
||
!
pInetPtonW
)
if
(
!
pInetNtop
||
!
pInet
NtopW
||
!
pInet
PtonA
||
!
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
;
...
@@ -4921,6 +4924,18 @@ static void test_inet_pton(void)
...
@@ -4921,6 +4924,18 @@ static void test_inet_pton(void)
ok
(
memcmp
(
buffer
,
tests
[
i
].
raw_data
,
ok
(
memcmp
(
buffer
,
tests
[
i
].
raw_data
,
tests
[
i
].
family
==
AF_INET
?
sizeof
(
struct
in_addr
)
:
sizeof
(
struct
in6_addr
))
==
0
,
tests
[
i
].
family
==
AF_INET
?
sizeof
(
struct
in_addr
)
:
sizeof
(
struct
in6_addr
))
==
0
,
"Test [%d]: Expected binary data differs
\n
"
,
i
);
"Test [%d]: Expected binary data differs
\n
"
,
i
);
/* Test the result from Pton with Ntop */
printableW
[
0
]
=
0xdead
;
ptrW
=
pInetNtopW
(
tests
[
i
].
family
,
buffer
,
printableW
,
sizeof
(
printableW
)
/
sizeof
(
printableW
[
0
]));
ok
(
ptrW
!=
NULL
,
"Test [%d]: Failed with NULL
\n
"
,
i
);
ok
(
ptrW
==
printableW
,
"Test [%d]: Pointers differ (%p != %p)
\n
"
,
i
,
ptrW
,
printableW
);
if
(
!
ptrW
)
continue
;
MultiByteToWideChar
(
CP_ACP
,
0
,
tests
[
i
].
collapsed
,
-
1
,
collapsedW
,
sizeof
(
collapsedW
)
/
sizeof
(
collapsedW
[
0
]));
ok
(
lstrcmpW
(
ptrW
,
collapsedW
)
==
0
,
"Test [%d]: Expected '%s', got '%s'
\n
"
,
i
,
tests
[
i
].
collapsed
,
wine_dbgstr_w
(
ptrW
));
}
}
}
}
...
...
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