ddraw/tests: Test SetSurfaceDesc and Lock interaction.

This commit is contained in:
Stefan Dösinger 2013-12-03 13:44:37 +01:00 committed by Alexandre Julliard
parent 5e43ee256c
commit 42470bae67
3 changed files with 43 additions and 0 deletions

View File

@ -4467,7 +4467,21 @@ static void test_set_surface_desc(void)
/* Redundantly setting the same lpSurface is not an error. */
hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0);
ok(SUCCEEDED(hr), "Failed to set surface desc, hr %#x.\n", hr);
hr = IDirectDrawSurface3_GetSurfaceDesc(surface3, &ddsd);
ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr);
ok(!(ddsd.dwFlags & DDSD_LPSURFACE), "DDSD_LPSURFACE is set.\n");
ok(ddsd.lpSurface == NULL, "lpSurface is %p, expected NULL.\n", ddsd.lpSurface);
hr = IDirectDrawSurface3_Lock(surface3, NULL, &ddsd, 0, NULL);
ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr);
ok(!(ddsd.dwFlags & DDSD_LPSURFACE), "DDSD_LPSURFACE is set.\n");
ok(ddsd.lpSurface == data, "lpSurface is %p, expected %p.\n", data, data);
hr = IDirectDrawSurface3_Unlock(surface3, NULL);
ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr);
reset_ddsd(&ddsd);
ddsd.dwFlags = DDSD_LPSURFACE;
ddsd.lpSurface = data;
hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 1);
ok(hr == DDERR_INVALIDPARAMS, "SetSurfaceDesc with flags=1 returned %#x.\n", hr);

View File

@ -5068,7 +5068,21 @@ static void test_set_surface_desc(void)
/* Redundantly setting the same lpSurface is not an error. */
hr = IDirectDrawSurface4_SetSurfaceDesc(surface, &ddsd, 0);
ok(SUCCEEDED(hr), "Failed to set surface desc, hr %#x.\n", hr);
hr = IDirectDrawSurface4_GetSurfaceDesc(surface, &ddsd);
ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr);
ok(!(ddsd.dwFlags & DDSD_LPSURFACE), "DDSD_LPSURFACE is set.\n");
ok(ddsd.lpSurface == NULL, "lpSurface is %p, expected NULL.\n", ddsd.lpSurface);
hr = IDirectDrawSurface4_Lock(surface, NULL, &ddsd, 0, NULL);
ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr);
ok(!(ddsd.dwFlags & DDSD_LPSURFACE), "DDSD_LPSURFACE is set.\n");
ok(ddsd.lpSurface == data, "lpSurface is %p, expected %p.\n", data, data);
hr = IDirectDrawSurface4_Unlock(surface, NULL);
ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr);
reset_ddsd(&ddsd);
ddsd.dwFlags = DDSD_LPSURFACE;
ddsd.lpSurface = data;
hr = IDirectDrawSurface4_SetSurfaceDesc(surface, &ddsd, 1);
ok(hr == DDERR_INVALIDPARAMS, "SetSurfaceDesc with flags=1 returned %#x.\n", hr);

View File

@ -4956,6 +4956,21 @@ static void test_set_surface_desc(void)
hr = IDirectDrawSurface7_SetSurfaceDesc(surface, &ddsd, 0);
ok(SUCCEEDED(hr), "Failed to set surface desc, hr %#x.\n", hr);
hr = IDirectDrawSurface7_GetSurfaceDesc(surface, &ddsd);
ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr);
ok(!(ddsd.dwFlags & DDSD_LPSURFACE), "DDSD_LPSURFACE is set.\n");
ok(ddsd.lpSurface == NULL, "lpSurface is %p, expected NULL.\n", ddsd.lpSurface);
hr = IDirectDrawSurface7_Lock(surface, NULL, &ddsd, 0, NULL);
ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr);
ok(!(ddsd.dwFlags & DDSD_LPSURFACE), "DDSD_LPSURFACE is set.\n");
ok(ddsd.lpSurface == data, "lpSurface is %p, expected %p.\n", data, data);
hr = IDirectDrawSurface7_Unlock(surface, NULL);
ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr);
reset_ddsd(&ddsd);
ddsd.dwFlags = DDSD_LPSURFACE;
ddsd.lpSurface = data;
hr = IDirectDrawSurface7_SetSurfaceDesc(surface, &ddsd, 1);
ok(hr == DDERR_INVALIDPARAMS, "SetSurfaceDesc with flags=1 returned %#x.\n", hr);