mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 04:39:45 +00:00
d3d9/tests: Use proper helpers for iface calls.
This commit is contained in:
parent
242f9acdf6
commit
9bb70e2739
@ -107,7 +107,7 @@ static HRESULT reset_device(IDirect3DDevice9 *device, HWND device_window, BOOL w
|
||||
#define CHECK_RELEASE(obj,d,rc) \
|
||||
if (obj) { \
|
||||
int tmp1, rc_new = rc; \
|
||||
IUnknown_Release( obj ); \
|
||||
IUnknown_Release( (IUnknown*)obj ); \
|
||||
tmp1 = get_refcount( (IUnknown *)d ); \
|
||||
ok(tmp1 == rc_new, "Invalid refcount. Expected %d got %d\n", rc_new, tmp1); \
|
||||
}
|
||||
@ -154,7 +154,7 @@ static void check_mipmap_levels(IDirect3DDevice9 *device, UINT width, UINT heigh
|
||||
} else
|
||||
trace("CreateTexture failed: %08x\n", hr);
|
||||
|
||||
if (texture) IUnknown_Release( texture );
|
||||
if (texture) IDirect3DBaseTexture9_Release( texture );
|
||||
}
|
||||
|
||||
static void test_mipmap_levels(void)
|
||||
@ -196,10 +196,10 @@ static void test_mipmap_levels(void)
|
||||
cleanup:
|
||||
if (pDevice)
|
||||
{
|
||||
UINT refcount = IUnknown_Release( pDevice );
|
||||
UINT refcount = IDirect3DDevice9_Release( pDevice );
|
||||
ok(!refcount, "Device has %u references left.\n", refcount);
|
||||
}
|
||||
if (pD3d) IUnknown_Release( pD3d );
|
||||
if (pD3d) IDirect3D9_Release( pD3d );
|
||||
DestroyWindow( hwnd );
|
||||
}
|
||||
|
||||
@ -255,10 +255,10 @@ static void test_checkdevicemultisampletype(void)
|
||||
cleanup:
|
||||
if (pDevice)
|
||||
{
|
||||
UINT refcount = IUnknown_Release( pDevice );
|
||||
UINT refcount = IDirect3DDevice9_Release( pDevice );
|
||||
ok(!refcount, "Device has %u references left.\n", refcount);
|
||||
}
|
||||
if (pD3d) IUnknown_Release( pD3d );
|
||||
if (pD3d) IDirect3D9_Release( pD3d );
|
||||
DestroyWindow( hwnd );
|
||||
}
|
||||
|
||||
|
@ -281,13 +281,13 @@ static int switch_render_target(IDirect3DDevice9 *device, struct event_data *eve
|
||||
ok (hret == D3D_OK, "SetRenderTarget returned %#x.\n", hret);
|
||||
if (hret != D3D_OK) goto error;
|
||||
|
||||
IUnknown_Release(backbuffer);
|
||||
IDirect3DSurface9_Release(backbuffer);
|
||||
event_data->new_swap_chain = swapchain;
|
||||
return EVENT_OK;
|
||||
|
||||
error:
|
||||
if (backbuffer) IUnknown_Release(backbuffer);
|
||||
if (swapchain) IUnknown_Release(swapchain);
|
||||
if (backbuffer) IDirect3DSurface9_Release(backbuffer);
|
||||
if (swapchain) IDirect3DSwapChain9_Release(swapchain);
|
||||
return EVENT_ERROR;
|
||||
}
|
||||
|
||||
@ -299,12 +299,12 @@ static int revert_render_target(IDirect3DDevice9 *device, struct event_data *eve
|
||||
hret = IDirect3DDevice9_SetRenderTarget(device, 0, event_data->original_render_target);
|
||||
ok (hret == D3D_OK, "SetRenderTarget returned %#x.\n", hret);
|
||||
if (hret != D3D_OK) {
|
||||
IUnknown_Release(event_data->original_render_target);
|
||||
IDirect3DSurface9_Release(event_data->original_render_target);
|
||||
return EVENT_ERROR;
|
||||
}
|
||||
|
||||
IUnknown_Release(event_data->original_render_target);
|
||||
IUnknown_Release(event_data->new_swap_chain);
|
||||
IDirect3DSurface9_Release(event_data->original_render_target);
|
||||
IDirect3DSwapChain9_Release(event_data->new_swap_chain);
|
||||
|
||||
return EVENT_OK;
|
||||
}
|
||||
@ -361,7 +361,7 @@ static int end_stateblock(IDirect3DDevice9 *device, struct event_data *event_dat
|
||||
|
||||
static int release_stateblock(IDirect3DDevice9 *device, struct event_data *event_data)
|
||||
{
|
||||
IUnknown_Release(event_data->stateblock);
|
||||
IDirect3DStateBlock9_Release(event_data->stateblock);
|
||||
return EVENT_OK;
|
||||
}
|
||||
|
||||
@ -372,11 +372,11 @@ static int apply_stateblock(IDirect3DDevice9 *device, struct event_data *event_d
|
||||
hret = IDirect3DStateBlock9_Apply(event_data->stateblock);
|
||||
ok(hret == D3D_OK, "Apply returned %#x.\n", hret);
|
||||
if (hret != D3D_OK) {
|
||||
IUnknown_Release(event_data->stateblock);
|
||||
IDirect3DStateBlock9_Release(event_data->stateblock);
|
||||
return EVENT_ERROR;
|
||||
}
|
||||
|
||||
IUnknown_Release(event_data->stateblock);
|
||||
IDirect3DStateBlock9_Release(event_data->stateblock);
|
||||
|
||||
return EVENT_OK;
|
||||
}
|
||||
|
@ -181,7 +181,7 @@ static void test_surface_alignment(IDirect3DDevice9 *device_ptr)
|
||||
ok(rc.Pitch == pitch, "Wrong pitch for DXT%d lvl[%d (%dx%d)]: expected %d got %d\n",
|
||||
i + 1, j, descr.Width, descr.Height, pitch, rc.Pitch);
|
||||
}
|
||||
IUnknown_Release( pTexture );
|
||||
IDirect3DTexture9_Release( pTexture );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -267,11 +267,11 @@ static HRESULT test_fvf_to_decl(IDirect3DDevice9 *device, IDirect3DVertexDeclara
|
||||
else if (compare_elements(result_decl, expected_elements) != S_OK)
|
||||
goto fail;
|
||||
|
||||
if (result_decl) IUnknown_Release( result_decl );
|
||||
if (result_decl) IDirect3DVertexDeclaration9_Release( result_decl );
|
||||
return S_OK;
|
||||
|
||||
fail:
|
||||
if (result_decl) IUnknown_Release( result_decl );
|
||||
if (result_decl) IDirect3DVertexDeclaration9_Release( result_decl );
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@ -308,12 +308,12 @@ static HRESULT test_decl_to_fvf(IDirect3DDevice9* device, DWORD default_fvf,
|
||||
if (test_fvf != result_fvf) goto fail;
|
||||
|
||||
IDirect3DDevice9_SetVertexDeclaration ( device, NULL );
|
||||
if (vdecl) IUnknown_Release( vdecl );
|
||||
if (vdecl) IDirect3DVertexDeclaration9_Release( vdecl );
|
||||
return S_OK;
|
||||
|
||||
fail:
|
||||
IDirect3DDevice9_SetVertexDeclaration ( device, NULL );
|
||||
if (vdecl) IUnknown_Release( vdecl );
|
||||
if (vdecl) IDirect3DVertexDeclaration9_Release( vdecl );
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@ -644,7 +644,7 @@ static void test_fvf_decl_conversion(IDirect3DDevice9 *pDevice)
|
||||
|
||||
cleanup:
|
||||
IDirect3DDevice9_SetVertexDeclaration ( pDevice, NULL );
|
||||
if ( default_decl ) IUnknown_Release (default_decl);
|
||||
if ( default_decl ) IDirect3DVertexDeclaration9_Release (default_decl);
|
||||
}
|
||||
|
||||
/* Check whether a declaration converted from FVF is shared.
|
||||
|
Loading…
Reference in New Issue
Block a user