=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: d3d11/tests: Add test for render target device mismatch.

Alexandre Julliard julliard at winehq.org
Tue Jan 3 15:31:04 CST 2017


Module: wine
Branch: master
Commit: 9047fdff8596ebfdc7350c9cdf20552aa6d48454
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9047fdff8596ebfdc7350c9cdf20552aa6d48454

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Tue Jan  3 13:46:28 2017 +0100

d3d11/tests: Add test for render target device mismatch.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d3d11/tests/d3d11.c | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index 1957ad3..ac4393d 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -12664,6 +12664,40 @@ static void test_sm5_bufinfo_instruction(void)
     release_test_context(&test_context);
 }
 
+static void test_render_target_device_mismatch(void)
+{
+    struct d3d11_test_context test_context;
+    struct device_desc device_desc = {0};
+    ID3D11DeviceContext *context;
+    ID3D11RenderTargetView *rtv;
+    ID3D11Device *device;
+    ULONG refcount;
+
+    if (!init_test_context(&test_context, NULL))
+        return;
+
+    device = create_device(&device_desc);
+    ok(!!device, "Failed to create device.\n");
+
+    ID3D11Device_GetImmediateContext(device, &context);
+
+    rtv = (ID3D11RenderTargetView *)0xdeadbeef;
+    ID3D11DeviceContext_OMGetRenderTargets(context, 1, &rtv, NULL);
+    ok(!rtv, "Got unexpected render target view %p.\n", rtv);
+    ID3D11DeviceContext_OMSetRenderTargets(context, 1, &test_context.backbuffer_rtv, NULL);
+    ID3D11DeviceContext_OMGetRenderTargets(context, 1, &rtv, NULL);
+    ok(rtv == test_context.backbuffer_rtv, "Got unexpected render target view %p.\n", rtv);
+    ID3D11RenderTargetView_Release(rtv);
+
+    rtv = NULL;
+    ID3D11DeviceContext_OMSetRenderTargets(context, 1, &rtv, NULL);
+
+    ID3D11DeviceContext_Release(context);
+    refcount = ID3D11Device_Release(device);
+    ok(!refcount, "Device has %u references left.\n", refcount);
+    release_test_context(&test_context);
+}
+
 START_TEST(d3d11)
 {
     test_create_device();
@@ -12732,4 +12766,5 @@ START_TEST(d3d11)
     test_sm4_ret_instruction();
     test_primitive_restart();
     test_sm5_bufinfo_instruction();
+    test_render_target_device_mismatch();
 }




More information about the wine-cvs mailing list