[PATCH 3/3] d3drm/tests: Add refcount tests for IDirect3DRMFrame*. (resend)
Aaryaman Vasishta
jem456.vasishta at gmail.com
Thu Jun 9 17:18:47 CDT 2016
Signed-off-by: Aaryaman Vasishta <jem456.vasishta at gmail.com>
---
dlls/d3drm/tests/d3drm.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/dlls/d3drm/tests/d3drm.c b/dlls/d3drm/tests/d3drm.c
index f922d77..69ce459 100644
--- a/dlls/d3drm/tests/d3drm.c
+++ b/dlls/d3drm/tests/d3drm.c
@@ -2561,6 +2561,7 @@ static void test_frame_qi(void)
IDirect3DRMFrame3 *frame3;
IDirect3DRMObject *obj;
IUnknown *unknown;
+ DWORD ref1, ref2, ref3;
hr = Direct3DRMCreate(&d3drm1);
ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x)\n", hr);
@@ -2600,6 +2601,30 @@ static void test_frame_qi(void)
ok(SUCCEEDED(hr), "Could not get IDirect3DRMObject interface (hr = %#x).\n", hr);
ok(obj == (IDirect3DRMObject *)frame1, "got object pointer %p, expected %p", obj, frame1);
IDirect3DRMObject_Release(obj);
+
+ hr = IDirect3DRMFrame_QueryInterface(frame1, &IID_IDirect3DRMFrame2, (void **)&frame2);
+ ok(SUCCEEDED(hr), "Could not get IDirect3DRMFrame2 interface (hr = %#x).\n", hr);
+ hr = IDirect3DRMFrame_QueryInterface(frame1, &IID_IDirect3DRMFrame3, (void **)&frame3);
+ ok(SUCCEEDED(hr), "Could not get IDirect3DRMFrame3 interface (hr = %#x).\n", hr);
+
+ ref1 = get_refcount((IUnknown *)frame1);
+ ref2 = get_refcount((IUnknown *)frame2);
+ ref3 = get_refcount((IUnknown *)frame3);
+ ok(ref1 == ref2, "Expected ref1 == ref2, got ref1 = %u, ref2 = %u.\n", ref1, ref2);
+ ok(ref2 == ref3, "Expected ref2 == ref3, got ref2 = %u, ref3 = %u.\n", ref2, ref3);
+ ok(ref1 == ref3, "Expected ref1 == ref3, got ref1 = %u, ref3 = %u.\n", ref1, ref3);
+
+ IDirect3DRMFrame2_AddRef(frame2);
+ ref1 = get_refcount((IUnknown *)frame1);
+ ref2 = get_refcount((IUnknown *)frame2);
+ ref3 = get_refcount((IUnknown *)frame3);
+ ok(ref1 == ref2, "Expected ref1 == ref2, got ref1 = %u, ref2 = %u.\n", ref1, ref2);
+ ok(ref2 == ref3, "Expected ref2 == ref3, got ref2 = %u, ref3 = %u.\n", ref2, ref3);
+ ok(ref1 == ref3, "Expected ref1 == ref3, got ref1 = %u, ref3 = %u.\n", ref1, ref3);
+ IDirect3DRMFrame2_Release(frame2);
+
+ IDirect3DRMFrame3_Release(frame3);
+ IDirect3DRMFrame2_Release(frame2);
IDirect3DRMFrame_Release(frame1);
IDirect3DRM3_Release(d3drm3);
--
2.3.2 (Apple Git-55)
More information about the wine-patches
mailing list