Re: [PATCH 5/5] d3d11/tests: Add test for 2D texture interfaces.
On 28 August 2015 at 00:39, Józef Kucia <jkucia(a)codeweavers.com> wrote:
+ hr = ID3D11Texture2D_QueryInterface(texture, &IID_IDXGISurface, (void **)&surface); + ok(hr == E_NOINTERFACE, "Texture should not implement IDXGISurface.\n"); + if (SUCCEEDED(hr)) IDXGISurface_Release(surface); You don't need the Release(), if the QueryInterface() would succeed the test would fail.
+ if (FAILED(hr)) + { + skip("2D textures do not implement ID3D10Texture2D, skipping tests.\n"); This should probably be a win_skip(). You're leaking the device here.
+ hr = ID3D11Device_CreateTexture2D(device, &desc, NULL, &texture); + ok(SUCCEEDED(hr), "%u: Failed to create a 2d texture, hr %#x.\n", i, hr); + if (FAILED(hr)) continue; ... + hr = ID3D11Texture2D_QueryInterface(texture, &IID_IDXGISurface, (void **)&surface); + ok(SUCCEEDED(hr), "%u: Texture should implement IDXGISurface.\n", i); + if (SUCCEEDED(hr)) IDXGISurface_Release(surface); ... + hr = ID3D11Texture2D_QueryInterface(texture, &IID_ID3D10Texture2D, (void **)&d3d10_texture); + ok(SUCCEEDED(hr), "%u: Texture should implement ID3D10Texture2D.\n", i); + if (SUCCEEDED(hr)) + { Similar to above, you don't need to account for conditions where the test would fail.
participants (1)
-
Henri Verbeet