[prev in list] [next in list] [prev in thread] [next in thread]
List: wine-devel
Subject: Re: [PATCH 5/5] d3d11/tests: Add test for 2D texture interfaces.
From: Henri Verbeet <hverbeet () gmail ! com>
Date: 2015-08-28 11:49:21
Message-ID: CAOsNvwzW13u0Vbgg6DXxUy2c7FFKvHdL-zuGtScg72m78aYGDQ () mail ! gmail ! com
[Download RAW message or body]
On 28 August 2015 at 00:39, Józef Kucia <jkucia@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.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic