Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
09f59571
Commit
09f59571
authored
May 29, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
May 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz/tests: Add more tests for aggregation.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3fd3df9a
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
672 additions
and
0 deletions
+672
-0
acmwrapper.c
dlls/quartz/tests/acmwrapper.c
+96
-0
avidec.c
dlls/quartz/tests/avidec.c
+96
-0
avisplit.c
dlls/quartz/tests/avisplit.c
+96
-0
dsoundrender.c
dlls/quartz/tests/dsoundrender.c
+96
-0
filesource.c
dlls/quartz/tests/filesource.c
+96
-0
mpegsplit.c
dlls/quartz/tests/mpegsplit.c
+96
-0
waveparser.c
dlls/quartz/tests/waveparser.c
+96
-0
No files found.
dlls/quartz/tests/acmwrapper.c
View file @
09f59571
...
...
@@ -108,6 +108,101 @@ static void test_interfaces(void)
IBaseFilter_Release
(
filter
);
}
static
const
GUID
test_iid
=
{
0x33333333
};
static
LONG
outer_ref
=
1
;
static
HRESULT
WINAPI
outer_QueryInterface
(
IUnknown
*
iface
,
REFIID
iid
,
void
**
out
)
{
if
(
IsEqualGUID
(
iid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
iid
,
&
IID_IBaseFilter
)
||
IsEqualGUID
(
iid
,
&
test_iid
))
{
*
out
=
(
IUnknown
*
)
0xdeadbeef
;
return
S_OK
;
}
ok
(
0
,
"unexpected call %s
\n
"
,
wine_dbgstr_guid
(
iid
));
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
outer_AddRef
(
IUnknown
*
iface
)
{
return
InterlockedIncrement
(
&
outer_ref
);
}
static
ULONG
WINAPI
outer_Release
(
IUnknown
*
iface
)
{
return
InterlockedDecrement
(
&
outer_ref
);
}
static
const
IUnknownVtbl
outer_vtbl
=
{
outer_QueryInterface
,
outer_AddRef
,
outer_Release
,
};
static
IUnknown
test_outer
=
{
&
outer_vtbl
};
static
void
test_aggregation
(
void
)
{
IBaseFilter
*
filter
,
*
filter2
;
IUnknown
*
unk
,
*
unk2
;
HRESULT
hr
;
ULONG
ref
;
filter
=
(
IBaseFilter
*
)
0xdeadbeef
;
hr
=
CoCreateInstance
(
&
CLSID_ACMWrapper
,
&
test_outer
,
CLSCTX_INPROC_SERVER
,
&
IID_IBaseFilter
,
(
void
**
)
&
filter
);
ok
(
hr
==
E_NOINTERFACE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
filter
,
"Got interface %p.
\n
"
,
filter
);
hr
=
CoCreateInstance
(
&
CLSID_ACMWrapper
,
&
test_outer
,
CLSCTX_INPROC_SERVER
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
if
(
FAILED
(
hr
))
return
;
ok
(
outer_ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
outer_ref
);
ok
(
unk
!=
&
test_outer
,
"Returned IUnknown should not be outer IUnknown.
\n
"
);
ref
=
get_refcount
(
unk
);
ok
(
ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ref
=
IUnknown_AddRef
(
unk
);
ok
(
ref
==
2
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ok
(
outer_ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
outer_ref
);
ref
=
IUnknown_Release
(
unk
);
ok
(
ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ok
(
outer_ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
outer_ref
);
hr
=
IUnknown_QueryInterface
(
unk
,
&
IID_IUnknown
,
(
void
**
)
&
unk2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
unk2
==
unk
,
"Got unexpected IUnknown %p.
\n
"
,
unk2
);
IUnknown_Release
(
unk2
);
hr
=
IUnknown_QueryInterface
(
unk
,
&
IID_IBaseFilter
,
(
void
**
)
&
filter
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IBaseFilter_QueryInterface
(
filter
,
&
IID_IUnknown
,
(
void
**
)
&
unk2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
unk2
==
(
IUnknown
*
)
0xdeadbeef
,
"Got unexpected IUnknown %p.
\n
"
,
unk2
);
hr
=
IBaseFilter_QueryInterface
(
filter
,
&
IID_IBaseFilter
,
(
void
**
)
&
filter2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
filter2
==
(
IBaseFilter
*
)
0xdeadbeef
,
"Got unexpected IBaseFilter %p.
\n
"
,
filter2
);
hr
=
IUnknown_QueryInterface
(
unk
,
&
test_iid
,
(
void
**
)
&
unk2
);
ok
(
hr
==
E_NOINTERFACE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
unk2
,
"Got unexpected IUnknown %p.
\n
"
,
unk2
);
hr
=
IBaseFilter_QueryInterface
(
filter
,
&
test_iid
,
(
void
**
)
&
unk2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
unk2
==
(
IUnknown
*
)
0xdeadbeef
,
"Got unexpected IUnknown %p.
\n
"
,
unk2
);
IBaseFilter_Release
(
filter
);
ref
=
IUnknown_Release
(
unk
);
ok
(
!
ref
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ok
(
outer_ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
outer_ref
);
}
static
void
test_enum_pins
(
void
)
{
IBaseFilter
*
filter
=
create_acm_wrapper
();
...
...
@@ -356,6 +451,7 @@ START_TEST(acmwrapper)
CoInitialize
(
NULL
);
test_interfaces
();
test_aggregation
();
test_enum_pins
();
test_find_pin
();
test_pin_info
();
...
...
dlls/quartz/tests/avidec.c
View file @
09f59571
...
...
@@ -133,6 +133,101 @@ static void test_interfaces(void)
IBaseFilter_Release
(
filter
);
}
static
const
GUID
test_iid
=
{
0x33333333
};
static
LONG
outer_ref
=
1
;
static
HRESULT
WINAPI
outer_QueryInterface
(
IUnknown
*
iface
,
REFIID
iid
,
void
**
out
)
{
if
(
IsEqualGUID
(
iid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
iid
,
&
IID_IBaseFilter
)
||
IsEqualGUID
(
iid
,
&
test_iid
))
{
*
out
=
(
IUnknown
*
)
0xdeadbeef
;
return
S_OK
;
}
ok
(
0
,
"unexpected call %s
\n
"
,
wine_dbgstr_guid
(
iid
));
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
outer_AddRef
(
IUnknown
*
iface
)
{
return
InterlockedIncrement
(
&
outer_ref
);
}
static
ULONG
WINAPI
outer_Release
(
IUnknown
*
iface
)
{
return
InterlockedDecrement
(
&
outer_ref
);
}
static
const
IUnknownVtbl
outer_vtbl
=
{
outer_QueryInterface
,
outer_AddRef
,
outer_Release
,
};
static
IUnknown
test_outer
=
{
&
outer_vtbl
};
static
void
test_aggregation
(
void
)
{
IBaseFilter
*
filter
,
*
filter2
;
IUnknown
*
unk
,
*
unk2
;
HRESULT
hr
;
ULONG
ref
;
filter
=
(
IBaseFilter
*
)
0xdeadbeef
;
hr
=
CoCreateInstance
(
&
CLSID_AVIDec
,
&
test_outer
,
CLSCTX_INPROC_SERVER
,
&
IID_IBaseFilter
,
(
void
**
)
&
filter
);
ok
(
hr
==
E_NOINTERFACE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
filter
,
"Got interface %p.
\n
"
,
filter
);
hr
=
CoCreateInstance
(
&
CLSID_AVIDec
,
&
test_outer
,
CLSCTX_INPROC_SERVER
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
if
(
FAILED
(
hr
))
return
;
ok
(
outer_ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
outer_ref
);
ok
(
unk
!=
&
test_outer
,
"Returned IUnknown should not be outer IUnknown.
\n
"
);
ref
=
get_refcount
(
unk
);
ok
(
ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ref
=
IUnknown_AddRef
(
unk
);
ok
(
ref
==
2
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ok
(
outer_ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
outer_ref
);
ref
=
IUnknown_Release
(
unk
);
ok
(
ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ok
(
outer_ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
outer_ref
);
hr
=
IUnknown_QueryInterface
(
unk
,
&
IID_IUnknown
,
(
void
**
)
&
unk2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
unk2
==
unk
,
"Got unexpected IUnknown %p.
\n
"
,
unk2
);
IUnknown_Release
(
unk2
);
hr
=
IUnknown_QueryInterface
(
unk
,
&
IID_IBaseFilter
,
(
void
**
)
&
filter
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IBaseFilter_QueryInterface
(
filter
,
&
IID_IUnknown
,
(
void
**
)
&
unk2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
unk2
==
(
IUnknown
*
)
0xdeadbeef
,
"Got unexpected IUnknown %p.
\n
"
,
unk2
);
hr
=
IBaseFilter_QueryInterface
(
filter
,
&
IID_IBaseFilter
,
(
void
**
)
&
filter2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
filter2
==
(
IBaseFilter
*
)
0xdeadbeef
,
"Got unexpected IBaseFilter %p.
\n
"
,
filter2
);
hr
=
IUnknown_QueryInterface
(
unk
,
&
test_iid
,
(
void
**
)
&
unk2
);
ok
(
hr
==
E_NOINTERFACE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
unk2
,
"Got unexpected IUnknown %p.
\n
"
,
unk2
);
hr
=
IBaseFilter_QueryInterface
(
filter
,
&
test_iid
,
(
void
**
)
&
unk2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
unk2
==
(
IUnknown
*
)
0xdeadbeef
,
"Got unexpected IUnknown %p.
\n
"
,
unk2
);
IBaseFilter_Release
(
filter
);
ref
=
IUnknown_Release
(
unk
);
ok
(
!
ref
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ok
(
outer_ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
outer_ref
);
}
static
void
test_enum_pins
(
void
)
{
IBaseFilter
*
filter
=
create_avi_dec
();
...
...
@@ -463,6 +558,7 @@ START_TEST(avidec)
CoInitialize
(
NULL
);
test_interfaces
();
test_aggregation
();
test_enum_pins
();
test_find_pin
();
test_pin_info
();
...
...
dlls/quartz/tests/avisplit.c
View file @
09f59571
...
...
@@ -172,6 +172,101 @@ static void test_interfaces(void)
DeleteFileW
(
filename
);
}
static
const
GUID
test_iid
=
{
0x33333333
};
static
LONG
outer_ref
=
1
;
static
HRESULT
WINAPI
outer_QueryInterface
(
IUnknown
*
iface
,
REFIID
iid
,
void
**
out
)
{
if
(
IsEqualGUID
(
iid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
iid
,
&
IID_IBaseFilter
)
||
IsEqualGUID
(
iid
,
&
test_iid
))
{
*
out
=
(
IUnknown
*
)
0xdeadbeef
;
return
S_OK
;
}
ok
(
0
,
"unexpected call %s
\n
"
,
wine_dbgstr_guid
(
iid
));
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
outer_AddRef
(
IUnknown
*
iface
)
{
return
InterlockedIncrement
(
&
outer_ref
);
}
static
ULONG
WINAPI
outer_Release
(
IUnknown
*
iface
)
{
return
InterlockedDecrement
(
&
outer_ref
);
}
static
const
IUnknownVtbl
outer_vtbl
=
{
outer_QueryInterface
,
outer_AddRef
,
outer_Release
,
};
static
IUnknown
test_outer
=
{
&
outer_vtbl
};
static
void
test_aggregation
(
void
)
{
IBaseFilter
*
filter
,
*
filter2
;
IUnknown
*
unk
,
*
unk2
;
HRESULT
hr
;
ULONG
ref
;
filter
=
(
IBaseFilter
*
)
0xdeadbeef
;
hr
=
CoCreateInstance
(
&
CLSID_AviSplitter
,
&
test_outer
,
CLSCTX_INPROC_SERVER
,
&
IID_IBaseFilter
,
(
void
**
)
&
filter
);
ok
(
hr
==
E_NOINTERFACE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
filter
,
"Got interface %p.
\n
"
,
filter
);
hr
=
CoCreateInstance
(
&
CLSID_AviSplitter
,
&
test_outer
,
CLSCTX_INPROC_SERVER
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
if
(
FAILED
(
hr
))
return
;
ok
(
outer_ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
outer_ref
);
ok
(
unk
!=
&
test_outer
,
"Returned IUnknown should not be outer IUnknown.
\n
"
);
ref
=
get_refcount
(
unk
);
ok
(
ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ref
=
IUnknown_AddRef
(
unk
);
ok
(
ref
==
2
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ok
(
outer_ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
outer_ref
);
ref
=
IUnknown_Release
(
unk
);
ok
(
ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ok
(
outer_ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
outer_ref
);
hr
=
IUnknown_QueryInterface
(
unk
,
&
IID_IUnknown
,
(
void
**
)
&
unk2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
unk2
==
unk
,
"Got unexpected IUnknown %p.
\n
"
,
unk2
);
IUnknown_Release
(
unk2
);
hr
=
IUnknown_QueryInterface
(
unk
,
&
IID_IBaseFilter
,
(
void
**
)
&
filter
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IBaseFilter_QueryInterface
(
filter
,
&
IID_IUnknown
,
(
void
**
)
&
unk2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
unk2
==
(
IUnknown
*
)
0xdeadbeef
,
"Got unexpected IUnknown %p.
\n
"
,
unk2
);
hr
=
IBaseFilter_QueryInterface
(
filter
,
&
IID_IBaseFilter
,
(
void
**
)
&
filter2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
filter2
==
(
IBaseFilter
*
)
0xdeadbeef
,
"Got unexpected IBaseFilter %p.
\n
"
,
filter2
);
hr
=
IUnknown_QueryInterface
(
unk
,
&
test_iid
,
(
void
**
)
&
unk2
);
ok
(
hr
==
E_NOINTERFACE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
unk2
,
"Got unexpected IUnknown %p.
\n
"
,
unk2
);
hr
=
IBaseFilter_QueryInterface
(
filter
,
&
test_iid
,
(
void
**
)
&
unk2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
unk2
==
(
IUnknown
*
)
0xdeadbeef
,
"Got unexpected IUnknown %p.
\n
"
,
unk2
);
IBaseFilter_Release
(
filter
);
ref
=
IUnknown_Release
(
unk
);
ok
(
!
ref
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ok
(
outer_ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
outer_ref
);
}
static
void
test_enum_pins
(
void
)
{
const
WCHAR
*
filename
=
load_resource
(
avifile
);
...
...
@@ -810,6 +905,7 @@ START_TEST(avisplit)
CoInitialize
(
NULL
);
test_interfaces
();
test_aggregation
();
test_enum_pins
();
test_find_pin
();
test_pin_info
();
...
...
dlls/quartz/tests/dsoundrender.c
View file @
09f59571
...
...
@@ -167,6 +167,101 @@ static void test_interfaces(void)
IBaseFilter_Release
(
filter
);
}
static
const
GUID
test_iid
=
{
0x33333333
};
static
LONG
outer_ref
=
1
;
static
HRESULT
WINAPI
outer_QueryInterface
(
IUnknown
*
iface
,
REFIID
iid
,
void
**
out
)
{
if
(
IsEqualGUID
(
iid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
iid
,
&
IID_IBaseFilter
)
||
IsEqualGUID
(
iid
,
&
test_iid
))
{
*
out
=
(
IUnknown
*
)
0xdeadbeef
;
return
S_OK
;
}
ok
(
0
,
"unexpected call %s
\n
"
,
wine_dbgstr_guid
(
iid
));
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
outer_AddRef
(
IUnknown
*
iface
)
{
return
InterlockedIncrement
(
&
outer_ref
);
}
static
ULONG
WINAPI
outer_Release
(
IUnknown
*
iface
)
{
return
InterlockedDecrement
(
&
outer_ref
);
}
static
const
IUnknownVtbl
outer_vtbl
=
{
outer_QueryInterface
,
outer_AddRef
,
outer_Release
,
};
static
IUnknown
test_outer
=
{
&
outer_vtbl
};
static
void
test_aggregation
(
void
)
{
IBaseFilter
*
filter
,
*
filter2
;
IUnknown
*
unk
,
*
unk2
;
HRESULT
hr
;
ULONG
ref
;
filter
=
(
IBaseFilter
*
)
0xdeadbeef
;
hr
=
CoCreateInstance
(
&
CLSID_DSoundRender
,
&
test_outer
,
CLSCTX_INPROC_SERVER
,
&
IID_IBaseFilter
,
(
void
**
)
&
filter
);
ok
(
hr
==
E_NOINTERFACE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
filter
,
"Got interface %p.
\n
"
,
filter
);
hr
=
CoCreateInstance
(
&
CLSID_DSoundRender
,
&
test_outer
,
CLSCTX_INPROC_SERVER
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
if
(
FAILED
(
hr
))
return
;
ok
(
outer_ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
outer_ref
);
ok
(
unk
!=
&
test_outer
,
"Returned IUnknown should not be outer IUnknown.
\n
"
);
ref
=
get_refcount
(
unk
);
ok
(
ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ref
=
IUnknown_AddRef
(
unk
);
ok
(
ref
==
2
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ok
(
outer_ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
outer_ref
);
ref
=
IUnknown_Release
(
unk
);
ok
(
ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ok
(
outer_ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
outer_ref
);
hr
=
IUnknown_QueryInterface
(
unk
,
&
IID_IUnknown
,
(
void
**
)
&
unk2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
unk2
==
unk
,
"Got unexpected IUnknown %p.
\n
"
,
unk2
);
IUnknown_Release
(
unk2
);
hr
=
IUnknown_QueryInterface
(
unk
,
&
IID_IBaseFilter
,
(
void
**
)
&
filter
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IBaseFilter_QueryInterface
(
filter
,
&
IID_IUnknown
,
(
void
**
)
&
unk2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
unk2
==
(
IUnknown
*
)
0xdeadbeef
,
"Got unexpected IUnknown %p.
\n
"
,
unk2
);
hr
=
IBaseFilter_QueryInterface
(
filter
,
&
IID_IBaseFilter
,
(
void
**
)
&
filter2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
filter2
==
(
IBaseFilter
*
)
0xdeadbeef
,
"Got unexpected IBaseFilter %p.
\n
"
,
filter2
);
hr
=
IUnknown_QueryInterface
(
unk
,
&
test_iid
,
(
void
**
)
&
unk2
);
ok
(
hr
==
E_NOINTERFACE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
unk2
,
"Got unexpected IUnknown %p.
\n
"
,
unk2
);
hr
=
IBaseFilter_QueryInterface
(
filter
,
&
test_iid
,
(
void
**
)
&
unk2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
unk2
==
(
IUnknown
*
)
0xdeadbeef
,
"Got unexpected IUnknown %p.
\n
"
,
unk2
);
IBaseFilter_Release
(
filter
);
ref
=
IUnknown_Release
(
unk
);
ok
(
!
ref
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ok
(
outer_ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
outer_ref
);
}
static
void
test_enum_pins
(
void
)
{
IBaseFilter
*
filter
=
create_dsound_render
();
...
...
@@ -478,6 +573,7 @@ START_TEST(dsoundrender)
test_property_bag
();
test_interfaces
();
test_aggregation
();
test_enum_pins
();
test_find_pin
();
test_pin_info
();
...
...
dlls/quartz/tests/filesource.c
View file @
09f59571
...
...
@@ -133,6 +133,101 @@ static void test_interfaces(void)
IBaseFilter_Release
(
filter
);
}
static
const
GUID
test_iid
=
{
0x33333333
};
static
LONG
outer_ref
=
1
;
static
HRESULT
WINAPI
outer_QueryInterface
(
IUnknown
*
iface
,
REFIID
iid
,
void
**
out
)
{
if
(
IsEqualGUID
(
iid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
iid
,
&
IID_IBaseFilter
)
||
IsEqualGUID
(
iid
,
&
test_iid
))
{
*
out
=
(
IUnknown
*
)
0xdeadbeef
;
return
S_OK
;
}
ok
(
0
,
"unexpected call %s
\n
"
,
wine_dbgstr_guid
(
iid
));
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
outer_AddRef
(
IUnknown
*
iface
)
{
return
InterlockedIncrement
(
&
outer_ref
);
}
static
ULONG
WINAPI
outer_Release
(
IUnknown
*
iface
)
{
return
InterlockedDecrement
(
&
outer_ref
);
}
static
const
IUnknownVtbl
outer_vtbl
=
{
outer_QueryInterface
,
outer_AddRef
,
outer_Release
,
};
static
IUnknown
test_outer
=
{
&
outer_vtbl
};
static
void
test_aggregation
(
void
)
{
IBaseFilter
*
filter
,
*
filter2
;
IUnknown
*
unk
,
*
unk2
;
HRESULT
hr
;
ULONG
ref
;
filter
=
(
IBaseFilter
*
)
0xdeadbeef
;
hr
=
CoCreateInstance
(
&
CLSID_AsyncReader
,
&
test_outer
,
CLSCTX_INPROC_SERVER
,
&
IID_IBaseFilter
,
(
void
**
)
&
filter
);
ok
(
hr
==
E_NOINTERFACE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
filter
,
"Got interface %p.
\n
"
,
filter
);
hr
=
CoCreateInstance
(
&
CLSID_AsyncReader
,
&
test_outer
,
CLSCTX_INPROC_SERVER
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
if
(
FAILED
(
hr
))
return
;
ok
(
outer_ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
outer_ref
);
ok
(
unk
!=
&
test_outer
,
"Returned IUnknown should not be outer IUnknown.
\n
"
);
ref
=
get_refcount
(
unk
);
ok
(
ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ref
=
IUnknown_AddRef
(
unk
);
ok
(
ref
==
2
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ok
(
outer_ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
outer_ref
);
ref
=
IUnknown_Release
(
unk
);
ok
(
ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ok
(
outer_ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
outer_ref
);
hr
=
IUnknown_QueryInterface
(
unk
,
&
IID_IUnknown
,
(
void
**
)
&
unk2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
unk2
==
unk
,
"Got unexpected IUnknown %p.
\n
"
,
unk2
);
IUnknown_Release
(
unk2
);
hr
=
IUnknown_QueryInterface
(
unk
,
&
IID_IBaseFilter
,
(
void
**
)
&
filter
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IBaseFilter_QueryInterface
(
filter
,
&
IID_IUnknown
,
(
void
**
)
&
unk2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
unk2
==
(
IUnknown
*
)
0xdeadbeef
,
"Got unexpected IUnknown %p.
\n
"
,
unk2
);
hr
=
IBaseFilter_QueryInterface
(
filter
,
&
IID_IBaseFilter
,
(
void
**
)
&
filter2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
filter2
==
(
IBaseFilter
*
)
0xdeadbeef
,
"Got unexpected IBaseFilter %p.
\n
"
,
filter2
);
hr
=
IUnknown_QueryInterface
(
unk
,
&
test_iid
,
(
void
**
)
&
unk2
);
ok
(
hr
==
E_NOINTERFACE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
unk2
,
"Got unexpected IUnknown %p.
\n
"
,
unk2
);
hr
=
IBaseFilter_QueryInterface
(
filter
,
&
test_iid
,
(
void
**
)
&
unk2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
unk2
==
(
IUnknown
*
)
0xdeadbeef
,
"Got unexpected IUnknown %p.
\n
"
,
unk2
);
IBaseFilter_Release
(
filter
);
ref
=
IUnknown_Release
(
unk
);
ok
(
!
ref
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ok
(
outer_ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
outer_ref
);
}
static
void
test_file_source_filter
(
void
)
{
static
const
WCHAR
prefix
[]
=
{
'w'
,
'i'
,
'n'
,
0
};
...
...
@@ -971,6 +1066,7 @@ START_TEST(filesource)
CoInitialize
(
NULL
);
test_interfaces
();
test_aggregation
();
test_enum_pins
();
test_find_pin
();
test_pin_info
();
...
...
dlls/quartz/tests/mpegsplit.c
View file @
09f59571
...
...
@@ -175,6 +175,101 @@ static void test_interfaces(void)
DeleteFileW
(
filename
);
}
static
const
GUID
test_iid
=
{
0x33333333
};
static
LONG
outer_ref
=
1
;
static
HRESULT
WINAPI
outer_QueryInterface
(
IUnknown
*
iface
,
REFIID
iid
,
void
**
out
)
{
if
(
IsEqualGUID
(
iid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
iid
,
&
IID_IBaseFilter
)
||
IsEqualGUID
(
iid
,
&
test_iid
))
{
*
out
=
(
IUnknown
*
)
0xdeadbeef
;
return
S_OK
;
}
ok
(
0
,
"unexpected call %s
\n
"
,
wine_dbgstr_guid
(
iid
));
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
outer_AddRef
(
IUnknown
*
iface
)
{
return
InterlockedIncrement
(
&
outer_ref
);
}
static
ULONG
WINAPI
outer_Release
(
IUnknown
*
iface
)
{
return
InterlockedDecrement
(
&
outer_ref
);
}
static
const
IUnknownVtbl
outer_vtbl
=
{
outer_QueryInterface
,
outer_AddRef
,
outer_Release
,
};
static
IUnknown
test_outer
=
{
&
outer_vtbl
};
static
void
test_aggregation
(
void
)
{
IBaseFilter
*
filter
,
*
filter2
;
IUnknown
*
unk
,
*
unk2
;
HRESULT
hr
;
ULONG
ref
;
filter
=
(
IBaseFilter
*
)
0xdeadbeef
;
hr
=
CoCreateInstance
(
&
CLSID_MPEG1Splitter
,
&
test_outer
,
CLSCTX_INPROC_SERVER
,
&
IID_IBaseFilter
,
(
void
**
)
&
filter
);
ok
(
hr
==
E_NOINTERFACE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
filter
,
"Got interface %p.
\n
"
,
filter
);
hr
=
CoCreateInstance
(
&
CLSID_MPEG1Splitter
,
&
test_outer
,
CLSCTX_INPROC_SERVER
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
if
(
FAILED
(
hr
))
return
;
ok
(
outer_ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
outer_ref
);
ok
(
unk
!=
&
test_outer
,
"Returned IUnknown should not be outer IUnknown.
\n
"
);
ref
=
get_refcount
(
unk
);
ok
(
ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ref
=
IUnknown_AddRef
(
unk
);
ok
(
ref
==
2
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ok
(
outer_ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
outer_ref
);
ref
=
IUnknown_Release
(
unk
);
ok
(
ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ok
(
outer_ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
outer_ref
);
hr
=
IUnknown_QueryInterface
(
unk
,
&
IID_IUnknown
,
(
void
**
)
&
unk2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
unk2
==
unk
,
"Got unexpected IUnknown %p.
\n
"
,
unk2
);
IUnknown_Release
(
unk2
);
hr
=
IUnknown_QueryInterface
(
unk
,
&
IID_IBaseFilter
,
(
void
**
)
&
filter
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IBaseFilter_QueryInterface
(
filter
,
&
IID_IUnknown
,
(
void
**
)
&
unk2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
unk2
==
(
IUnknown
*
)
0xdeadbeef
,
"Got unexpected IUnknown %p.
\n
"
,
unk2
);
hr
=
IBaseFilter_QueryInterface
(
filter
,
&
IID_IBaseFilter
,
(
void
**
)
&
filter2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
filter2
==
(
IBaseFilter
*
)
0xdeadbeef
,
"Got unexpected IBaseFilter %p.
\n
"
,
filter2
);
hr
=
IUnknown_QueryInterface
(
unk
,
&
test_iid
,
(
void
**
)
&
unk2
);
ok
(
hr
==
E_NOINTERFACE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
unk2
,
"Got unexpected IUnknown %p.
\n
"
,
unk2
);
hr
=
IBaseFilter_QueryInterface
(
filter
,
&
test_iid
,
(
void
**
)
&
unk2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
unk2
==
(
IUnknown
*
)
0xdeadbeef
,
"Got unexpected IUnknown %p.
\n
"
,
unk2
);
IBaseFilter_Release
(
filter
);
ref
=
IUnknown_Release
(
unk
);
ok
(
!
ref
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ok
(
outer_ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
outer_ref
);
}
static
void
test_enum_pins
(
void
)
{
const
WCHAR
*
filename
=
load_resource
(
mp3file
);
...
...
@@ -723,6 +818,7 @@ START_TEST(mpegsplit)
CoInitialize
(
NULL
);
test_interfaces
();
test_aggregation
();
test_enum_pins
();
test_find_pin
();
test_pin_info
();
...
...
dlls/quartz/tests/waveparser.c
View file @
09f59571
...
...
@@ -169,6 +169,101 @@ static void test_interfaces(void)
DeleteFileW
(
filename
);
}
static
const
GUID
test_iid
=
{
0x33333333
};
static
LONG
outer_ref
=
1
;
static
HRESULT
WINAPI
outer_QueryInterface
(
IUnknown
*
iface
,
REFIID
iid
,
void
**
out
)
{
if
(
IsEqualGUID
(
iid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
iid
,
&
IID_IBaseFilter
)
||
IsEqualGUID
(
iid
,
&
test_iid
))
{
*
out
=
(
IUnknown
*
)
0xdeadbeef
;
return
S_OK
;
}
ok
(
0
,
"unexpected call %s
\n
"
,
wine_dbgstr_guid
(
iid
));
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
outer_AddRef
(
IUnknown
*
iface
)
{
return
InterlockedIncrement
(
&
outer_ref
);
}
static
ULONG
WINAPI
outer_Release
(
IUnknown
*
iface
)
{
return
InterlockedDecrement
(
&
outer_ref
);
}
static
const
IUnknownVtbl
outer_vtbl
=
{
outer_QueryInterface
,
outer_AddRef
,
outer_Release
,
};
static
IUnknown
test_outer
=
{
&
outer_vtbl
};
static
void
test_aggregation
(
void
)
{
IBaseFilter
*
filter
,
*
filter2
;
IUnknown
*
unk
,
*
unk2
;
HRESULT
hr
;
ULONG
ref
;
filter
=
(
IBaseFilter
*
)
0xdeadbeef
;
hr
=
CoCreateInstance
(
&
CLSID_WAVEParser
,
&
test_outer
,
CLSCTX_INPROC_SERVER
,
&
IID_IBaseFilter
,
(
void
**
)
&
filter
);
ok
(
hr
==
E_NOINTERFACE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
filter
,
"Got interface %p.
\n
"
,
filter
);
hr
=
CoCreateInstance
(
&
CLSID_WAVEParser
,
&
test_outer
,
CLSCTX_INPROC_SERVER
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
if
(
FAILED
(
hr
))
return
;
ok
(
outer_ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
outer_ref
);
ok
(
unk
!=
&
test_outer
,
"Returned IUnknown should not be outer IUnknown.
\n
"
);
ref
=
get_refcount
(
unk
);
ok
(
ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ref
=
IUnknown_AddRef
(
unk
);
ok
(
ref
==
2
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ok
(
outer_ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
outer_ref
);
ref
=
IUnknown_Release
(
unk
);
ok
(
ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ok
(
outer_ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
outer_ref
);
hr
=
IUnknown_QueryInterface
(
unk
,
&
IID_IUnknown
,
(
void
**
)
&
unk2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
unk2
==
unk
,
"Got unexpected IUnknown %p.
\n
"
,
unk2
);
IUnknown_Release
(
unk2
);
hr
=
IUnknown_QueryInterface
(
unk
,
&
IID_IBaseFilter
,
(
void
**
)
&
filter
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IBaseFilter_QueryInterface
(
filter
,
&
IID_IUnknown
,
(
void
**
)
&
unk2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
unk2
==
(
IUnknown
*
)
0xdeadbeef
,
"Got unexpected IUnknown %p.
\n
"
,
unk2
);
hr
=
IBaseFilter_QueryInterface
(
filter
,
&
IID_IBaseFilter
,
(
void
**
)
&
filter2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
filter2
==
(
IBaseFilter
*
)
0xdeadbeef
,
"Got unexpected IBaseFilter %p.
\n
"
,
filter2
);
hr
=
IUnknown_QueryInterface
(
unk
,
&
test_iid
,
(
void
**
)
&
unk2
);
ok
(
hr
==
E_NOINTERFACE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
unk2
,
"Got unexpected IUnknown %p.
\n
"
,
unk2
);
hr
=
IBaseFilter_QueryInterface
(
filter
,
&
test_iid
,
(
void
**
)
&
unk2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
unk2
==
(
IUnknown
*
)
0xdeadbeef
,
"Got unexpected IUnknown %p.
\n
"
,
unk2
);
IBaseFilter_Release
(
filter
);
ref
=
IUnknown_Release
(
unk
);
ok
(
!
ref
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ok
(
outer_ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
outer_ref
);
}
static
void
test_enum_pins
(
void
)
{
const
WCHAR
*
filename
=
load_resource
(
wavefile
);
...
...
@@ -556,6 +651,7 @@ START_TEST(waveparser)
CoInitialize
(
NULL
);
test_interfaces
();
test_aggregation
();
test_enum_pins
();
test_find_pin
();
test_pin_info
();
...
...
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