quartz:avisplitter Fix query interface test
Alexandre Goujon
ale.goujon at gmail.com
Fri Sep 17 08:32:10 CDT 2010
The macro makes the test more readable and easier to extend.
However, you may prefer the old version.
Just let me know and I'll send a try2 accordingly.
---
dlls/quartz/parser.c | 2 -
dlls/quartz/tests/avisplitter.c | 40 ++++++++++++++++----------------------
2 files changed, 17 insertions(+), 25 deletions(-)
diff --git a/dlls/quartz/parser.c b/dlls/quartz/parser.c
index da5e9d3..9beec35 100644
--- a/dlls/quartz/parser.c
+++ b/dlls/quartz/parser.c
@@ -122,8 +122,6 @@ HRESULT WINAPI Parser_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID *
*ppv = This;
else if (IsEqualIID(riid, &IID_IBaseFilter))
*ppv = This;
- else if (IsEqualIID(riid, &IID_IMediaSeeking))
- *ppv = &This->mediaSeeking;
if (*ppv)
{
diff --git a/dlls/quartz/tests/avisplitter.c b/dlls/quartz/tests/avisplitter.c
index 33a0d6d..3a0a9e2 100644
--- a/dlls/quartz/tests/avisplitter.c
+++ b/dlls/quartz/tests/avisplitter.c
@@ -89,29 +89,23 @@ static void test_query_interface(void)
ULONG ref;
IUnknown *iface= NULL;
- hr = IUnknown_QueryInterface(pAviSplitter, &IID_IBaseFilter,
- (void**)&iface);
-
- 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
-*/
+#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)
+
+ 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)
--
1.7.0.4
More information about the wine-patches
mailing list