d3d9: Add a test for GetTexture with no texture set.
This commit is contained in:
parent
620a423b22
commit
40c06ea296
@ -990,11 +990,13 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetTexture(LPDIRECT3DDEVICE9EX ifac
|
|||||||
|
|
||||||
EnterCriticalSection(&d3d9_cs);
|
EnterCriticalSection(&d3d9_cs);
|
||||||
rc = IWineD3DDevice_GetTexture(This->WineD3DDevice, Stage, &retTexture);
|
rc = IWineD3DDevice_GetTexture(This->WineD3DDevice, Stage, &retTexture);
|
||||||
if (rc == D3D_OK && NULL != retTexture) {
|
if (SUCCEEDED(rc) && NULL != retTexture) {
|
||||||
IWineD3DBaseTexture_GetParent(retTexture, (IUnknown **)ppTexture);
|
IWineD3DBaseTexture_GetParent(retTexture, (IUnknown **)ppTexture);
|
||||||
IWineD3DBaseTexture_Release(retTexture);
|
IWineD3DBaseTexture_Release(retTexture);
|
||||||
}else{
|
} else {
|
||||||
FIXME("Call to get texture (%d) failed (%p)\n", Stage, retTexture);
|
if(FAILED(rc)) {
|
||||||
|
WARN("Call to get texture (%d) failed (%p)\n", Stage, retTexture);
|
||||||
|
}
|
||||||
*ppTexture = NULL;
|
*ppTexture = NULL;
|
||||||
}
|
}
|
||||||
LeaveCriticalSection(&d3d9_cs);
|
LeaveCriticalSection(&d3d9_cs);
|
||||||
|
@ -323,6 +323,17 @@ static void test_filter(IDirect3DDevice9 *device) {
|
|||||||
IDirect3D9_Release(d3d9);
|
IDirect3D9_Release(d3d9);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void test_gettexture(IDirect3DDevice9 *device) {
|
||||||
|
HRESULT hr;
|
||||||
|
IDirect3DBaseTexture9 *texture = (IDirect3DBaseTexture9 *) 0xdeadbeef;
|
||||||
|
|
||||||
|
hr = IDirect3DDevice9_SetTexture(device, 0, NULL);
|
||||||
|
ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture failed, hr = 0x%08x\n", hr);
|
||||||
|
hr = IDirect3DDevice9_GetTexture(device, 0, &texture);
|
||||||
|
ok(hr == D3D_OK, "IDirect3DDevice9_GetTexture failed, hr = 0x%08x\n", hr);
|
||||||
|
ok(texture == NULL, "Texture returned is %p, expected NULL\n", texture);
|
||||||
|
}
|
||||||
|
|
||||||
START_TEST(texture)
|
START_TEST(texture)
|
||||||
{
|
{
|
||||||
D3DCAPS9 caps;
|
D3DCAPS9 caps;
|
||||||
@ -345,4 +356,5 @@ START_TEST(texture)
|
|||||||
test_cube_textures(device_ptr, caps.TextureCaps);
|
test_cube_textures(device_ptr, caps.TextureCaps);
|
||||||
test_mipmap_gen(device_ptr);
|
test_mipmap_gen(device_ptr);
|
||||||
test_filter(device_ptr);
|
test_filter(device_ptr);
|
||||||
|
test_gettexture(device_ptr);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user