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
2a1576c0
Commit
2a1576c0
authored
Feb 21, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf/tests: Add some tests for node management.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b4c5dd49
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
132 additions
and
2 deletions
+132
-2
mf.c
dlls/mf/tests/mf.c
+132
-2
No files found.
dlls/mf/tests/mf.c
View file @
2a1576c0
...
...
@@ -28,29 +28,159 @@
#include "initguid.h"
#include "mfapi.h"
#include "mferror.h"
#include "mfidl.h"
#include "wine/test.h"
static
void
test_topology
(
void
)
{
IMFTopologyNode
*
node
,
*
node2
;
IMFTopology
*
topology
;
IMFTopologyNode
*
node
;
WORD
count
;
HRESULT
hr
;
TOPOID
id
;
hr
=
MFCreateTopology
(
NULL
);
ok
(
hr
==
E_POINTER
,
"got %#x
\n
"
,
hr
);
hr
=
MFCreateTopology
(
&
topology
);
ok
(
hr
==
S_OK
,
"got %#x
\n
"
,
hr
);
IMFTopology_Release
(
topology
);
hr
=
MFCreateTopologyNode
(
MF_TOPOLOGY_OUTPUT_NODE
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
MFCreateTopologyNode
(
MF_TOPOLOGY_OUTPUT_NODE
,
&
node
);
ok
(
hr
==
S_OK
,
"Failed to create topology node, hr %#x.
\n
"
,
hr
);
hr
=
MFCreateTopologyNode
(
MF_TOPOLOGY_TEE_NODE
,
&
node2
);
ok
(
hr
==
S_OK
,
"Failed to create topology node, hr %#x.
\n
"
,
hr
);
hr
=
IMFTopologyNode_GetTopoNodeID
(
node
,
&
id
);
todo_wine
ok
(
hr
==
S_OK
,
"Failed to get node id, hr %#x.
\n
"
,
hr
);
hr
=
IMFTopologyNode_SetTopoNodeID
(
node2
,
id
);
todo_wine
ok
(
hr
==
S_OK
,
"Failed to set node id, hr %#x.
\n
"
,
hr
);
count
=
1
;
hr
=
IMFTopology_GetNodeCount
(
topology
,
&
count
);
todo_wine
{
ok
(
hr
==
S_OK
,
"Failed to get node count, hr %#x.
\n
"
,
hr
);
ok
(
count
==
0
,
"Unexpected node count %u.
\n
"
,
count
);
}
/* Same id, different nodes. */
hr
=
IMFTopology_AddNode
(
topology
,
node
);
todo_wine
ok
(
hr
==
S_OK
,
"Failed to add a node, hr %#x.
\n
"
,
hr
);
count
=
0
;
hr
=
IMFTopology_GetNodeCount
(
topology
,
&
count
);
todo_wine
{
ok
(
hr
==
S_OK
,
"Failed to get node count, hr %#x.
\n
"
,
hr
);
ok
(
count
==
1
,
"Unexpected node count %u.
\n
"
,
count
);
}
hr
=
IMFTopology_AddNode
(
topology
,
node2
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
IMFTopologyNode_Release
(
node2
);
hr
=
IMFTopology_GetNodeByID
(
topology
,
id
,
&
node2
);
todo_wine
{
ok
(
hr
==
S_OK
,
"Failed to get a node, hr %#x.
\n
"
,
hr
);
ok
(
node2
==
node
,
"Unexpected node.
\n
"
);
}
if
(
SUCCEEDED
(
hr
))
IMFTopologyNode_Release
(
node2
);
/* Change node id, add it again. */
hr
=
IMFTopologyNode_SetTopoNodeID
(
node
,
++
id
);
todo_wine
ok
(
hr
==
S_OK
,
"Failed to set node id, hr %#x.
\n
"
,
hr
);
hr
=
IMFTopology_GetNodeByID
(
topology
,
id
,
&
node2
);
todo_wine
{
ok
(
hr
==
S_OK
,
"Failed to get a node, hr %#x.
\n
"
,
hr
);
ok
(
node2
==
node
,
"Unexpected node.
\n
"
);
}
if
(
SUCCEEDED
(
hr
))
IMFTopologyNode_Release
(
node2
);
hr
=
IMFTopology_GetNodeByID
(
topology
,
id
+
1
,
&
node2
);
todo_wine
ok
(
hr
==
MF_E_NOT_FOUND
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFTopology_AddNode
(
topology
,
node
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Failed to add a node, hr %#x.
\n
"
,
hr
);
hr
=
IMFTopology_GetNode
(
topology
,
0
,
&
node2
);
todo_wine
{
ok
(
hr
==
S_OK
,
"Failed to get a node, hr %#x.
\n
"
,
hr
);
ok
(
node2
==
node
,
"Unexpected node.
\n
"
);
}
if
(
SUCCEEDED
(
hr
))
IMFTopologyNode_Release
(
node2
);
hr
=
IMFTopology_GetNode
(
topology
,
1
,
&
node2
);
todo_wine
ok
(
hr
==
MF_E_INVALIDINDEX
,
"Failed to get a node, hr %#x.
\n
"
,
hr
);
hr
=
IMFTopology_GetNode
(
topology
,
-
2
,
&
node2
);
todo_wine
ok
(
hr
==
MF_E_INVALIDINDEX
,
"Failed to get a node, hr %#x.
\n
"
,
hr
);
hr
=
MFCreateTopologyNode
(
MF_TOPOLOGY_TEE_NODE
,
&
node2
);
ok
(
hr
==
S_OK
,
"Failed to create topology node, hr %#x.
\n
"
,
hr
);
hr
=
IMFTopology_AddNode
(
topology
,
node2
);
todo_wine
ok
(
hr
==
S_OK
,
"Failed to add a node, hr %#x.
\n
"
,
hr
);
IMFTopologyNode_Release
(
node2
);
count
=
0
;
hr
=
IMFTopology_GetNodeCount
(
topology
,
&
count
);
todo_wine
{
ok
(
hr
==
S_OK
,
"Failed to get node count, hr %#x.
\n
"
,
hr
);
ok
(
count
==
2
,
"Unexpected node count %u.
\n
"
,
count
);
}
/* Remove with detached node, existing id. */
hr
=
MFCreateTopologyNode
(
MF_TOPOLOGY_TEE_NODE
,
&
node2
);
ok
(
hr
==
S_OK
,
"Failed to create topology node, hr %#x.
\n
"
,
hr
);
hr
=
IMFTopologyNode_SetTopoNodeID
(
node2
,
id
);
todo_wine
ok
(
hr
==
S_OK
,
"Failed to set node id, hr %#x.
\n
"
,
hr
);
hr
=
IMFTopology_RemoveNode
(
topology
,
node2
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
IMFTopologyNode_Release
(
node2
);
hr
=
IMFTopology_RemoveNode
(
topology
,
node
);
todo_wine
ok
(
hr
==
S_OK
,
"Failed to remove a node, hr %#x.
\n
"
,
hr
);
count
=
0
;
hr
=
IMFTopology_GetNodeCount
(
topology
,
&
count
);
todo_wine
{
ok
(
hr
==
S_OK
,
"Failed to get node count, hr %#x.
\n
"
,
hr
);
ok
(
count
==
1
,
"Unexpected node count %u.
\n
"
,
count
);
}
hr
=
IMFTopology_Clear
(
topology
);
todo_wine
ok
(
hr
==
S_OK
,
"Failed to clear topology, hr %#x.
\n
"
,
hr
);
count
=
1
;
hr
=
IMFTopology_GetNodeCount
(
topology
,
&
count
);
todo_wine
{
ok
(
hr
==
S_OK
,
"Failed to get node count, hr %#x.
\n
"
,
hr
);
ok
(
count
==
0
,
"Unexpected node count %u.
\n
"
,
count
);
}
hr
=
IMFTopology_Clear
(
topology
);
todo_wine
ok
(
hr
==
S_OK
,
"Failed to clear topology, hr %#x.
\n
"
,
hr
);
IMFTopologyNode_Release
(
node
);
IMFTopology_Release
(
topology
);
}
static
HRESULT
WINAPI
test_getservice_QI
(
IMFGetService
*
iface
,
REFIID
riid
,
void
**
obj
)
...
...
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