Michael Stefaniuc : d3d9/tests: Use SetRect() instead of open coding it.
Module: wine Branch: master Commit: 080c74497de63a237c6d20799f83dd33d092b6f0 URL: http://source.winehq.org/git/wine.git/?a=commit;h=080c74497de63a237c6d20799f... Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Jun 27 09:57:49 2016 +0200 d3d9/tests: Use SetRect() instead of open coding it. Signed-off-by: Michael Stefaniuc <mstefani(a)redhat.de> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d9/tests/device.c | 14 ++++---------- dlls/d3d9/tests/visual.c | 5 +---- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index e73af1f..715e34c 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -1990,10 +1990,7 @@ static void test_reset(void) ok(d3dpp.BackBufferHeight == 300, "Got unexpected BackBufferHeight %u.\n", d3dpp.BackBufferHeight); IDirect3DSwapChain9_Release(swapchain); - winrect.left = 0; - winrect.top = 0; - winrect.right = 200; - winrect.bottom = 150; + SetRect(&winrect, 0, 0, 200, 150); ok(AdjustWindowRect(&winrect, WS_OVERLAPPEDWINDOW, FALSE), "AdjustWindowRect failed\n"); ok(SetWindowPos(hwnd, NULL, 0, 0, winrect.right-winrect.left, @@ -8465,17 +8462,14 @@ static void test_surface_blocks(void) hr = IDirect3DTexture9_UnlockRect(texture, 1); ok(SUCCEEDED(hr), "Failed lock texture, hr %#x.\n", hr); - rect.left = 0; - rect.top = 0; - 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; + SetRect(&rect, 0, 0, formats[i].block_width == 1 ? 1 : formats[i].block_width >> 1, + formats[i].block_height == 1 ? 1 : formats[i].block_height >> 1); hr = IDirect3DTexture9_LockRect(texture, 1, &locked_rect, &rect, 0); ok(SUCCEEDED(hr), "Failed lock texture, hr %#x.\n", hr); hr = IDirect3DTexture9_UnlockRect(texture, 1); ok(SUCCEEDED(hr), "Failed lock texture, hr %#x.\n", hr); - rect.right = formats[i].block_width; - rect.bottom = formats[i].block_height; + SetRect(&rect, 0, 0, formats[i].block_width, formats[i].block_height); hr = IDirect3DTexture9_LockRect(texture, 1, &locked_rect, &rect, 0); ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); if (SUCCEEDED(hr)) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index a308311..a2adc54 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -1041,10 +1041,7 @@ static void clear_test(void) hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed with %08x\n", hr); - scissor.left = 160; - scissor.right = 480; - scissor.top = 120; - scissor.bottom = 360; + SetRect(&scissor, 160, 120, 480, 360); hr = IDirect3DDevice9_SetScissorRect(device, &scissor); ok(hr == D3D_OK, "IDirect3DDevice_SetScissorRect failed with %08x\n", hr); hr = IDirect3DDevice9_SetRenderState(device, D3DRS_SCISSORTESTENABLE, TRUE);
participants (1)
-
Alexandre Julliard