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
c8c95082
Commit
c8c95082
authored
Feb 10, 2022
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 11, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32/tests: Use winetest_push_context() in test_WSAAddressToString().
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
eba2cd3d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
28 deletions
+20
-28
protocol.c
dlls/ws2_32/tests/protocol.c
+20
-28
No files found.
dlls/ws2_32/tests/protocol.c
View file @
c8c95082
...
...
@@ -1203,6 +1203,8 @@ static void test_WSAAddressToString(void)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
ipv4_tests
);
++
i
)
{
winetest_push_context
(
"Test %u"
,
i
);
sockaddr
.
sin_family
=
AF_INET
;
sockaddr
.
sin_addr
.
s_addr
=
ipv4_tests
[
i
].
address
;
sockaddr
.
sin_port
=
ipv4_tests
[
i
].
port
;
...
...
@@ -1210,26 +1212,20 @@ static void test_WSAAddressToString(void)
len
=
sizeof
(
output
);
memset
(
output
,
0
,
len
);
ret
=
WSAAddressToStringA
(
(
SOCKADDR
*
)
&
sockaddr
,
sizeof
(
sockaddr
),
NULL
,
output
,
&
len
);
ok
(
!
ret
,
"ipv4_tests[%d] failed unexpectedly: %d
\n
"
,
i
,
WSAGetLastError
()
);
ok
(
!
strcmp
(
output
,
ipv4_tests
[
i
].
output
),
"ipv4_tests[%d]: got address %s, expected %s
\n
"
,
i
,
debugstr_a
(
output
),
debugstr_a
(
ipv4_tests
[
i
].
output
)
);
ok
(
len
==
strlen
(
ipv4_tests
[
i
].
output
)
+
1
,
"ipv4_tests[%d]: got length %d, expected %d
\n
"
,
i
,
len
,
strlen
(
ipv4_tests
[
i
].
output
)
+
1
);
ok
(
!
ret
,
"got error %d
\n
"
,
WSAGetLastError
()
);
ok
(
!
strcmp
(
output
,
ipv4_tests
[
i
].
output
),
"got string %s
\n
"
,
debugstr_a
(
output
)
);
ok
(
len
==
strlen
(
ipv4_tests
[
i
].
output
)
+
1
,
"got len %u
\n
"
,
len
);
len
=
sizeof
(
outputW
);
memset
(
outputW
,
0
,
len
);
ret
=
WSAAddressToStringW
(
(
SOCKADDR
*
)
&
sockaddr
,
sizeof
(
sockaddr
),
NULL
,
outputW
,
&
len
);
MultiByteToWideChar
(
CP_ACP
,
0
,
ipv4_tests
[
i
].
output
,
-
1
,
expected_outputW
,
ARRAY_SIZE
(
expected_outputW
)
);
ok
(
!
ret
,
"ipv4_tests[%d] failed unexpectedly: %d
\n
"
,
i
,
WSAGetLastError
()
);
ok
(
!
wcscmp
(
outputW
,
expected_outputW
),
"ipv4_tests[%d]: got address %s, expected %s
\n
"
,
i
,
debugstr_w
(
outputW
),
debugstr_w
(
expected_outputW
)
);
ok
(
len
==
wcslen
(
expected_outputW
)
+
1
,
"ipv4_tests[%d]: got length %d, expected %d
\n
"
,
i
,
len
,
wcslen
(
expected_outputW
)
+
1
);
ok
(
!
ret
,
"got error %d
\n
"
,
WSAGetLastError
()
);
ok
(
!
wcscmp
(
outputW
,
expected_outputW
),
"got string %s
\n
"
,
debugstr_w
(
outputW
)
);
ok
(
len
==
wcslen
(
expected_outputW
)
+
1
,
"got len %u
\n
"
,
len
);
winetest_pop_context
();
}
v6
=
socket
(
AF_INET6
,
SOCK_STREAM
,
IPPROTO_TCP
);
...
...
@@ -1242,6 +1238,8 @@ static void test_WSAAddressToString(void)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
ipv6_tests
);
++
i
)
{
winetest_push_context
(
"Test %u"
,
i
);
sockaddr6
.
sin6_family
=
AF_INET6
;
sockaddr6
.
sin6_scope_id
=
ipv6_tests
[
i
].
scope
;
sockaddr6
.
sin6_port
=
ipv6_tests
[
i
].
port
;
...
...
@@ -1249,25 +1247,19 @@ static void test_WSAAddressToString(void)
len
=
sizeof
(
output
);
ret
=
WSAAddressToStringA
(
(
SOCKADDR
*
)
&
sockaddr6
,
sizeof
(
sockaddr6
),
NULL
,
output
,
&
len
);
ok
(
!
ret
,
"ipv6_tests[%d] failed unexpectedly: %d
\n
"
,
i
,
WSAGetLastError
()
);
ok
(
!
strcmp
(
output
,
ipv6_tests
[
i
].
output
),
"ipv6_tests[%d]: gave address %s, expected %s
\n
"
,
i
,
debugstr_a
(
output
),
debugstr_a
(
ipv6_tests
[
i
].
output
)
);
ok
(
len
==
strlen
(
ipv6_tests
[
i
].
output
)
+
1
,
"ipv6_tests[%d]: got length %d, expected %d
\n
"
,
i
,
len
,
strlen
(
ipv6_tests
[
i
].
output
)
+
1
);
ok
(
!
ret
,
"got error %d
\n
"
,
WSAGetLastError
()
);
ok
(
!
strcmp
(
output
,
ipv6_tests
[
i
].
output
),
"got string %s
\n
"
,
debugstr_a
(
output
)
);
ok
(
len
==
strlen
(
ipv6_tests
[
i
].
output
)
+
1
,
"got len %u
\n
"
,
len
);
len
=
sizeof
(
outputW
);
ret
=
WSAAddressToStringW
(
(
SOCKADDR
*
)
&
sockaddr6
,
sizeof
(
sockaddr6
),
NULL
,
outputW
,
&
len
);
MultiByteToWideChar
(
CP_ACP
,
0
,
ipv6_tests
[
i
].
output
,
-
1
,
expected_outputW
,
ARRAY_SIZE
(
expected_outputW
)
);
ok
(
!
ret
,
"ipv6_tests[%d] failed unexpectedly: %d
\n
"
,
i
,
WSAGetLastError
()
);
ok
(
!
wcscmp
(
outputW
,
expected_outputW
),
"ipv6_tests[%d]: got address %s, expected %s
\n
"
,
i
,
debugstr_w
(
outputW
),
debugstr_w
(
expected_outputW
)
);
ok
(
len
==
wcslen
(
expected_outputW
)
+
1
,
"ipv6_tests[%d]: got length %d, expected %d
\n
"
,
i
,
len
,
wcslen
(
expected_outputW
)
+
1
);
ok
(
!
ret
,
"got error %d
\n
"
,
WSAGetLastError
()
);
ok
(
!
wcscmp
(
outputW
,
expected_outputW
),
"got string %s
\n
"
,
debugstr_w
(
outputW
)
);
ok
(
len
==
wcslen
(
expected_outputW
)
+
1
,
"got len %u
\n
"
,
len
);
winetest_pop_context
();
}
}
...
...
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