d3d8/tests: Properly check whether creating a device succeeded in test_flip().

Perhaps CreateDevice() should clear the pointer on failure, but that's not
documented behaviour, and Wine currently doesn't.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2018-09-22 02:56:05 +03:30 committed by Alexandre Julliard
parent 86805c3d4b
commit 3932b2f2a7
1 changed files with 2 additions and 3 deletions

View File

@ -8154,9 +8154,8 @@ static void test_flip(void)
present_parameters.Windowed = TRUE; present_parameters.Windowed = TRUE;
present_parameters.BackBufferCount = 3; present_parameters.BackBufferCount = 3;
present_parameters.Flags = D3DPRESENTFLAG_LOCKABLE_BACKBUFFER; present_parameters.Flags = D3DPRESENTFLAG_LOCKABLE_BACKBUFFER;
hr = IDirect3D8_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, if (FAILED(hr = IDirect3D8_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
window, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device); window, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device)))
if (!device)
{ {
skip("Failed to create a D3D device, skipping tests.\n"); skip("Failed to create a D3D device, skipping tests.\n");
IDirect3D8_Release(d3d); IDirect3D8_Release(d3d);