[PATCH] dwrite/tests: Avoid refcount test failures [try 2]

Detlef Riekenberg wine.dev at web.de
Mon Apr 29 17:13:55 CDT 2013


Refcounts are an implementation detail.

The first call to IDWriteFont_CreateFontFace use two reference in
early dwrite versions, while updated win7 and win8 versions use only one.

--
By by ... Detlef
---
 dlls/dwrite/tests/font.c |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c
index 9138061..57aed8f 100644
--- a/dlls/dwrite/tests/font.c
+++ b/dlls/dwrite/tests/font.c
@@ -444,19 +444,14 @@ if (0) /* crashes on native */
 
     hr = IDWriteFont_CreateFontFace(font, &fontface);
     ok(hr == S_OK, "got 0x%08x\n", hr);
-    EXPECT_REF(font, 1);
-    EXPECT_REF(fontface, 2);
+    /* refcounts are an implementation detail. As example,
+       the fontface refcount on windows can be 1 or 2 here, depending on the dwrite version */
 
     hr = IDWriteFont_CreateFontFace(font, &fontface2);
     ok(hr == S_OK, "got 0x%08x\n", hr);
     ok(fontface == fontface2, "got %p, was %p\n", fontface2, fontface);
-    EXPECT_REF(fontface, 3);
-    EXPECT_REF(font, 1);
+    /* the fontface refcount is increased here */
 
-    IDWriteFontFace_AddRef(fontface);
-    EXPECT_REF(font, 1);
-    EXPECT_REF(fontface, 4);
-    IDWriteFontFace_Release(fontface);
     IDWriteFontFace_Release(fontface);
 
     IDWriteFontFace_Release(fontface);
-- 
1.7.5.4




More information about the wine-patches mailing list