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
d0291c27
Commit
d0291c27
authored
Jun 03, 2017
by
Owen Rudge
Committed by
Alexandre Julliard
Jun 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wsdapi/tests: Add tests for Get/SetPort.
Signed-off-by:
Owen Rudge
<
orudge@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a4ee1b26
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
+49
-0
address.c
dlls/wsdapi/tests/address.c
+49
-0
No files found.
dlls/wsdapi/tests/address.c
View file @
d0291c27
...
...
@@ -132,12 +132,61 @@ static void GetSetTransportAddress_udp_tests(void)
ok
(
ret
==
0
,
"WSACleanup failed: %d
\n
"
,
ret
);
}
static
void
GetSetPort_udp_tests
(
void
)
{
IWSDUdpAddress
*
udpAddress
=
NULL
;
WORD
expectedPort1
=
12345
;
WORD
expectedPort2
=
8080
;
WORD
actualPort
=
0
;
HRESULT
rc
;
int
ret
;
rc
=
WSDCreateUdpAddress
(
&
udpAddress
);
ok
(
rc
==
S_OK
,
"WSDCreateUdpAddress(NULL, &udpAddress) failed: %08x
\n
"
,
rc
);
ok
(
udpAddress
!=
NULL
,
"WSDCreateUdpAddress(NULL, &udpAddress) failed: udpAddress == NULL
\n
"
);
/* No test for GetPort(NULL) as this causes an access violation exception on Windows */
rc
=
IWSDUdpAddress_GetPort
(
udpAddress
,
&
actualPort
);
todo_wine
ok
(
rc
==
S_OK
,
"GetPort returned unexpected result: %08x
\n
"
,
rc
);
ok
(
actualPort
==
0
,
"GetPort returned unexpected port: %d
\n
"
,
actualPort
);
/* Try setting a zero port */
rc
=
IWSDUdpAddress_SetPort
(
udpAddress
,
0
);
todo_wine
ok
(
rc
==
S_OK
,
"SetPort returned unexpected result: %08x
\n
"
,
rc
);
rc
=
IWSDUdpAddress_GetPort
(
udpAddress
,
&
actualPort
);
todo_wine
ok
(
rc
==
S_OK
,
"GetPort returned unexpected result: %08x
\n
"
,
rc
);
ok
(
actualPort
==
0
,
"GetPort returned unexpected port: %d
\n
"
,
actualPort
);
/* Set a real port */
rc
=
IWSDUdpAddress_SetPort
(
udpAddress
,
expectedPort1
);
todo_wine
ok
(
rc
==
S_OK
,
"SetPort returned unexpected result: %08x
\n
"
,
rc
);
rc
=
IWSDUdpAddress_GetPort
(
udpAddress
,
&
actualPort
);
todo_wine
ok
(
rc
==
S_OK
,
"GetPort returned unexpected result: %08x
\n
"
,
rc
);
todo_wine
ok
(
actualPort
==
expectedPort1
,
"GetPort returned unexpected port: %d
\n
"
,
actualPort
);
/* Now set a different port */
rc
=
IWSDUdpAddress_SetPort
(
udpAddress
,
expectedPort2
);
todo_wine
ok
(
rc
==
S_OK
,
"SetPort returned unexpected result: %08x
\n
"
,
rc
);
rc
=
IWSDUdpAddress_GetPort
(
udpAddress
,
&
actualPort
);
todo_wine
ok
(
rc
==
S_OK
,
"GetPort returned unexpected result: %08x
\n
"
,
rc
);
todo_wine
ok
(
actualPort
==
expectedPort2
,
"GetPort returned unexpected port: %d
\n
"
,
actualPort
);
/* Release the object */
ret
=
IWSDUdpAddress_Release
(
udpAddress
);
ok
(
ret
==
0
,
"IWSDUdpAddress_Release() has %d references, should have 0
\n
"
,
ret
);
}
START_TEST
(
address
)
{
CoInitialize
(
NULL
);
CreateUdpAddress_tests
();
GetSetTransportAddress_udp_tests
();
GetSetPort_udp_tests
();
CoUninitialize
();
}
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