d3d9/tests: Use SetRect() instead of open coding it.

Signed-off-by: Michael Stefaniuc <mstefani@redhat.de>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2016-06-27 09:57:49 +02:00 committed by Alexandre Julliard
parent 88fb885088
commit 080c74497d
2 changed files with 5 additions and 14 deletions

View File

@ -1990,10 +1990,7 @@ static void test_reset(void)
ok(d3dpp.BackBufferHeight == 300, "Got unexpected BackBufferHeight %u.\n", d3dpp.BackBufferHeight); ok(d3dpp.BackBufferHeight == 300, "Got unexpected BackBufferHeight %u.\n", d3dpp.BackBufferHeight);
IDirect3DSwapChain9_Release(swapchain); IDirect3DSwapChain9_Release(swapchain);
winrect.left = 0; SetRect(&winrect, 0, 0, 200, 150);
winrect.top = 0;
winrect.right = 200;
winrect.bottom = 150;
ok(AdjustWindowRect(&winrect, WS_OVERLAPPEDWINDOW, FALSE), "AdjustWindowRect failed\n"); ok(AdjustWindowRect(&winrect, WS_OVERLAPPEDWINDOW, FALSE), "AdjustWindowRect failed\n");
ok(SetWindowPos(hwnd, NULL, 0, 0, ok(SetWindowPos(hwnd, NULL, 0, 0,
winrect.right-winrect.left, winrect.right-winrect.left,
@ -8465,17 +8462,14 @@ static void test_surface_blocks(void)
hr = IDirect3DTexture9_UnlockRect(texture, 1); hr = IDirect3DTexture9_UnlockRect(texture, 1);
ok(SUCCEEDED(hr), "Failed lock texture, hr %#x.\n", hr); ok(SUCCEEDED(hr), "Failed lock texture, hr %#x.\n", hr);
rect.left = 0; SetRect(&rect, 0, 0, formats[i].block_width == 1 ? 1 : formats[i].block_width >> 1,
rect.top = 0; formats[i].block_height == 1 ? 1 : formats[i].block_height >> 1);
rect.right = formats[i].block_width == 1 ? 1 : formats[i].block_width >> 1;
rect.bottom = formats[i].block_height == 1 ? 1 : formats[i].block_height >> 1;
hr = IDirect3DTexture9_LockRect(texture, 1, &locked_rect, &rect, 0); hr = IDirect3DTexture9_LockRect(texture, 1, &locked_rect, &rect, 0);
ok(SUCCEEDED(hr), "Failed lock texture, hr %#x.\n", hr); ok(SUCCEEDED(hr), "Failed lock texture, hr %#x.\n", hr);
hr = IDirect3DTexture9_UnlockRect(texture, 1); hr = IDirect3DTexture9_UnlockRect(texture, 1);
ok(SUCCEEDED(hr), "Failed lock texture, hr %#x.\n", hr); ok(SUCCEEDED(hr), "Failed lock texture, hr %#x.\n", hr);
rect.right = formats[i].block_width; SetRect(&rect, 0, 0, formats[i].block_width, formats[i].block_height);
rect.bottom = formats[i].block_height;
hr = IDirect3DTexture9_LockRect(texture, 1, &locked_rect, &rect, 0); hr = IDirect3DTexture9_LockRect(texture, 1, &locked_rect, &rect, 0);
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))

View File

@ -1041,10 +1041,7 @@ static void clear_test(void)
hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0); hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0);
ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed with %08x\n", hr); ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed with %08x\n", hr);
scissor.left = 160; SetRect(&scissor, 160, 120, 480, 360);
scissor.right = 480;
scissor.top = 120;
scissor.bottom = 360;
hr = IDirect3DDevice9_SetScissorRect(device, &scissor); hr = IDirect3DDevice9_SetScissorRect(device, &scissor);
ok(hr == D3D_OK, "IDirect3DDevice_SetScissorRect failed with %08x\n", hr); ok(hr == D3D_OK, "IDirect3DDevice_SetScissorRect failed with %08x\n", hr);
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_SCISSORTESTENABLE, TRUE); hr = IDirect3DDevice9_SetRenderState(device, D3DRS_SCISSORTESTENABLE, TRUE);