[PATCH 3/6] d3d11/tests: Test values of unused fields in D3D11_DEPTH_STENCIL_DESC.

Józef Kucia jkucia at codeweavers.com
Wed Mar 16 04:02:37 CDT 2016


Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 dlls/d3d11/tests/d3d11.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index 636bec9..1deec8b 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -2736,6 +2736,51 @@ static void test_create_depthstencil_state(void)
     refcount = ID3D11DepthStencilState_Release(ds_state1);
     ok(!refcount, "Got unexpected refcount %u.\n", refcount);
 
+    ds_desc.DepthEnable = FALSE;
+    ds_desc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ZERO;
+    ds_desc.DepthFunc = D3D11_COMPARISON_NEVER;
+    ds_desc.StencilEnable = FALSE;
+    ds_desc.StencilReadMask = 0;
+    ds_desc.StencilWriteMask = 0;
+    ds_desc.FrontFace.StencilFailOp = D3D11_STENCIL_OP_ZERO;
+    ds_desc.FrontFace.StencilDepthFailOp = D3D11_STENCIL_OP_ZERO;
+    ds_desc.FrontFace.StencilPassOp = D3D11_STENCIL_OP_ZERO;
+    ds_desc.FrontFace.StencilFunc = D3D11_COMPARISON_NEVER;
+    ds_desc.BackFace = ds_desc.FrontFace;
+
+    hr = ID3D11Device_CreateDepthStencilState(device, &ds_desc, &ds_state1);
+    ok(SUCCEEDED(hr), "Failed to create depthstencil state, hr %#x.\n", hr);
+
+    memset(&ds_desc, 0, sizeof(ds_desc));
+    ID3D11DepthStencilState_GetDesc(ds_state1, &ds_desc);
+    ok(!ds_desc.DepthEnable, "Got unexpected depth enable %#x.\n", ds_desc.DepthEnable);
+    ok(ds_desc.DepthWriteMask == D3D11_DEPTH_WRITE_MASK_ALL,
+            "Got unexpected depth write mask %#x.\n", ds_desc.DepthWriteMask);
+    ok(ds_desc.DepthFunc == D3D11_COMPARISON_LESS, "Got unexpected depth func %#x.\n", ds_desc.DepthFunc);
+    ok(!ds_desc.StencilEnable, "Got unexpected stencil enable %#x.\n", ds_desc.StencilEnable);
+    ok(ds_desc.StencilReadMask == D3D11_DEFAULT_STENCIL_READ_MASK,
+            "Got unexpected stencil read mask %#x.\n", ds_desc.StencilReadMask);
+    ok(ds_desc.StencilWriteMask == D3D11_DEFAULT_STENCIL_WRITE_MASK,
+            "Got unexpected stencil write mask %#x.\n", ds_desc.StencilWriteMask);
+    ok(ds_desc.FrontFace.StencilDepthFailOp == D3D11_STENCIL_OP_KEEP,
+            "Got unexpected front face stencil depth fail op %#x.\n", ds_desc.FrontFace.StencilDepthFailOp);
+    ok(ds_desc.FrontFace.StencilPassOp == D3D11_STENCIL_OP_KEEP,
+            "Got unexpected front face stencil pass op %#x.\n", ds_desc.FrontFace.StencilPassOp);
+    ok(ds_desc.FrontFace.StencilFailOp == D3D11_STENCIL_OP_KEEP,
+            "Got unexpected front face stencil fail op %#x.\n", ds_desc.FrontFace.StencilFailOp);
+    ok(ds_desc.FrontFace.StencilFunc == D3D11_COMPARISON_ALWAYS,
+            "Got unexpected front face stencil func %#x.\n", ds_desc.FrontFace.StencilFunc);
+    ok(ds_desc.BackFace.StencilDepthFailOp == D3D11_STENCIL_OP_KEEP,
+            "Got unexpected back face stencil depth fail op %#x.\n", ds_desc.BackFace.StencilDepthFailOp);
+    ok(ds_desc.BackFace.StencilPassOp == D3D11_STENCIL_OP_KEEP,
+            "Got unexpected back face stencil pass op %#x.\n", ds_desc.BackFace.StencilPassOp);
+    ok(ds_desc.BackFace.StencilFailOp == D3D11_STENCIL_OP_KEEP,
+            "Got unexpected back face stencil fail op %#x.\n", ds_desc.BackFace.StencilFailOp);
+    ok(ds_desc.BackFace.StencilFunc == D3D11_COMPARISON_ALWAYS,
+            "Got unexpected back face stencil func %#x.\n", ds_desc.BackFace.StencilFunc);
+
+    ID3D11DepthStencilState_Release(ds_state1);
+
     refcount = ID3D11Device_Release(device);
     ok(!refcount, "Device has %u references left.\n", refcount);
 }
-- 
2.4.10




More information about the wine-patches mailing list