Module: wine Branch: stable Commit: 14a0ed92fb1d464a4df9ec2ca73582a48621d34f URL: https://source.winehq.org/git/wine.git/?a=commit;h=14a0ed92fb1d464a4df9ec2ca...
Author: Paul Gofman gofmanp@gmail.com Date: Mon Aug 5 21:58:35 2019 +0300
ddraw/tests: Test restoring attached surface for ddraw1.
Signed-off-by: Paul Gofman gofmanp@gmail.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org (cherry picked from commit aa6517cf875e6f94db85393391397d036b67b24b) Signed-off-by: Michael Stefaniuc mstefani@winehq.org
---
dlls/ddraw/tests/ddraw1.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index 0757b75c43..2f1d6d1635 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -6735,11 +6735,12 @@ static void test_palette_alpha(void)
static void test_lost_device(void) { - IDirectDrawSurface *surface; + IDirectDrawSurface *surface, *back_buffer; DDSURFACEDESC surface_desc; HWND window1, window2; IDirectDraw *ddraw; ULONG refcount; + DDSCAPS caps; HRESULT hr; BOOL ret;
@@ -6877,6 +6878,19 @@ static void test_lost_device(void) hr = IDirectDrawSurface_Flip(surface, NULL, DDFLIP_WAIT); ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
+ memset(&caps, 0, sizeof(caps)); + caps.dwCaps = DDSCAPS_FLIP; + + hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &back_buffer); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + hr = IDirectDrawSurface_Restore(surface); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &back_buffer); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirectDrawSurface_IsLost(back_buffer); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + IDirectDrawSurface_Release(back_buffer); + IDirectDrawSurface_Release(surface); refcount = IDirectDraw_Release(ddraw); ok(!refcount, "Got unexpected refcount %u.\n", refcount);