Commit 11a01849 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msxml3/tests: Simplify refcount checks.

parent a3e3dfce
...@@ -43,9 +43,10 @@ ...@@ -43,9 +43,10 @@
#define EXPECT_REF(node,ref) _expect_ref((IUnknown*)node, ref, __LINE__) #define EXPECT_REF(node,ref) _expect_ref((IUnknown*)node, ref, __LINE__)
static void _expect_ref(IUnknown* obj, ULONG ref, int line) static void _expect_ref(IUnknown* obj, ULONG ref, int line)
{ {
ULONG rc = IUnknown_AddRef(obj); ULONG rc;
IUnknown_Release(obj); IUnknown_AddRef(obj);
ok_(__FILE__,line)(rc-1 == ref, "expected refcount %d, got %d\n", ref, rc-1); rc = IUnknown_Release(obj);
ok_(__FILE__, line)(rc == ref, "expected refcount %d, got %d\n", ref, rc);
} }
DEFINE_GUID(SID_SContainerDispatch, 0xb722be00, 0x4e68, 0x101b, 0xa2, 0xbc, 0x00, 0xaa, 0x00, 0x40, 0x47, 0x70); DEFINE_GUID(SID_SContainerDispatch, 0xb722be00, 0x4e68, 0x101b, 0xa2, 0xbc, 0x00, 0xaa, 0x00, 0x40, 0x47, 0x70);
......
...@@ -43,9 +43,10 @@ static const WCHAR emptyW[] = {0}; ...@@ -43,9 +43,10 @@ static const WCHAR emptyW[] = {0};
#define EXPECT_REF(obj,ref) _expect_ref((IUnknown*)obj, ref, __LINE__) #define EXPECT_REF(obj,ref) _expect_ref((IUnknown*)obj, ref, __LINE__)
static void _expect_ref(IUnknown* obj, ULONG ref, int line) static void _expect_ref(IUnknown* obj, ULONG ref, int line)
{ {
ULONG rc = IUnknown_AddRef(obj); ULONG rc;
IUnknown_Release(obj); IUnknown_AddRef(obj);
ok_(__FILE__,line)(rc-1 == ref, "expected refcount %d, got %d\n", ref, rc-1); rc = IUnknown_Release(obj);
ok_(__FILE__, line)(rc == ref, "expected refcount %d, got %d\n", ref, rc);
} }
static LONG get_refcount(void *iface) static LONG get_refcount(void *iface)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment