Module: wine Branch: master Commit: 52452b271e6329deed88110f6fa18d58bea63e2c URL: http://source.winehq.org/git/wine.git/?a=commit;h=52452b271e6329deed88110f6f...
Author: Józef Kucia jkucia@codeweavers.com Date: Fri Jan 13 12:53:45 2017 +0100
d3d9/tests: Add more tests for UnlockRect().
Signed-off-by: Józef Kucia jkucia@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/d3d9/tests/device.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index aa266a5..39cc2e2 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -7296,12 +7296,12 @@ static void test_lockrect_invalid(void) IDirect3DDevice9 *device; IDirect3DTexture9 *texture; IDirect3DCubeTexture9 *cube_texture; - IDirect3D9 *d3d; + HRESULT hr, expected_hr; unsigned int i, r; + IDirect3D9 *d3d; ULONG refcount; HWND window; BYTE *base; - HRESULT hr; static const struct { D3DRESOURCETYPE type; @@ -7374,6 +7374,10 @@ static void test_lockrect_invalid(void) base = locked_rect.pBits; hr = IDirect3DSurface9_UnlockRect(surface); ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x, type %s.\n", hr, resources[r].name); + expected_hr = resources[r].type == D3DRTYPE_TEXTURE ? D3D_OK : D3DERR_INVALIDCALL; + hr = IDirect3DSurface9_UnlockRect(surface); + todo_wine_if(resources[r].type == D3DRTYPE_TEXTURE) + ok(hr == expected_hr, "Got hr %#x, expected %#x, type %s.\n", hr, expected_hr, resources[r].name);
for (i = 0; i < sizeof(test_data) / sizeof(*test_data); ++i) { @@ -7485,6 +7489,8 @@ static void test_lockrect_invalid(void) ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x, type %s.\n", hr, resources[r].name); hr = IDirect3DTexture9_UnlockRect(texture, 0); ok(SUCCEEDED(hr), "Failed to unlock texture, hr %#x, type %s.\n", hr, resources[r].name); + hr = IDirect3DTexture9_UnlockRect(texture, 0); + todo_wine ok(hr == D3D_OK, "Got unexpected hr %#x, type %s.\n", hr, resources[r].name);
hr = IDirect3DTexture9_LockRect(texture, 0, &locked_rect, &test_data[0].rect, 0); ok(hr == D3D_OK, "Got unexpected hr %#x for rect %s, type %s.\n", @@ -7519,6 +7525,8 @@ static void test_lockrect_invalid(void) ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x, type %s.\n", hr, resources[r].name); hr = IDirect3DCubeTexture9_UnlockRect(cube_texture, D3DCUBEMAP_FACE_NEGATIVE_X, 0); ok(SUCCEEDED(hr), "Failed to unlock texture, hr %#x, type %s.\n", hr, resources[r].name); + hr = IDirect3DCubeTexture9_UnlockRect(cube_texture, D3DCUBEMAP_FACE_NEGATIVE_X, 0); + todo_wine ok(hr == D3D_OK, "Got unexpected hr %#x, type %s.\n", hr, resources[r].name);
hr = IDirect3DCubeTexture9_LockRect(cube_texture, D3DCUBEMAP_FACE_NEGATIVE_X, 0, &locked_rect, &test_data[0].rect, 0);