quartz/tests: Use proper method macros

Nikolay Sivov nsivov at codeweavers.com
Fri Aug 24 04:26:44 CDT 2012


Use proper method macros
-------------- next part --------------
>From a5d506539fca26378e2c5dba0b2ec7baab0a4332 Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <nsivov at codeweavers.com>
Date: Fri, 24 Aug 2012 13:01:11 +0400
Subject: [PATCH 3/6] Use proper method macros

---
 dlls/quartz/tests/avisplitter.c   |   24 ++++++++++++------------
 dlls/quartz/tests/dsoundrender.c  |    2 +-
 dlls/quartz/tests/filtergraph.c   |   22 +++++++++++-----------
 dlls/quartz/tests/memallocator.c  |    4 ++--
 dlls/quartz/tests/videorenderer.c |    2 +-
 5 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/dlls/quartz/tests/avisplitter.c b/dlls/quartz/tests/avisplitter.c
index 250c631..ad01906 100644
--- a/dlls/quartz/tests/avisplitter.c
+++ b/dlls/quartz/tests/avisplitter.c
@@ -227,7 +227,7 @@ static void test_threads(void)
     ok(hr == E_NOINTERFACE,
         "Avi splitter returns unexpected error: %08x\n", hr);
     if (pfile)
-        IUnknown_Release(pfile);
+        IFileSourceFilter_Release(pfile);
     pfile = NULL;
 
     hr = CoCreateInstance(&CLSID_AsyncReader, NULL, CLSCTX_INPROC_SERVER,
@@ -236,7 +236,7 @@ static void test_threads(void)
     if (hr != S_OK)
         goto fail;
 
-    hr = IUnknown_QueryInterface(preader, &IID_IFileSourceFilter,
+    hr = IBaseFilter_QueryInterface(preader, &IID_IFileSourceFilter,
         (void**)&pfile);
     ok(hr == S_OK, "Could not get IFileSourceFilter: %08x\n", hr);
     if (hr != S_OK)
@@ -265,7 +265,7 @@ static void test_threads(void)
     if (hr != S_OK)
         goto fail;
 
-    IUnknown_Release(enumpins);
+    IEnumPins_Release(enumpins);
     enumpins = NULL;
 
     hr = IBaseFilter_EnumPins(pavi, &enumpins);
@@ -292,7 +292,7 @@ static void test_threads(void)
     ok(curlevel == expected,
         "The thread count should be %d not %d\n", expected, curlevel);
 
-    IUnknown_Release(avipin);
+    IPin_Release(avipin);
     avipin = NULL;
 
     IEnumPins_Reset(enumpins);
@@ -334,12 +334,12 @@ static void test_threads(void)
             ++expected;
         }
 
-        IUnknown_Release(avipin);
+        IPin_Release(avipin);
         avipin = NULL;
     }
 
     if (avipin)
-        IUnknown_Release(avipin);
+        IPin_Release(avipin);
     avipin = NULL;
 
     if (hr != S_OK)
@@ -414,10 +414,10 @@ fail:
     if (hr != S_OK)
         skip("Prerequisites not matched, skipping remainder of test\n");
     if (enumpins)
-        IUnknown_Release(enumpins);
+        IEnumPins_Release(enumpins);
 
     if (avipin)
-        IUnknown_Release(avipin);
+        IPin_Release(avipin);
     if (filepin)
     {
         IPin *to = NULL;
@@ -428,15 +428,15 @@ fail:
             IPin_Disconnect(filepin);
             IPin_Disconnect(to);
         }
-        IUnknown_Release(filepin);
+        IPin_Release(filepin);
     }
 
     if (preader)
-        IUnknown_Release(preader);
+        IBaseFilter_Release(preader);
     if (pavi)
-        IUnknown_Release(pavi);
+        IBaseFilter_Release(pavi);
     if (pfile)
-        IUnknown_Release(pfile);
+        IFileSourceFilter_Release(pfile);
 
     curlevel = count_threads();
     todo_wine
diff --git a/dlls/quartz/tests/dsoundrender.c b/dlls/quartz/tests/dsoundrender.c
index fc214e1..a3e4778 100644
--- a/dlls/quartz/tests/dsoundrender.c
+++ b/dlls/quartz/tests/dsoundrender.c
@@ -33,7 +33,7 @@
     ok(ppv != NULL, "Pointer is NULL\n");
 
 #define RELEASE_EXPECT(iface, num) if (iface) { \
-    hr = IUnknown_Release(iface); \
+    hr = IUnknown_Release((IUnknown*)iface); \
     ok(hr == num, "IUnknown_Release should return %d, got %d\n", num, hr); \
 }
 
diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c
index ea37b2f..6e839a8 100644
--- a/dlls/quartz/tests/filtergraph.c
+++ b/dlls/quartz/tests/filtergraph.c
@@ -236,7 +236,7 @@ static void test_graph_builder_addfilter(void)
 
     hr = IGraphBuilder_AddFilter(pgraph, pF, NULL);
     ok(hr == S_OK, "IGraphBuilder_AddFilter returned: %x\n", hr);
-    IMediaFilter_Release(pF);
+    IBaseFilter_Release(pF);
 }
 
 static void test_mediacontrol(void)
@@ -247,26 +247,26 @@ static void test_mediacontrol(void)
     IMediaFilter *filter = NULL;
     IMediaControl *control = NULL;
 
-    IFilterGraph2_SetDefaultSyncSource(pgraph);
-    hr = IFilterGraph2_QueryInterface(pgraph, &IID_IMediaSeeking, (void**) &seeking);
+    IGraphBuilder_SetDefaultSyncSource(pgraph);
+    hr = IGraphBuilder_QueryInterface(pgraph, &IID_IMediaSeeking, (void**) &seeking);
     ok(hr == S_OK, "QueryInterface IMediaControl failed: %08x\n", hr);
     if (FAILED(hr))
         return;
 
-    hr = IFilterGraph2_QueryInterface(pgraph, &IID_IMediaFilter, (void**) &filter);
+    hr = IGraphBuilder_QueryInterface(pgraph, &IID_IMediaFilter, (void**) &filter);
     ok(hr == S_OK, "QueryInterface IMediaFilter failed: %08x\n", hr);
     if (FAILED(hr))
     {
-        IUnknown_Release(seeking);
+        IMediaSeeking_Release(seeking);
         return;
     }
 
-    hr = IFilterGraph2_QueryInterface(pgraph, &IID_IMediaControl, (void**) &control);
+    hr = IGraphBuilder_QueryInterface(pgraph, &IID_IMediaControl, (void**) &control);
     ok(hr == S_OK, "QueryInterface IMediaControl failed: %08x\n", hr);
     if (FAILED(hr))
     {
-        IUnknown_Release(seeking);
-        IUnknown_Release(filter);
+        IMediaSeeking_Release(seeking);
+        IMediaFilter_Release(filter);
         return;
     }
 
@@ -288,9 +288,9 @@ static void test_mediacontrol(void)
     hr = IMediaControl_GetState(control, 1000, NULL);
     ok(hr == E_POINTER, "GetState expected %08x, got %08x\n", E_POINTER, hr);
 
-    IUnknown_Release(control);
-    IUnknown_Release(seeking);
-    IUnknown_Release(filter);
+    IMediaControl_Release(control);
+    IMediaSeeking_Release(seeking);
+    IMediaFilter_Release(filter);
     releasefiltergraph();
 }
 
diff --git a/dlls/quartz/tests/memallocator.c b/dlls/quartz/tests/memallocator.c
index d2ace87..1086ed5 100644
--- a/dlls/quartz/tests/memallocator.c
+++ b/dlls/quartz/tests/memallocator.c
@@ -69,9 +69,9 @@ static void CommitDecommitTest(void)
 
             hr = IMemAllocator_GetBuffer(pMemAllocator, &sample2, NULL, NULL, 0);
             ok(hr==S_OK, "Could not get a buffer: %x\n", hr);
-            IUnknown_Release(sample);
+            IMediaSample_Release(sample);
             if (sample2)
-                IUnknown_Release(sample2);
+                IMediaSample_Release(sample2);
 
             hr = IMemAllocator_Decommit(pMemAllocator);
             ok(hr==S_OK, "Cecommit returned: %x\n", hr);
diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c
index 3c09f83..ce1ac29 100644
--- a/dlls/quartz/tests/videorenderer.c
+++ b/dlls/quartz/tests/videorenderer.c
@@ -28,7 +28,7 @@
     ok(ppv != NULL, "Pointer is NULL\n");
 
 #define RELEASE_EXPECT(iface, num) if (iface) { \
-    hr = IUnknown_Release(iface); \
+    hr = IUnknown_Release((IUnknown*)iface); \
     ok(hr == num, "IUnknown_Release should return %d, got %d\n", num, hr); \
 }
 
-- 
1.5.6.5



More information about the wine-patches mailing list