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
f21d3836
Commit
f21d3836
authored
Jun 20, 2017
by
Owen Rudge
Committed by
Alexandre Julliard
Jun 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wsdapi/tests: Add tests for Get/SetLocalAddress.
Signed-off-by:
Owen Rudge
<
orudge@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d0abe772
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
0 deletions
+59
-0
msgparams.c
dlls/wsdapi/tests/msgparams.c
+59
-0
No files found.
dlls/wsdapi/tests/msgparams.c
View file @
f21d3836
...
...
@@ -66,11 +66,70 @@ static void CreateUdpMessageParameters_tests(void)
ok
(
ref
==
0
,
"IWSDUdpMessageParameters_Release() has %d references, should have 0
\n
"
,
ref
);
}
static
void
LocalAddress_tests
(
void
)
{
IWSDUdpAddress
*
origUdpAddress
=
NULL
;
IWSDAddress
*
returnedAddress
=
NULL
;
IWSDUdpMessageParameters
*
udpMessageParams
=
NULL
;
WCHAR
address
[]
=
{
'1'
,
'.'
,
'2'
,
'.'
,
'3'
,
'.'
,
'4'
,
0
};
WSADATA
wsaData
;
HRESULT
rc
;
int
ret
;
ret
=
WSAStartup
(
MAKEWORD
(
2
,
2
),
&
wsaData
);
ok
(
ret
==
0
,
"WSAStartup failed: %d
\n
"
,
ret
);
rc
=
WSDCreateUdpMessageParameters
(
&
udpMessageParams
);
ok
(
rc
==
S_OK
,
"WSDCreateUdpMessageParameters(NULL, &udpMessageParams) failed: %08x
\n
"
,
rc
);
ok
(
udpMessageParams
!=
NULL
,
"WSDCreateUdpMessageParameters(NULL, &udpMessageParams) failed: udpMessageParams == NULL
\n
"
);
rc
=
IWSDUdpMessageParameters_GetLocalAddress
(
udpMessageParams
,
NULL
);
todo_wine
ok
(
rc
==
E_POINTER
,
"GetLocalAddress failed: %08x
\n
"
,
rc
);
ok
(
returnedAddress
==
NULL
,
"GetLocalAddress returned %p
\n
"
,
returnedAddress
);
rc
=
IWSDUdpMessageParameters_GetLocalAddress
(
udpMessageParams
,
&
returnedAddress
);
todo_wine
ok
(
rc
==
E_ABORT
,
"GetLocalAddress failed: %08x
\n
"
,
rc
);
ok
(
returnedAddress
==
NULL
,
"GetLocalAddress returned %p
\n
"
,
returnedAddress
);
rc
=
WSDCreateUdpAddress
(
&
origUdpAddress
);
ok
(
rc
==
S_OK
,
"WSDCreateUdpAddress(NULL, &origUdpAddress) failed: %08x
\n
"
,
rc
);
ok
(
origUdpAddress
!=
NULL
,
"WSDCreateUdpMessageParameters(NULL, &origUdpAddress) failed: origUdpAddress == NULL
\n
"
);
rc
=
IWSDUdpAddress_SetTransportAddress
(
origUdpAddress
,
address
);
todo_wine
ok
(
rc
==
S_OK
,
"SetTransportAddress failed: %08x
\n
"
,
rc
);
rc
=
IWSDUdpMessageParameters_SetLocalAddress
(
udpMessageParams
,
(
IWSDAddress
*
)
origUdpAddress
);
todo_wine
ok
(
rc
==
S_OK
,
"SetLocalAddress failed: %08x
\n
"
,
rc
);
rc
=
IWSDUdpMessageParameters_GetLocalAddress
(
udpMessageParams
,
&
returnedAddress
);
todo_wine
ok
(
rc
==
S_OK
,
"GetLocalAddress failed: %08x
\n
"
,
rc
);
todo_wine
ok
(
returnedAddress
!=
NULL
,
"GetLocalAddress returned NULL
\n
"
);
/* Check if GetLocalAddress returns the same object */
todo_wine
ok
(
returnedAddress
==
(
IWSDAddress
*
)
origUdpAddress
,
"returnedAddress != origUdpAddress
\n
"
);
ret
=
IWSDUdpMessageParameters_Release
(
udpMessageParams
);
ok
(
ret
==
0
,
"IWSDUdpMessageParameters_Release() has %d references, should have 0
\n
"
,
ret
);
if
(
returnedAddress
!=
NULL
)
{
ret
=
IWSDAddress_Release
(
returnedAddress
);
ok
(
ret
==
1
,
"IWSDAddress_Release() has %d references, should have 1
\n
"
,
ret
);
}
ret
=
IWSDUdpAddress_Release
(
origUdpAddress
);
ok
(
ret
==
0
,
"IWSDUdpMessageParameters_Release() has %d references, should have 0
\n
"
,
ret
);
ret
=
WSACleanup
();
ok
(
ret
==
0
,
"WSACleanup failed: %d
\n
"
,
ret
);
}
START_TEST
(
msgparams
)
{
CoInitialize
(
NULL
);
CreateUdpMessageParameters_tests
();
LocalAddress_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