Some more CreateSurface Tests (for invaild flags)

svn path=/trunk/; revision=26759
This commit is contained in:
Maarten Bosma 2007-05-13 17:58:05 +00:00
parent 35b29a1d0a
commit 39932ced34
2 changed files with 51 additions and 5 deletions

View file

@ -13,10 +13,9 @@ BOOL Test_CreateDDraw (INT* passed, INT* failed)
TEST (DirectDrawCreateEx(NULL, (VOID**)&DirectDraw, IID_IDirectDraw4, NULL) == DDERR_INVALIDPARAMS); TEST (DirectDrawCreateEx(NULL, (VOID**)&DirectDraw, IID_IDirectDraw4, NULL) == DDERR_INVALIDPARAMS);
TEST (DirectDrawCreateEx(NULL, NULL, IID_IDirectDraw7, NULL) == DDERR_INVALIDPARAMS); TEST (DirectDrawCreateEx(NULL, NULL, IID_IDirectDraw7, NULL) == DDERR_INVALIDPARAMS);
TEST (DirectDrawCreateEx(NULL, (VOID**)&DirectDraw, IID_IDirectDraw7, NULL) == DD_OK); TEST (DirectDrawCreateEx(NULL, (VOID**)&DirectDraw, IID_IDirectDraw7, NULL) == DD_OK);
TEST (DirectDraw && DirectDraw->Release()); //TEST (DirectDraw && DirectDraw->Release());
TEST (DirectDrawCreate(NULL ,&DirectDraw2, NULL) == DD_OK); TEST (DirectDrawCreate(NULL ,&DirectDraw2, NULL) == DD_OK);
TEST (DirectDraw2 && DirectDraw2->Release()); //TEST (DirectDraw2 && DirectDraw2->Release());
return TRUE; return TRUE;
} }

View file

@ -45,10 +45,57 @@ BOOL Test_CreateSurface (INT* passed, INT* failed)
TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DD_OK ); TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DD_OK );
TEST ( DirectDrawSurface && DirectDrawSurface->Release() == DD_OK ); TEST ( DirectDrawSurface && DirectDrawSurface->Release() == DD_OK );
DirectDrawSurface = NULL;
Desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE;
TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DDERR_INVALIDPARAMS);
DirectDrawSurface = NULL;
Desc.ddsCaps.dwCaps = DDSCAPS_3DDEVICE;
TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DDERR_INVALIDPARAMS);
DirectDrawSurface = NULL;
Desc.ddsCaps.dwCaps = DDSCAPS_ALLOCONLOAD;
TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DDERR_INVALIDCAPS);
DirectDrawSurface = NULL;
Desc.ddsCaps.dwCaps = DDSCAPS_ALPHA;
TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DDERR_INVALIDPARAMS);
DirectDrawSurface = NULL; DirectDrawSurface = NULL;
Desc.ddsCaps.dwCaps = DDSCAPS_BACKBUFFER; Desc.ddsCaps.dwCaps = DDSCAPS_BACKBUFFER;
TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DD_OK ); TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DDERR_INVALIDCAPS);
TEST ( DirectDrawSurface && DirectDrawSurface->Release() == DD_OK );
DirectDrawSurface = NULL;
Desc.ddsCaps.dwCaps = DDSCAPS_COMPLEX;
TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DDERR_INVALIDCAPS);
DirectDrawSurface = NULL;
Desc.ddsCaps.dwCaps = DDSCAPS_FLIP;
TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DDERR_INVALIDCAPS);
DirectDrawSurface = NULL;
Desc.ddsCaps.dwCaps = DDSCAPS_HWCODEC;
TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DDERR_INVALIDPARAMS);
DirectDrawSurface = NULL;
Desc.ddsCaps.dwCaps = DDSCAPS_LIVEVIDEO;
TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DDERR_INVALIDPARAMS);
DirectDrawSurface = NULL;
Desc.ddsCaps.dwCaps = DDSCAPS_LOCALVIDMEM;
TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DDERR_INVALIDCAPS);
DirectDrawSurface = NULL;
Desc.ddsCaps.dwCaps = DDSCAPS_MIPMAP;
TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DDERR_INVALIDCAPS);
DirectDrawSurface = NULL;
Desc.ddsCaps.dwCaps = DDSCAPS_MODEX;
TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DDERR_INVALIDPARAMS);
DirectDrawSurface = NULL;
Desc.ddsCaps.dwCaps = DDSCAPS_MODEX;
TEST ( DirectDraw->CreateSurface(&Desc, &DirectDrawSurface, NULL) == DDERR_INVALIDPARAMS);
DirectDraw->Release(); DirectDraw->Release();