Commit ebb31dbb authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

ddraw/tests: Skip tests if we can't create a primary surface.

parent 21bc015d
......@@ -2748,6 +2748,22 @@ static void SurfaceCapsTest(void)
}
}
static BOOL can_create_primary_surface(void)
{
DDSURFACEDESC ddsd;
IDirectDrawSurface *surface;
HRESULT hr;
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_CAPS;
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = IDirectDraw_CreateSurface(lpDD, &ddsd, &surface, NULL);
if(FAILED(hr)) return FALSE;
IDirectDrawSurface_Release(surface);
return TRUE;
}
START_TEST(dsurface)
{
HRESULT ret;
......@@ -2765,6 +2781,12 @@ START_TEST(dsurface)
}
IDirectDraw_Release(dd4);
if(!can_create_primary_surface())
{
skip("Unable to create primary surface\n");
return;
}
MipMapCreationTest();
SrcColorKey32BlitTest();
QueryInterface();
......
......@@ -89,8 +89,7 @@ static BOOL createObjects(void)
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE;
ddsd.dwBackBufferCount = 1;
hr = IDirectDraw7_CreateSurface(DirectDraw, &ddsd, &Surface, NULL);
ok(hr==DD_OK, "CreateSurface returned: %08x\n", hr);
if(!Surface) goto err;
if(FAILED(hr)) goto err;
hr = IDirect3D7_CreateDevice(Direct3D, &IID_IDirect3DTnLHalDevice, Surface, &Direct3DDevice);
if(FAILED(hr))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment