Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
7b1332d3
Commit
7b1332d3
authored
Jul 27, 2015
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jul 28, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qcap/tests: Add COM tests for VfwCapture.
parent
67ced3c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
140 additions
and
0 deletions
+140
-0
qcap.c
dlls/qcap/tests/qcap.c
+140
-0
No files found.
dlls/qcap/tests/qcap.c
View file @
7b1332d3
...
...
@@ -1850,6 +1850,145 @@ static void test_AviCo(void)
IBaseFilter_Release
(
avico
);
}
/* Outer IUnknown for COM aggregation tests */
struct
unk_impl
{
IUnknown
IUnknown_iface
;
LONG
ref
;
IUnknown
*
inner_unk
;
};
static
inline
struct
unk_impl
*
impl_from_IUnknown
(
IUnknown
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
unk_impl
,
IUnknown_iface
);
}
static
HRESULT
WINAPI
unk_QueryInterface
(
IUnknown
*
iface
,
REFIID
riid
,
void
**
ret_iface
)
{
struct
unk_impl
*
This
=
impl_from_IUnknown
(
iface
);
return
IUnknown_QueryInterface
(
This
->
inner_unk
,
riid
,
ret_iface
);
}
static
ULONG
WINAPI
unk_AddRef
(
IUnknown
*
iface
)
{
struct
unk_impl
*
This
=
impl_from_IUnknown
(
iface
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
ULONG
WINAPI
unk_Release
(
IUnknown
*
iface
)
{
struct
unk_impl
*
This
=
impl_from_IUnknown
(
iface
);
return
InterlockedDecrement
(
&
This
->
ref
);
}
static
const
IUnknownVtbl
unk_vtbl
=
{
unk_QueryInterface
,
unk_AddRef
,
unk_Release
};
static
void
test_COM_vfwcapture
(
void
)
{
struct
unk_impl
unk_obj
=
{{
&
unk_vtbl
},
19
,
NULL
};
IBaseFilter
*
bf
;
IMediaFilter
*
mf
;
IPersist
*
p
;
IPersistPropertyBag
*
ppb
;
IAMVfwCaptureDialogs
*
amvcd
;
IAMFilterMiscFlags
*
amfmf
;
ISpecifyPropertyPages
*
spp
;
IUnknown
*
unk
;
ULONG
refcount
;
HRESULT
hr
;
/* COM aggregation */
hr
=
CoCreateInstance
(
&
CLSID_VfwCapture
,
&
unk_obj
.
IUnknown_iface
,
CLSCTX_INPROC_SERVER
,
&
IID_IUnknown
,
(
void
**
)
&
unk_obj
.
inner_unk
);
ok
(
hr
==
S_OK
,
"VfwCapture create failed: %08x
\n
"
,
hr
);
hr
=
IUnknown_QueryInterface
(
unk_obj
.
inner_unk
,
&
IID_IBaseFilter
,
(
void
**
)
&
bf
);
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IBaseFilter failed: %08x
\n
"
,
hr
);
refcount
=
IBaseFilter_AddRef
(
bf
);
ok
(
refcount
==
unk_obj
.
ref
,
"VfwCapture just pretends to support COM aggregation
\n
"
);
refcount
=
IBaseFilter_Release
(
bf
);
ok
(
refcount
==
unk_obj
.
ref
,
"VfwCapture just pretends to support COM aggregation
\n
"
);
refcount
=
IBaseFilter_Release
(
bf
);
ok
(
refcount
==
19
,
"Refcount should be back at 19 but is %u
\n
"
,
refcount
);
IUnknown_Release
(
unk_obj
.
inner_unk
);
/* Invalid RIID */
hr
=
CoCreateInstance
(
&
CLSID_VfwCapture
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IClassFactory
,
(
void
**
)
&
bf
);
ok
(
hr
==
E_NOINTERFACE
,
"VfwCapture create failed: %08x, expected E_NOINTERFACE
\n
"
,
hr
);
/* Same refcount for all VfwCapture interfaces */
hr
=
CoCreateInstance
(
&
CLSID_VfwCapture
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IBaseFilter
,
(
void
**
)
&
bf
);
ok
(
hr
==
S_OK
,
"VfwCapture create failed: %08x, expected S_OK
\n
"
,
hr
);
refcount
=
IBaseFilter_AddRef
(
bf
);
ok
(
refcount
==
2
,
"refcount == %u, expected 2
\n
"
,
refcount
);
hr
=
IBaseFilter_QueryInterface
(
bf
,
&
IID_IMediaFilter
,
(
void
**
)
&
mf
);
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IMediaFilter failed: %08x
\n
"
,
hr
);
refcount
=
IMediaFilter_AddRef
(
mf
);
ok
(
refcount
==
4
,
"refcount == %u, expected 4
\n
"
,
refcount
);
refcount
=
IMediaFilter_Release
(
mf
);
hr
=
IBaseFilter_QueryInterface
(
bf
,
&
IID_IPersist
,
(
void
**
)
&
p
);
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IPersist failed: %08x
\n
"
,
hr
);
refcount
=
IPersist_AddRef
(
p
);
ok
(
refcount
==
5
,
"refcount == %u, expected 5
\n
"
,
refcount
);
refcount
=
IPersist_Release
(
p
);
hr
=
IBaseFilter_QueryInterface
(
bf
,
&
IID_IPersistPropertyBag
,
(
void
**
)
&
ppb
);
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IPersistPropertyBag failed: %08x
\n
"
,
hr
);
refcount
=
IPersistPropertyBag_AddRef
(
ppb
);
ok
(
refcount
==
6
,
"refcount == %u, expected 6
\n
"
,
refcount
);
refcount
=
IPersistPropertyBag_Release
(
ppb
);
hr
=
IBaseFilter_QueryInterface
(
bf
,
&
IID_IAMVfwCaptureDialogs
,
(
void
**
)
&
amvcd
);
todo_wine
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IAMVfwCaptureDialogs failed: %08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
refcount
=
IAMVfwCaptureDialogs_AddRef
(
amvcd
);
ok
(
refcount
==
7
,
"refcount == %u, expected 7
\n
"
,
refcount
);
refcount
=
IAMVfwCaptureDialogs_Release
(
amvcd
);
}
hr
=
IBaseFilter_QueryInterface
(
bf
,
&
IID_IAMFilterMiscFlags
,
(
void
**
)
&
amfmf
);
todo_wine
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IAMFilterMiscFlags failed: %08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
refcount
=
IAMFilterMiscFlags_AddRef
(
amfmf
);
ok
(
refcount
==
8
,
"refcount == %u, expected 8
\n
"
,
refcount
);
refcount
=
IAMFilterMiscFlags_Release
(
amfmf
);
}
hr
=
IBaseFilter_QueryInterface
(
bf
,
&
IID_ISpecifyPropertyPages
,
(
void
**
)
&
spp
);
todo_wine
ok
(
hr
==
S_OK
,
"QueryInterface for IID_ISpecifyPropertyPages failed: %08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
refcount
=
ISpecifyPropertyPages_AddRef
(
spp
);
ok
(
refcount
==
9
,
"refcount == %u, expected 9
\n
"
,
refcount
);
refcount
=
ISpecifyPropertyPages_Release
(
spp
);
}
hr
=
IBaseFilter_QueryInterface
(
bf
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IUnknown failed: %08x
\n
"
,
hr
);
refcount
=
IUnknown_AddRef
(
unk
);
todo_wine
ok
(
refcount
==
10
,
"refcount == %u, expected 10
\n
"
,
refcount
);
refcount
=
IUnknown_Release
(
unk
);
/* Unsupported interfaces */
hr
=
IBaseFilter_QueryInterface
(
bf
,
&
IID_IAMStreamConfig
,
(
void
**
)
&
unk
);
todo_wine
ok
(
hr
==
E_NOINTERFACE
,
"QueryInterface for IID_IAMStreamConfig failed: %08x
\n
"
,
hr
);
hr
=
IBaseFilter_QueryInterface
(
bf
,
&
IID_IAMVideoProcAmp
,
(
void
**
)
&
unk
);
todo_wine
ok
(
hr
==
E_NOINTERFACE
,
"QueryInterface for IID_IAMVideoProcAmp failed: %08x
\n
"
,
hr
);
hr
=
IBaseFilter_QueryInterface
(
bf
,
&
IID_IOverlayNotify
,
(
void
**
)
&
unk
);
ok
(
hr
==
E_NOINTERFACE
,
"QueryInterface for IID_IOverlayNotify failed: %08x
\n
"
,
hr
);
while
(
IBaseFilter_Release
(
bf
));
}
START_TEST
(
qcap
)
{
if
(
SUCCEEDED
(
CoInitialize
(
NULL
)))
...
...
@@ -1862,6 +2001,7 @@ START_TEST(qcap)
test_AviMux_QueryInterface
();
test_AviMux
(
arg_c
>
2
?
arg_v
[
2
]
:
NULL
);
test_AviCo
();
test_COM_vfwcapture
();
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