On 15 November 2011 00:12, Stefan Dösinger stefan@codeweavers.com wrote:
- /* Tests show that only LPSURFACE and PIXELFORMAT can be set, and LPSURFACE is required
* for PIXELFORMAT to work */
This may be ok, but note that the test doesn't actually test this. (E.g. does calling SetSurfaceDesc() with the original surface desc work? What about bits not in DDSD_ALL? Etc.) Also, as a general principle, I'd be happier about the ddraw tests if they actually tested all the different interface versions.
On Tuesday 15 November 2011 15:19:20 Henri Verbeet wrote:
(E.g. does calling SetSurfaceDesc() with the original surface desc work?
That's a reasonable thing to test, I'll add it to the test(The answer is no, you can't set the original surface desc).
What about bits not in DDSD_ALL? Etc.)
I forgot a test that shows that SetSurfaceDesc is valid only on systemmem surfaces(as the msdn claims). The flags I tested are those that make sense on systemmem surfaces.
I don't think testing the other bits without an app that uses them is a good idea. The YV12 blitting issue from yesterday was a reminder of that - in corner cases like that you probably get 3 different results on 3 different systems and have to explain them.
I'm working on adding a test for various pools and plain surfaces vs textures.
Also, as a general principle, I'd be happier about the ddraw tests if they actually tested all the different interface versions.
In principle I agree, but handling this on a per-test basis won't work. The behavior doesn't just depend on the interface version you call, but also the version with which the object was created(see e.g. surface::GetDDInterface, ddraw::QueryInterface). To properly test the version differences you have to create all versions and QI all versions from each of them and run the tests on those interfaces.
For that reason I'm currently ignoring the interface versions unless the API makes differences likely(e.g. DDSURFACEDESC.dwSize) or an application depends on version specific behavior(e.g. refcounting).
On 15 November 2011 20:28, Stefan Dösinger stefandoesinger@gmx.at wrote:
In principle I agree, but handling this on a per-test basis won't work. The behavior doesn't just depend on the interface version you call, but also the version with which the object was created(see e.g. surface::GetDDInterface, ddraw::QueryInterface). To properly test the version differences you have to create all versions and QI all versions from each of them and run the tests on those interfaces.
For that reason I'm currently ignoring the interface versions unless the API makes differences likely(e.g. DDSURFACEDESC.dwSize) or an application depends on version specific behavior(e.g. refcounting).
It's probably ok to ignore the more obscure cases of getting an earlier interface through QI on a newer interface, but I think we should at least test version differences for interfaces originally created with a particular version.
On Tuesday 15 November 2011 20:53:43 Henri Verbeet wrote:
It's probably ok to ignore the more obscure cases of getting an earlier interface through QI on a newer interface, but I think we should at least test version differences for interfaces originally created with a particular version.
Keep in mind that IDirectDrawSurface is created by IDirectDraw and IDirectDraw2. IDirectDrawSurface2 and IDirectDrawSurface3 are only available via QueryInterface. One would expect that apps create them via IDirectDraw2, but nothing in the API suggests that, other than that IDirectDraw2 was available by the time IDirectDrawSurface2 was introduced.
Even with just one test copy per IDirectDraw*X interface it'll probably triple the size of overlay.c, ddrawmodes.c and dsurface.c by creating essentially copypasted versions of all tests(excluding those that exist in higher interfaces only).
The IDirect3D and IDirect3DDevice tests can only be handled by cloning the tests because the API differences between the IDirect3DDevice versions are too big. You can't even QI the IDirect3DDevice interfaces from each other(needs fixing in Wine).
My idea to systematically test all IDirectDraw and IDirectDrawSurface versions was writing wrapper functions around their methods that take an IUnknown * pointer and find out which interface version it is via QueryInterface or with an extra parameter and call the correct method. But I have doubt that this will work because of structure size differences and because most surface tests have to create the surfaces themselves.
On 15 November 2011 23:23, Stefan Dösinger stefandoesinger@gmx.at wrote:
On Tuesday 15 November 2011 20:53:43 Henri Verbeet wrote:
It's probably ok to ignore the more obscure cases of getting an earlier interface through QI on a newer interface, but I think we should at least test version differences for interfaces originally created with a particular version.
Keep in mind that IDirectDrawSurface is created by IDirectDraw and IDirectDraw2. IDirectDrawSurface2 and IDirectDrawSurface3 are only available via QueryInterface.
Yes, but that's ok because a "normal" application written when those were the current versions of the interfaces would get those like that as well.
Even with just one test copy per IDirectDraw*X interface it'll probably triple the size of overlay.c, ddrawmodes.c and dsurface.c by creating essentially copypasted versions of all tests(excluding those that exist in higher interfaces only).
I don't think that's necessarily a bad thing.