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
9856049a
Commit
9856049a
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_inet_pton().
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c8c95082
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
22 deletions
+22
-22
protocol.c
dlls/ws2_32/tests/protocol.c
+22
-22
No files found.
dlls/ws2_32/tests/protocol.c
View file @
9856049a
...
...
@@ -952,29 +952,29 @@ static void test_inet_pton(void)
WCHAR
inputW
[
32
];
DWORD
addr
;
winetest_push_context
(
"Address %s"
,
debugstr_a
(
ipv4_tests
[
i
].
input
)
);
WSASetLastError
(
0xdeadbeef
);
addr
=
0xdeadbeef
;
ret
=
p_inet_pton
(
AF_INET
,
ipv4_tests
[
i
].
input
,
&
addr
);
ok
(
ret
==
ipv4_tests
[
i
].
ret
,
"%s: got %d
\n
"
,
debugstr_a
(
ipv4_tests
[
i
].
input
),
ret
);
ok
(
WSAGetLastError
()
==
0xdeadbeef
,
"%s: got error %u
\n
"
,
debugstr_a
(
ipv4_tests
[
i
].
input
),
WSAGetLastError
());
ok
(
addr
==
ipv4_tests
[
i
].
addr
,
"%s: got addr %#08x
\n
"
,
debugstr_a
(
ipv4_tests
[
i
].
input
),
addr
);
ok
(
ret
==
ipv4_tests
[
i
].
ret
,
"got %d
\n
"
,
ret
);
ok
(
WSAGetLastError
()
==
0xdeadbeef
,
"got error %u
\n
"
,
WSAGetLastError
());
ok
(
addr
==
ipv4_tests
[
i
].
addr
,
"got addr %#08x
\n
"
,
addr
);
MultiByteToWideChar
(
CP_ACP
,
0
,
ipv4_tests
[
i
].
input
,
-
1
,
inputW
,
ARRAY_SIZE
(
inputW
));
WSASetLastError
(
0xdeadbeef
);
addr
=
0xdeadbeef
;
ret
=
pInetPtonW
(
AF_INET
,
inputW
,
&
addr
);
ok
(
ret
==
ipv4_tests
[
i
].
ret
,
"%s: got %d
\n
"
,
debugstr_a
(
ipv4_tests
[
i
].
input
),
ret
);
ok
(
WSAGetLastError
()
==
(
ret
?
0xdeadbeef
:
WSAEINVAL
),
"%s: got error %u
\n
"
,
debugstr_a
(
ipv4_tests
[
i
].
input
),
WSAGetLastError
());
ok
(
addr
==
ipv4_tests
[
i
].
addr
,
"%s: got addr %#08x
\n
"
,
debugstr_a
(
ipv4_tests
[
i
].
input
),
addr
);
ok
(
ret
==
ipv4_tests
[
i
].
ret
,
"got %d
\n
"
,
ret
);
ok
(
WSAGetLastError
()
==
(
ret
?
0xdeadbeef
:
WSAEINVAL
),
"got error %u
\n
"
,
WSAGetLastError
());
ok
(
addr
==
ipv4_tests
[
i
].
addr
,
"got addr %#08x
\n
"
,
addr
);
WSASetLastError
(
0xdeadbeef
);
addr
=
inet_addr
(
ipv4_tests
[
i
].
input
);
ok
(
addr
==
ipv4_tests
[
i
].
ret
?
ipv4_tests
[
i
].
addr
:
INADDR_NONE
,
"%s: got addr %#08x
\n
"
,
debugstr_a
(
ipv4_tests
[
i
].
input
),
addr
);
ok
(
WSAGetLastError
()
==
0xdeadbeef
,
"%s: got error %u
\n
"
,
debugstr_a
(
ipv4_tests
[
i
].
input
),
WSAGetLastError
()
);
ok
(
addr
==
ipv4_tests
[
i
].
ret
?
ipv4_tests
[
i
].
addr
:
INADDR_NONE
,
"got addr %#08x
\n
"
,
addr
);
ok
(
WSAGetLastError
()
==
0xdeadbeef
,
"got error %u
\n
"
,
WSAGetLastError
()
);
winetest_pop_context
(
);
}
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
ipv6_tests
);
++
i
)
...
...
@@ -982,24 +982,24 @@ static void test_inet_pton(void)
unsigned
short
addr
[
8
];
WCHAR
inputW
[
64
];
winetest_push_context
(
"Address %s"
,
debugstr_a
(
ipv6_tests
[
i
].
input
)
);
WSASetLastError
(
0xdeadbeef
);
memset
(
addr
,
0xab
,
sizeof
(
addr
));
ret
=
p_inet_pton
(
AF_INET6
,
ipv6_tests
[
i
].
input
,
addr
);
ok
(
ret
==
ipv6_tests
[
i
].
ret
,
"%s: got %d
\n
"
,
debugstr_a
(
ipv6_tests
[
i
].
input
),
ret
);
ok
(
WSAGetLastError
()
==
0xdeadbeef
,
"%s: got error %u
\n
"
,
debugstr_a
(
ipv6_tests
[
i
].
input
),
WSAGetLastError
());
ok
(
!
memcmp
(
addr
,
ipv6_tests
[
i
].
addr
,
sizeof
(
addr
)),
"%s: address didn't match
\n
"
,
debugstr_a
(
ipv6_tests
[
i
].
input
));
ok
(
ret
==
ipv6_tests
[
i
].
ret
,
"got %d
\n
"
,
ret
);
ok
(
WSAGetLastError
()
==
0xdeadbeef
,
"got error %u
\n
"
,
WSAGetLastError
());
ok
(
!
memcmp
(
addr
,
ipv6_tests
[
i
].
addr
,
sizeof
(
addr
)),
"address didn't match
\n
"
);
MultiByteToWideChar
(
CP_ACP
,
0
,
ipv6_tests
[
i
].
input
,
-
1
,
inputW
,
ARRAY_SIZE
(
inputW
));
WSASetLastError
(
0xdeadbeef
);
memset
(
addr
,
0xab
,
sizeof
(
addr
));
ret
=
pInetPtonW
(
AF_INET6
,
inputW
,
addr
);
ok
(
ret
==
ipv6_tests
[
i
].
ret
,
"
%s: got %d
\n
"
,
debugstr_a
(
ipv6_tests
[
i
].
input
)
,
ret
);
ok
(
WSAGetLastError
()
==
(
ret
?
0xdeadbeef
:
WSAEINVAL
),
"
%s: got error %u
\n
"
,
debugstr_a
(
ipv6_tests
[
i
].
input
),
WSAGetLastError
()
);
ok
(
!
memcmp
(
addr
,
ipv6_tests
[
i
].
addr
,
sizeof
(
addr
)),
"%s: address didn't match
\n
"
,
debugstr_a
(
ipv6_tests
[
i
].
input
)
);
ok
(
ret
==
ipv6_tests
[
i
].
ret
,
"
got %d
\n
"
,
ret
);
ok
(
WSAGetLastError
()
==
(
ret
?
0xdeadbeef
:
WSAEINVAL
),
"
got error %u
\n
"
,
WSAGetLastError
());
ok
(
!
memcmp
(
addr
,
ipv6_tests
[
i
].
addr
,
sizeof
(
addr
)),
"address didn't match
\n
"
);
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