Nicolas Le Cam : ddraw/tests: Fix a test failure on VirtualBox.
Alexandre Julliard
julliard at winehq.org
Mon May 4 09:06:37 CDT 2009
Module: wine
Branch: master
Commit: ad66aa77a42aeaa623eb3986f3e72443028b34e0
URL: http://source.winehq.org/git/wine.git/?a=commit;h=ad66aa77a42aeaa623eb3986f3e72443028b34e0
Author: Nicolas Le Cam <niko.lecam at gmail.com>
Date: Wed Apr 29 01:22:14 2009 +0200
ddraw/tests: Fix a test failure on VirtualBox.
---
dlls/ddraw/tests/dsurface.c | 34 +++++++++++++++++++++-------------
1 files changed, 21 insertions(+), 13 deletions(-)
diff --git a/dlls/ddraw/tests/dsurface.c b/dlls/ddraw/tests/dsurface.c
index 47a231e..a0f69b1 100644
--- a/dlls/ddraw/tests/dsurface.c
+++ b/dlls/ddraw/tests/dsurface.c
@@ -1374,20 +1374,28 @@ static void AttachmentTest(void)
ok(hr==DD_OK,"CreateSurface returned: %x\n",hr);
hr = IDirectDrawSurface_AddAttachedSurface(surface1, surface2);
- ok(hr == DD_OK, "Attaching an offscreen plain surface to a front buffer returned %08x\n", hr);
- /* Try the reverse without detaching first */
- hr = IDirectDrawSurface_AddAttachedSurface(surface2, surface1);
- ok(hr == DDERR_SURFACEALREADYATTACHED, "Attaching an attached surface to its attachee returned %08x\n", hr);
- hr = IDirectDrawSurface_DeleteAttachedSurface(surface1, 0, surface2);
- ok(hr == DD_OK, "DeleteAttachedSurface failed with %08x\n", hr);
+ ok(hr == DD_OK || broken(hr == DDERR_CANNOTATTACHSURFACE),
+ "Attaching an offscreen plain surface to a front buffer returned %08x\n", hr);
+ if(SUCCEEDED(hr))
+ {
+ /* Try the reverse without detaching first */
+ hr = IDirectDrawSurface_AddAttachedSurface(surface2, surface1);
+ ok(hr == DDERR_SURFACEALREADYATTACHED, "Attaching an attached surface to its attachee returned %08x\n", hr);
+ hr = IDirectDrawSurface_DeleteAttachedSurface(surface1, 0, surface2);
+ ok(hr == DD_OK, "DeleteAttachedSurface failed with %08x\n", hr);
+ }
hr = IDirectDrawSurface_AddAttachedSurface(surface2, surface1);
- ok(hr == DD_OK, "Attaching a front buffer to an offscreen plain surface returned %08x\n", hr);
- /* Try to detach reversed */
- hr = IDirectDrawSurface_DeleteAttachedSurface(surface1, 0, surface2);
- ok(hr == DDERR_CANNOTDETACHSURFACE, "DeleteAttachedSurface returned %08x\n", hr);
- /* Now the proper detach */
- hr = IDirectDrawSurface_DeleteAttachedSurface(surface2, 0, surface1);
- ok(hr == DD_OK, "DeleteAttachedSurface failed with %08x\n", hr);
+ ok(hr == DD_OK || broken(hr == DDERR_CANNOTATTACHSURFACE),
+ "Attaching a front buffer to an offscreen plain surface returned %08x\n", hr);
+ if(SUCCEEDED(hr))
+ {
+ /* Try to detach reversed */
+ hr = IDirectDrawSurface_DeleteAttachedSurface(surface1, 0, surface2);
+ ok(hr == DDERR_CANNOTDETACHSURFACE, "DeleteAttachedSurface returned %08x\n", hr);
+ /* Now the proper detach */
+ hr = IDirectDrawSurface_DeleteAttachedSurface(surface2, 0, surface1);
+ ok(hr == DD_OK, "DeleteAttachedSurface failed with %08x\n", hr);
+ }
hr = IDirectDrawSurface_AddAttachedSurface(surface2, surface3); /* Fails on refrast */
ok(hr == DD_OK || broken(hr == DDERR_CANNOTATTACHSURFACE),
"Attaching an offscreen plain surface to another offscreen plain surface returned %08x\n", hr);
More information about the wine-cvs
mailing list