Module: wine Branch: master Commit: 458902b5b21a4c8d2ae6a2d0ce4a17af83265038 URL: http://source.winehq.org/git/wine.git/?a=commit;h=458902b5b21a4c8d2ae6a2d0ce...
Author: David Adam david.adam.cnrs@gmail.com Date: Tue Apr 21 15:22:29 2009 +0200
d3d8: Add tests for IDirect3D8Device_Reset.
---
dlls/d3d8/tests/device.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 files changed, 39 insertions(+), 0 deletions(-)
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index aa2b627..6f410fd 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -1358,6 +1358,45 @@ static void test_depth_stencil_reset(void) ok(hr == D3DERR_NOTFOUND, "GetDepthStencilSurface returned 0x%08x, expected D3DERR_NOTFOUND\n", hr); ok(surface == NULL, "Depth stencil should be NULL\n");
+ device = NULL; + IDirect3D8_GetAdapterDisplayMode( d3d8, D3DADAPTER_DEFAULT, &display_mode ); + + ZeroMemory( &present_parameters, sizeof(present_parameters) ); + present_parameters.Windowed = TRUE; + present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD; + present_parameters.BackBufferFormat = display_mode.Format; + present_parameters.EnableAutoDepthStencil = FALSE; + present_parameters.AutoDepthStencilFormat = D3DFMT_D24S8; + + hr = IDirect3D8_CreateDevice( d3d8, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, + D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device ); + + if(FAILED(hr)) + { + skip("could not create device, IDirect3D8_CreateDevice returned %#x\n", hr); + goto cleanup; + } + + hr = IDirect3DDevice8_TestCooperativeLevel(device); + ok(hr == D3D_OK, "IDirect3DDevice8_TestCooperativeLevel after creation returned %#x\n", hr); + + present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD; + present_parameters.Windowed = TRUE; + present_parameters.BackBufferWidth = 400; + present_parameters.BackBufferHeight = 300; + present_parameters.EnableAutoDepthStencil = TRUE; + present_parameters.AutoDepthStencilFormat = D3DFMT_D24S8; + + hr = IDirect3DDevice8_Reset(device, &present_parameters); + todo_wine ok(hr == D3D_OK, "IDirect3DDevice8_Reset failed with 0x%08x\n", hr); + + if (FAILED(hr)) goto cleanup; + + hr = IDirect3DDevice8_GetDepthStencilSurface(device, &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) IDirect3DSurface8_Release(surface); + cleanup: if(d3d8) IDirect3D8_Release(d3d8); if(device) IDirect3D8_Release(device);