From 11a01849e81cd0118ee792c6db935b365006dfaa Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Tue, 17 May 2016 21:21:59 +0300 Subject: [PATCH] msxml3/tests: Simplify refcount checks. Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/msxml3/tests/httpreq.c | 7 ++++--- dlls/msxml3/tests/saxreader.c | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/dlls/msxml3/tests/httpreq.c b/dlls/msxml3/tests/httpreq.c index f228b419ae4..b50b153d146 100644 --- a/dlls/msxml3/tests/httpreq.c +++ b/dlls/msxml3/tests/httpreq.c @@ -43,9 +43,10 @@ #define EXPECT_REF(node,ref) _expect_ref((IUnknown*)node, ref, __LINE__) static void _expect_ref(IUnknown* obj, ULONG ref, int line) { - ULONG rc = IUnknown_AddRef(obj); - IUnknown_Release(obj); - ok_(__FILE__,line)(rc-1 == ref, "expected refcount %d, got %d\n", ref, rc-1); + ULONG rc; + IUnknown_AddRef(obj); + 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); diff --git a/dlls/msxml3/tests/saxreader.c b/dlls/msxml3/tests/saxreader.c index a2dc3fb0f7a..5fc62b75540 100644 --- a/dlls/msxml3/tests/saxreader.c +++ b/dlls/msxml3/tests/saxreader.c @@ -43,9 +43,10 @@ static const WCHAR emptyW[] = {0}; #define EXPECT_REF(obj,ref) _expect_ref((IUnknown*)obj, ref, __LINE__) static void _expect_ref(IUnknown* obj, ULONG ref, int line) { - ULONG rc = IUnknown_AddRef(obj); - IUnknown_Release(obj); - ok_(__FILE__,line)(rc-1 == ref, "expected refcount %d, got %d\n", ref, rc-1); + ULONG rc; + IUnknown_AddRef(obj); + rc = IUnknown_Release(obj); + ok_(__FILE__, line)(rc == ref, "expected refcount %d, got %d\n", ref, rc); } static LONG get_refcount(void *iface)