quartz: avisplitter Fix query interface test.
This commit is contained in:
parent
dfd3e2dcd5
commit
19a0350bde
|
@ -114,16 +114,11 @@ HRESULT WINAPI Parser_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID *
|
|||
|
||||
*ppv = NULL;
|
||||
|
||||
if (IsEqualIID(riid, &IID_IUnknown))
|
||||
if ( IsEqualIID(riid, &IID_IUnknown)
|
||||
|| IsEqualIID(riid, &IID_IPersist)
|
||||
|| IsEqualIID(riid, &IID_IMediaFilter)
|
||||
|| IsEqualIID(riid, &IID_IBaseFilter) )
|
||||
*ppv = This;
|
||||
else if (IsEqualIID(riid, &IID_IPersist))
|
||||
*ppv = This;
|
||||
else if (IsEqualIID(riid, &IID_IMediaFilter))
|
||||
*ppv = This;
|
||||
else if (IsEqualIID(riid, &IID_IBaseFilter))
|
||||
*ppv = This;
|
||||
else if (IsEqualIID(riid, &IID_IMediaSeeking))
|
||||
*ppv = &This->mediaSeeking;
|
||||
|
||||
if (*ppv)
|
||||
{
|
||||
|
|
|
@ -89,29 +89,23 @@ static void test_query_interface(void)
|
|||
ULONG ref;
|
||||
IUnknown *iface= NULL;
|
||||
|
||||
hr = IUnknown_QueryInterface(pAviSplitter, &IID_IBaseFilter,
|
||||
(void**)&iface);
|
||||
#define TEST_INTERFACE(riid,expected) do { \
|
||||
hr = IUnknown_QueryInterface(pAviSplitter, &riid, (void**)&iface); \
|
||||
ok( hr == expected, #riid" should %s got %08X\n", expected==S_OK ? "exist" : "not be present", GetLastError() ); \
|
||||
if (hr == S_OK) { \
|
||||
ref = IUnknown_Release(iface); \
|
||||
ok(ref == 1, "Reference is %u, expected 1\n", ref); \
|
||||
} \
|
||||
iface = NULL; \
|
||||
} while(0)
|
||||
|
||||
ok(hr == S_OK,
|
||||
"IID_IBaseFilter should exist, got %08x!\n", GetLastError());
|
||||
if (hr == S_OK)
|
||||
{
|
||||
ref = IUnknown_Release(iface);
|
||||
iface = NULL;
|
||||
ok(ref == 1, "Reference is %u, expected 1\n", ref);
|
||||
}
|
||||
|
||||
hr = IUnknown_QueryInterface(pAviSplitter, &IID_IMediaSeeking,
|
||||
(void**)&iface);
|
||||
if (hr == S_OK)
|
||||
ref = IUnknown_Release(iface);
|
||||
iface = NULL;
|
||||
todo_wine ok(hr == E_NOINTERFACE,
|
||||
"Query for IMediaSeeking returned: %08x\n", hr);
|
||||
|
||||
/* These interfaces should not be present:
|
||||
IID_IKsPropertySet, IID_IMediaPosition, IID_IQualityControl, IID_IQualProp
|
||||
*/
|
||||
TEST_INTERFACE(IID_IBaseFilter,S_OK);
|
||||
TEST_INTERFACE(IID_IMediaSeeking,E_NOINTERFACE);
|
||||
TEST_INTERFACE(IID_IKsPropertySet,E_NOINTERFACE);
|
||||
TEST_INTERFACE(IID_IMediaPosition,E_NOINTERFACE);
|
||||
TEST_INTERFACE(IID_IQualityControl,E_NOINTERFACE);
|
||||
TEST_INTERFACE(IID_IQualProp,E_NOINTERFACE);
|
||||
#undef TEST_INTERFACE
|
||||
}
|
||||
|
||||
static void test_pin(IPin *pin)
|
||||
|
|
Loading…
Reference in New Issue