Commit a8ae03f2 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

ddraw: Make tests pass when OpenGL libraries aren't present.

parent c339d8e2
......@@ -96,6 +96,8 @@ DDRAW_Create(GUID *guid,
TRACE("(%s,%p,%p)\n", debugstr_guid(guid), DD, UnkOuter);
*DD = NULL;
/* We don't care about this guids. Well, there's no special guid anyway
* OK, we could
*/
......@@ -164,7 +166,7 @@ DDRAW_Create(GUID *guid,
if (!hWineD3D)
{
ERR("Couldn't load WineD3D - OpenGL libs not present?\n");
hr = E_NOTIMPL;
hr = DDERR_NODIRECTDRAWSUPPORT;
goto err_out;
}
......
......@@ -59,12 +59,17 @@ static void createwindow(void)
}
static void createdirectdraw(void)
static BOOL createdirectdraw(void)
{
HRESULT rc;
rc = DirectDrawCreate(NULL, &lpDD, NULL);
ok(rc==DD_OK,"DirectDrawCreate returned: %lx\n",rc);
ok(rc==DD_OK || rc==DDERR_NODIRECTDRAWSUPPORT, "DirectDrawCreateEx returned: %lx\n", rc);
if (!lpDD) {
trace("DirectDrawCreateEx() failed with an error %lx\n", rc);
return FALSE;
}
return TRUE;
}
......@@ -319,7 +324,8 @@ static void testcooperativelevels_exclusive(void)
START_TEST(ddrawmodes)
{
createwindow();
createdirectdraw();
if (!createdirectdraw())
return;
enumdisplaymodes();
testdisplaymodes();
flushdisplaymodes();
......
......@@ -26,15 +26,21 @@
static LPDIRECTDRAW lpDD = NULL;
static void CreateDirectDraw(void)
static BOOL CreateDirectDraw(void)
{
HRESULT rc;
rc = DirectDrawCreate(NULL, &lpDD, NULL);
ok(rc==DD_OK,"DirectDrawCreate returned: %lx\n",rc);
ok(rc==DD_OK || rc==DDERR_NODIRECTDRAWSUPPORT, "DirectDrawCreateEx returned: %lx\n", rc);
if (!lpDD) {
trace("DirectDrawCreateEx() failed with an error %lx\n", rc);
return FALSE;
}
rc = IDirectDraw_SetCooperativeLevel(lpDD, NULL, DDSCL_NORMAL);
ok(rc==DD_OK,"SetCooperativeLevel returned: %lx\n",rc);
return TRUE;
}
......@@ -250,7 +256,8 @@ static void QueryInterface(void)
START_TEST(dsurface)
{
CreateDirectDraw();
if (!CreateDirectDraw())
return;
MipMapCreationTest();
SrcColorKey32BlitTest();
QueryInterface();
......
......@@ -304,7 +304,7 @@ static void test_d3d_ifaces(void)
long ref;
hr = DirectDrawCreate(NULL, &DDraw1, NULL);
ok(hr == DD_OK, "DirectDrawCreate returned %08lx\n", hr);
ok(hr == DD_OK || hr==DDERR_NODIRECTDRAWSUPPORT, "DirectDrawCreateEx returned: %lx\n", hr);
if(!DDraw1)
{
trace("DirectDrawCreate failed with %08lx\n", 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