Commit 27d8c4d2 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

d3d10core/tests: Add tests showing that views do not keep resource reference.

parent 57fac9b0
......@@ -1962,8 +1962,11 @@ static void test_create_depthstencil_view(void)
get_dsv_desc(current_desc, &tests[i].dsv_desc);
}
expected_refcount = get_refcount((IUnknown *)texture);
hr = ID3D10Device_CreateDepthStencilView(device, (ID3D10Resource *)texture, current_desc, &dsview);
ok(SUCCEEDED(hr), "Test %u: Failed to create depth stencil view, hr %#x.\n", i, hr);
refcount = get_refcount((IUnknown *)texture);
ok(refcount == expected_refcount, "Got refcount %u, expected %u.\n", refcount, expected_refcount);
hr = ID3D10DepthStencilView_QueryInterface(dsview, &IID_ID3D11DepthStencilView, (void **)&iface);
ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */,
......@@ -2322,8 +2325,11 @@ static void test_create_rendertarget_view(void)
get_rtv_desc(current_desc, &tests[i].rtv_desc);
}
expected_refcount = get_refcount((IUnknown *)texture);
hr = ID3D10Device_CreateRenderTargetView(device, texture, current_desc, &rtview);
ok(SUCCEEDED(hr), "Test %u: Failed to create render target view, hr %#x.\n", i, hr);
refcount = get_refcount((IUnknown *)texture);
ok(refcount == expected_refcount, "Got refcount %u, expected %u.\n", refcount, expected_refcount);
hr = ID3D10RenderTargetView_QueryInterface(rtview, &IID_ID3D11RenderTargetView, (void **)&iface);
ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */,
......@@ -2737,8 +2743,11 @@ static void test_create_shader_resource_view(void)
get_srv_desc(current_desc, &tests[i].srv_desc);
}
expected_refcount = get_refcount((IUnknown *)texture);
hr = ID3D10Device_CreateShaderResourceView(device, texture, current_desc, &srview);
ok(SUCCEEDED(hr), "Test %u: Failed to create a shader resource view, hr %#x.\n", i, hr);
refcount = get_refcount((IUnknown *)texture);
ok(refcount == expected_refcount, "Got refcount %u, expected %u.\n", refcount, expected_refcount);
hr = ID3D10ShaderResourceView_QueryInterface(srview, &IID_ID3D10ShaderResourceView1, (void **)&iface);
ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */,
......@@ -7815,6 +7824,7 @@ static void test_swapchain_views(void)
ID3D10ShaderResourceView *srv;
ID3D10RenderTargetView *rtv;
ID3D10Device *device;
ULONG refcount;
HRESULT hr;
if (!init_test_context(&test_context))
......@@ -7822,6 +7832,9 @@ static void test_swapchain_views(void)
device = test_context.device;
refcount = get_refcount((IUnknown *)test_context.backbuffer);
ok(refcount == 1, "Got refcount %u.\n", refcount);
rtv_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM_SRGB;
rtv_desc.ViewDimension = D3D10_RTV_DIMENSION_TEXTURE2D;
U(rtv_desc).Texture2D.MipSlice = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment