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
9d5a8290
Commit
9d5a8290
authored
Apr 08, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Apr 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qcap/tests: Add some basic tests for ICaptureGraphBuilder2::FindPin().
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b95c00ab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
98 additions
and
0 deletions
+98
-0
capturegraph.c
dlls/qcap/tests/capturegraph.c
+98
-0
No files found.
dlls/qcap/tests/capturegraph.c
View file @
9d5a8290
...
...
@@ -547,11 +547,109 @@ static void test_find_interface(void)
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
static
void
test_find_pin
(
void
)
{
static
const
AM_MEDIA_TYPE
mt
=
{
.
majortype
=
{
0x111
},
.
subtype
=
{
0x222
},
.
formattype
=
{
0x333
},
};
ICaptureGraphBuilder2
*
capture_graph
=
create_capture_graph
();
struct
testfilter
filter1
,
filter2
;
IGraphBuilder
*
graph
;
HRESULT
hr
;
ULONG
ref
;
IPin
*
pin
;
CoCreateInstance
(
&
CLSID_FilterGraph
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IGraphBuilder
,
(
void
**
)
&
graph
);
hr
=
ICaptureGraphBuilder2_SetFiltergraph
(
capture_graph
,
graph
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
testfilter_init
(
&
filter1
);
testfilter_init
(
&
filter2
);
IGraphBuilder_AddFilter
(
graph
,
&
filter1
.
filter
.
IBaseFilter_iface
,
L"filter1"
);
IGraphBuilder_AddFilter
(
graph
,
&
filter2
.
filter
.
IBaseFilter_iface
,
L"filter2"
);
hr
=
IGraphBuilder_ConnectDirect
(
graph
,
&
filter1
.
source1
.
pin
.
pin
.
IPin_iface
,
&
filter2
.
sink1
.
pin
.
pin
.
IPin_iface
,
&
mt
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
ICaptureGraphBuilder2_FindPin
(
capture_graph
,
(
IUnknown
*
)
&
filter1
.
filter
.
IBaseFilter_iface
,
PINDIR_INPUT
,
NULL
,
NULL
,
FALSE
,
0
,
&
pin
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
pin
==
&
filter1
.
sink1
.
pin
.
pin
.
IPin_iface
,
"Got wrong pin.
\n
"
);
IPin_Release
(
pin
);
hr
=
ICaptureGraphBuilder2_FindPin
(
capture_graph
,
(
IUnknown
*
)
&
filter1
.
filter
.
IBaseFilter_iface
,
PINDIR_INPUT
,
NULL
,
NULL
,
FALSE
,
1
,
&
pin
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
pin
==
&
filter1
.
sink2
.
pin
.
pin
.
IPin_iface
,
"Got wrong pin.
\n
"
);
IPin_Release
(
pin
);
hr
=
ICaptureGraphBuilder2_FindPin
(
capture_graph
,
(
IUnknown
*
)
&
filter1
.
filter
.
IBaseFilter_iface
,
PINDIR_INPUT
,
NULL
,
NULL
,
FALSE
,
2
,
&
pin
);
ok
(
hr
==
E_FAIL
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
ICaptureGraphBuilder2_FindPin
(
capture_graph
,
(
IUnknown
*
)
&
filter1
.
filter
.
IBaseFilter_iface
,
PINDIR_OUTPUT
,
NULL
,
NULL
,
FALSE
,
0
,
&
pin
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
pin
==
&
filter1
.
source1
.
pin
.
pin
.
IPin_iface
,
"Got wrong pin.
\n
"
);
IPin_Release
(
pin
);
hr
=
ICaptureGraphBuilder2_FindPin
(
capture_graph
,
(
IUnknown
*
)
&
filter1
.
filter
.
IBaseFilter_iface
,
PINDIR_OUTPUT
,
NULL
,
NULL
,
FALSE
,
1
,
&
pin
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
pin
==
&
filter1
.
source2
.
pin
.
pin
.
IPin_iface
,
"Got wrong pin.
\n
"
);
IPin_Release
(
pin
);
hr
=
ICaptureGraphBuilder2_FindPin
(
capture_graph
,
(
IUnknown
*
)
&
filter1
.
filter
.
IBaseFilter_iface
,
PINDIR_OUTPUT
,
NULL
,
NULL
,
FALSE
,
2
,
&
pin
);
ok
(
hr
==
E_FAIL
,
"Got hr %#x.
\n
"
,
hr
);
/* Test the unconnected flag. */
hr
=
ICaptureGraphBuilder2_FindPin
(
capture_graph
,
(
IUnknown
*
)
&
filter1
.
filter
.
IBaseFilter_iface
,
PINDIR_OUTPUT
,
NULL
,
NULL
,
TRUE
,
0
,
&
pin
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
pin
==
&
filter1
.
source2
.
pin
.
pin
.
IPin_iface
,
"Got wrong pin.
\n
"
);
IPin_Release
(
pin
);
hr
=
ICaptureGraphBuilder2_FindPin
(
capture_graph
,
(
IUnknown
*
)
&
filter1
.
filter
.
IBaseFilter_iface
,
PINDIR_OUTPUT
,
NULL
,
NULL
,
TRUE
,
1
,
&
pin
);
ok
(
hr
==
E_FAIL
,
"Got hr %#x.
\n
"
,
hr
);
/* Test categories. */
filter1
.
source1
.
IKsPropertySet_iface
.
lpVtbl
=
&
property_set_vtbl
;
hr
=
ICaptureGraphBuilder2_FindPin
(
capture_graph
,
(
IUnknown
*
)
&
filter1
.
filter
.
IBaseFilter_iface
,
PINDIR_OUTPUT
,
&
PIN_CATEGORY_CAPTURE
,
NULL
,
FALSE
,
0
,
&
pin
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
pin
==
&
filter1
.
source1
.
pin
.
pin
.
IPin_iface
,
"Got wrong pin.
\n
"
);
IPin_Release
(
pin
);
hr
=
ICaptureGraphBuilder2_FindPin
(
capture_graph
,
(
IUnknown
*
)
&
filter1
.
filter
.
IBaseFilter_iface
,
PINDIR_OUTPUT
,
&
PIN_CATEGORY_CAPTURE
,
NULL
,
FALSE
,
1
,
&
pin
);
ok
(
hr
==
E_FAIL
,
"Got hr %#x.
\n
"
,
hr
);
ref
=
ICaptureGraphBuilder2_Release
(
capture_graph
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
ref
=
IGraphBuilder_Release
(
graph
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
ref
=
IBaseFilter_Release
(
&
filter1
.
filter
.
IBaseFilter_iface
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
ref
=
IBaseFilter_Release
(
&
filter2
.
filter
.
IBaseFilter_iface
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
START_TEST
(
capturegraph
)
{
CoInitializeEx
(
NULL
,
COINIT_MULTITHREADED
);
test_find_interface
();
test_find_pin
();
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