[PATCH 1/4] ddraw/tests: New CreateSurface for DDSCAPS_BACKBUFFER tests.
stefandoesinger at gmx.at
Fri Jul 23 03:14:52 CDT 2010
Am 22.07.2010 um 22:15 schrieb Oldřich Jedlička:
> > This is redundant, lpDD is already an IDirectDraw interface.
> You are right, I thought it is some default (=latest, V7) interface. I will
> change it.
static LPDIRECTDRAW lpDD = NULL;
LPDIRECTDRAW is just a typedef for IDirectDraw * . It is preferred to use ISomething *, not Microsoft's LPSOMETHING pointer types, although the wine codebase isn't really consistent as you can see in the tests. Many DirectX samples and tutorials use LPSOMETHING.
> Which NULL pointer do you mean? Does the todo_wine mean that the test reports
> problem and just continues (so that surf is NULL)?
Well, if ddraw::CreateSurface fails it will return an error, and 'surf' will be NULL(or undefined, not sure), which will cause problems with the GetSurfaceDesc and Release calls. So in case CreateSurface fails you'll have to skip those calls, otherwise the test will segfault.
todo_wine doesn't automatically skip or abort any tests. All it does is make sure that 'make test' doesn't fail if the test fails(and it makes sure that make test fails if the test unexpectedly succeeds)
In patch 3/4 you can remove the NULL pointer handling again, if there's no reason why the surface creation would ever fail. You can also keep it in, it's a matter of taste IMO.
More information about the wine-devel