From 3932b2f2a75cebae7ab663d4c04f685307f527eb Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Sat, 22 Sep 2018 02:56:05 +0330 Subject: [PATCH] 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 Signed-off-by: Alexandre Julliard --- dlls/d3d8/tests/visual.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c index 24481bd0533..e8e6bf870e2 100644 --- a/dlls/d3d8/tests/visual.c +++ b/dlls/d3d8/tests/visual.c @@ -8154,9 +8154,8 @@ static void test_flip(void) present_parameters.Windowed = TRUE; present_parameters.BackBufferCount = 3; present_parameters.Flags = D3DPRESENTFLAG_LOCKABLE_BACKBUFFER; - hr = IDirect3D8_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, - window, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device); - if (!device) + if (FAILED(hr = IDirect3D8_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + window, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device))) { skip("Failed to create a D3D device, skipping tests.\n"); IDirect3D8_Release(d3d);