Alexander Dorofeyev : quartz/tests: Fix interface leaks in aggregation test .

Alexandre Julliard julliard at winehq.org
Fri Jul 18 06:46:11 CDT 2008


Module: wine
Branch: master
Commit: 4afad0a4130cbcfd694122de6d06bd89d653c417
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4afad0a4130cbcfd694122de6d06bd89d653c417

Author: Alexander Dorofeyev <alexd4 at inbox.lv>
Date:   Thu Jul 17 21:54:53 2008 +0300

quartz/tests: Fix interface leaks in aggregation test.

---

 dlls/quartz/tests/misc.c |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/dlls/quartz/tests/misc.c b/dlls/quartz/tests/misc.c
index f310a77..95468b4 100644
--- a/dlls/quartz/tests/misc.c
+++ b/dlls/quartz/tests/misc.c
@@ -32,19 +32,20 @@
     ok(ppv == NULL, "Pointer is %p\n", ppv);
 
 #define ADDREF_EXPECT(iface, num) if (iface) { \
-    hr = IUnknown_AddRef(iface); \
-    ok(hr == num, "IUnknown_AddRef should return %d, got %d\n", num, hr); \
+    refCount = IUnknown_AddRef(iface); \
+    ok(refCount == num, "IUnknown_AddRef should return %d, got %d\n", num, refCount); \
 }
 
 #define RELEASE_EXPECT(iface, num) if (iface) { \
-    hr = IUnknown_Release(iface); \
-    ok(hr == num, "IUnknown_Release should return %d, got %d\n", num, hr); \
+    refCount = IUnknown_Release(iface); \
+    ok(refCount == num, "IUnknown_Release should return %d, got %d\n", num, refCount); \
 }
 
 static void test_aggregation(const CLSID clsidOuter, const CLSID clsidInner,
                              const IID iidOuter, const IID iidInner)
 {
     HRESULT hr;
+    ULONG refCount;
     IUnknown *pUnkOuter = NULL;
     IUnknown *pUnkInner = NULL;
     IUnknown *pUnkInnerFail = NULL;
@@ -134,6 +135,16 @@ static void test_aggregation(const CLSID clsidOuter, const CLSID clsidInner,
     RELEASE_EXPECT(pUnkInnerTest, 2);
     RELEASE_EXPECT(pUnkOuter, 7);
     RELEASE_EXPECT(pUnkInner, 1);
+
+    do
+    {
+        refCount = IUnknown_Release(pUnkInner);
+    } while (refCount);
+
+    do
+    {
+        refCount = IUnknown_Release(pUnkOuter);
+    } while (refCount);
 }
 
 static void test_video_renderer_aggregations(void)




More information about the wine-cvs mailing list