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

This commit is contained in:
Mike McCormack 2006-08-30 12:56:32 +09:00 committed by Alexandre Julliard
parent c339d8e272
commit a8ae03f2d8
4 changed files with 23 additions and 8 deletions

View File

@ -96,6 +96,8 @@ DDRAW_Create(GUID *guid,
TRACE("(%s,%p,%p)\n", debugstr_guid(guid), DD, UnkOuter); 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 /* We don't care about this guids. Well, there's no special guid anyway
* OK, we could * OK, we could
*/ */
@ -164,7 +166,7 @@ DDRAW_Create(GUID *guid,
if (!hWineD3D) if (!hWineD3D)
{ {
ERR("Couldn't load WineD3D - OpenGL libs not present?\n"); ERR("Couldn't load WineD3D - OpenGL libs not present?\n");
hr = E_NOTIMPL; hr = DDERR_NODIRECTDRAWSUPPORT;
goto err_out; goto err_out;
} }

View File

@ -59,12 +59,17 @@ static void createwindow(void)
} }
static void createdirectdraw(void) static BOOL createdirectdraw(void)
{ {
HRESULT rc; HRESULT rc;
rc = DirectDrawCreate(NULL, &lpDD, NULL); 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) START_TEST(ddrawmodes)
{ {
createwindow(); createwindow();
createdirectdraw(); if (!createdirectdraw())
return;
enumdisplaymodes(); enumdisplaymodes();
testdisplaymodes(); testdisplaymodes();
flushdisplaymodes(); flushdisplaymodes();

View File

@ -26,15 +26,21 @@
static LPDIRECTDRAW lpDD = NULL; static LPDIRECTDRAW lpDD = NULL;
static void CreateDirectDraw(void) static BOOL CreateDirectDraw(void)
{ {
HRESULT rc; HRESULT rc;
rc = DirectDrawCreate(NULL, &lpDD, NULL); 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); rc = IDirectDraw_SetCooperativeLevel(lpDD, NULL, DDSCL_NORMAL);
ok(rc==DD_OK,"SetCooperativeLevel returned: %lx\n",rc); ok(rc==DD_OK,"SetCooperativeLevel returned: %lx\n",rc);
return TRUE;
} }
@ -250,7 +256,8 @@ static void QueryInterface(void)
START_TEST(dsurface) START_TEST(dsurface)
{ {
CreateDirectDraw(); if (!CreateDirectDraw())
return;
MipMapCreationTest(); MipMapCreationTest();
SrcColorKey32BlitTest(); SrcColorKey32BlitTest();
QueryInterface(); QueryInterface();

View File

@ -304,7 +304,7 @@ static void test_d3d_ifaces(void)
long ref; long ref;
hr = DirectDrawCreate(NULL, &DDraw1, NULL); 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) if(!DDraw1)
{ {
trace("DirectDrawCreate failed with %08lx\n", hr); trace("DirectDrawCreate failed with %08lx\n", hr);