[PATCH 3/3] d3drm/tests: Add tests for IDirect3DRMTexture{2-3}_InitFromImage. (v2)

Aaryaman Vasishta jem456.vasishta at gmail.com
Sun Apr 24 00:46:29 CDT 2016


v2: Add tests to verify image returned for InitFromImage.

Signed-off-by: Aaryaman Vasishta <jem456.vasishta at gmail.com>
---
 dlls/d3drm/tests/d3drm.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/dlls/d3drm/tests/d3drm.c b/dlls/d3drm/tests/d3drm.c
index 998fc7b..01c1f15 100644
--- a/dlls/d3drm/tests/d3drm.c
+++ b/dlls/d3drm/tests/d3drm.c
@@ -1819,6 +1819,37 @@ static void test_Texture(void)
     ref4 = get_refcount((IUnknown *)d3drm3);
     ok(ref4 == ref1, "expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n", ref1, ref4);
 
+    /* InitFromImage tests */
+    d3drm_img = NULL;
+    hr = IDirect3DRM2_CreateObject(d3drm2, &CLSID_CDirect3DRMTexture, NULL, &IID_IDirect3DRMTexture2, (void **)&texture2);
+    ok(SUCCEEDED(hr), "Cannot get IDirect3DRMTexture2 interface (hr = %x).\n", hr);
+    ref2 = get_refcount((IUnknown *)texture2);
+    hr = IDirect3DRMTexture2_InitFromImage(texture2, NULL);
+    todo_wine ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %x.\n", hr);
+    ref3 = get_refcount((IUnknown *)texture2);
+    ok(ref3 == ref2, "expected ref3 == ref2, got ref2 = %u , ref3 = %u.\n", ref2, ref3);
+    hr = IDirect3DRMTexture2_InitFromImage(texture2, &initimg);
+    todo_wine ok(SUCCEEDED(hr), "Cannot initialize IDirect3DRMTexture2 from image (hr = %x).\n", hr);
+    d3drm_img = IDirect3DRMTexture2_GetImage(texture2);
+    todo_wine ok(!!d3drm_img, "Failed to get image.\n");
+    todo_wine ok(d3drm_img == &initimg, "Expected image returned == %p, got %p.\n", &initimg, d3drm_img);
+    IDirect3DRMTexture2_Release(texture2);
+
+    d3drm_img = NULL;
+    hr = IDirect3DRM3_CreateObject(d3drm3, &CLSID_CDirect3DRMTexture, NULL, &IID_IDirect3DRMTexture3, (void **)&texture3);
+    ok(SUCCEEDED(hr), "Cannot get IDirect3DRMTexture3 interface (hr = %x).\n", hr);
+    ref2 = get_refcount((IUnknown *)texture3);
+    hr = IDirect3DRMTexture3_InitFromImage(texture3, NULL);
+    todo_wine ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %x.\n", hr);
+    ref3 = get_refcount((IUnknown *)texture3);
+    ok(ref3 == ref2, "expected ref3 == ref2, got ref2 = %u , ref3 = %u.\n", ref2, ref3);
+    hr = IDirect3DRMTexture3_InitFromImage(texture3, &initimg);
+    todo_wine ok(SUCCEEDED(hr), "Cannot initialize IDirect3DRMTexture3 from image (hr = %x).\n", hr);
+    d3drm_img = IDirect3DRMTexture3_GetImage(texture3);
+    todo_wine ok(!!d3drm_img, "Failed to get image.\n");
+    todo_wine ok(d3drm_img == &initimg, "Expected image returned == %p, got %p.\n", &initimg, d3drm_img);
+    IDirect3DRMTexture3_Release(texture3);
+
     IDirect3DRM3_Release(d3drm3);
     IDirect3DRM2_Release(d3drm2);
     IDirect3DRM_Release(d3drm1);
-- 
2.3.2 (Apple Git-55)




More information about the wine-patches mailing list