David Adam : d3d9: Add tests for IDirect3D9Device_Reset.
Alexandre Julliard
julliard at winehq.org
Wed Apr 22 10:18:47 CDT 2009
Module: wine
Branch: master
Commit: d993f85167fdbde73ddf6c44a898d2161e9bc707
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d993f85167fdbde73ddf6c44a898d2161e9bc707
Author: David Adam <david.adam.cnrs at gmail.com>
Date: Tue Apr 21 15:25:31 2009 +0200
d3d9: Add tests for IDirect3D9Device_Reset.
---
dlls/d3d9/tests/device.c | 39 +++++++++++++++++++++++++++++++++++++++
1 files changed, 39 insertions(+), 0 deletions(-)
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c
index f254719..fe4318e 100644
--- a/dlls/d3d9/tests/device.c
+++ b/dlls/d3d9/tests/device.c
@@ -1049,6 +1049,45 @@ static void test_reset(void)
hr = IDirect3DDevice9_TestCooperativeLevel(pDevice);
ok(hr == D3DERR_DEVICENOTRESET, "IDirect3DDevice9_TestCooperativeLevel after a failed reset returned %#x\n", hr);
+ pDevice = NULL;
+ IDirect3D9_GetAdapterDisplayMode( pD3d, D3DADAPTER_DEFAULT, &d3ddm );
+
+ ZeroMemory( &d3dpp, sizeof(d3dpp) );
+ d3dpp.Windowed = TRUE;
+ d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
+ d3dpp.BackBufferFormat = d3ddm.Format;
+ d3dpp.EnableAutoDepthStencil = FALSE;
+ d3dpp.AutoDepthStencilFormat = D3DFMT_D24S8;
+
+ hr = IDirect3D9_CreateDevice( pD3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd,
+ D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &pDevice );
+
+ if(FAILED(hr))
+ {
+ skip("could not create device, IDirect3D9_CreateDevice returned %#x\n", hr);
+ goto cleanup;
+ }
+
+ hr = IDirect3DDevice9_TestCooperativeLevel(pDevice);
+ ok(hr == D3D_OK, "IDirect3DDevice9_TestCooperativeLevel after creation returned %#x\n", hr);
+
+ d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
+ d3dpp.Windowed = TRUE;
+ d3dpp.BackBufferWidth = 400;
+ d3dpp.BackBufferHeight = 300;
+ d3dpp.EnableAutoDepthStencil = TRUE;
+ d3dpp.AutoDepthStencilFormat = D3DFMT_D24S8;
+
+ hr = IDirect3DDevice9_Reset(pDevice, &d3dpp);
+ todo_wine ok(hr == D3D_OK, "IDirect3DDevice9_Reset failed with 0x%08x\n", hr);
+
+ if (FAILED(hr)) goto cleanup;
+
+ hr = IDirect3DDevice9_GetDepthStencilSurface(pDevice, &surface);
+ todo_wine ok(hr == D3D_OK, "GetDepthStencilSurface failed with 0x%08x\n", hr);
+ todo_wine ok(surface != NULL, "Depth stencil should not be NULL\n");
+ if (surface) IDirect3DSurface9_Release(surface);
+
cleanup:
HeapFree(GetProcessHeap(), 0, modes);
if(pD3d) IDirect3D9_Release(pD3d);
More information about the wine-cvs
mailing list