user32/tests: Use SetRect instead of open coding it.

Signed-off-by: Michael Stefaniuc <mstefani@redhat.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2016-04-18 10:12:23 +02:00 committed by Alexandre Julliard
parent 414c73feab
commit 4ee8139487
4 changed files with 7 additions and 18 deletions

View File

@ -574,11 +574,7 @@ static HWND create_child_editcontrol (DWORD style, DWORD exstyle)
HWND editWnd;
RECT rect;
BOOL b;
rect.left = 0;
rect.top = 0;
rect.right = 300;
rect.bottom = 300;
SetRect(&rect, 0, 0, 300, 300);
b = AdjustWindowRect(&rect, WS_OVERLAPPEDWINDOW, FALSE);
ok(b, "AdjustWindowRect failed\n");
@ -1468,10 +1464,7 @@ static void test_margins(void)
the rectangle must not change */
SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(10, 10));
old_rect.left = 1;
old_rect.right = 99;
old_rect.top = 1;
old_rect.bottom = 99;
SetRect(&old_rect, 1, 1, 99, 99);
SendMessageA(hwEdit, EM_SETRECT, 0, (LPARAM)&old_rect);
SendMessageA(hwEdit, EM_GETRECT, 0, (LPARAM)&old_rect);
SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(10, 10));

View File

@ -1835,10 +1835,7 @@ static void test_SPI_SETWORKAREA( void ) /* 47 */
* Changing the work area by just one pixel should make this occurrence
* reasonably unlikely.
*/
curr_val.left = old_area.left;
curr_val.top = old_area.top;
curr_val.right = old_area.right-1;
curr_val.bottom = old_area.bottom-1;
SetRect(&curr_val, old_area.left, old_area.top, old_area.right - 1, old_area.bottom - 1);
rc=SystemParametersInfoA( SPI_SETWORKAREA, 0, &curr_val,
SPIF_UPDATEINIFILE | SPIF_SENDCHANGE );
if (!test_error_msg(rc,"SPI_SETWORKAREA")) return;

View File

@ -49,8 +49,7 @@ static void test_FillRect(void)
/* select black brush */
old_brush = SelectObject(hdcmem, GetStockObject(BLACK_BRUSH));
r.left = r.top = 0;
r.right = r.bottom = 5;
SetRect(&r, 0, 0, 5, 5);
FillRect(hdcmem, &r, 0);
SelectObject(hdcmem, old_brush);
/* bitmap filled with last selected brush */

View File

@ -7578,7 +7578,7 @@ static void test_winregion(void)
ok( ret == ERROR, "Expected ERROR, got %d\n", ret);
ok( GetLastError() == 0xdeadbeef, "Expected , got %d\n", GetLastError());
r.left = r.top = r.right = r.bottom = 0;
SetRectEmpty(&r);
ret = pGetWindowRgnBox(hwnd, &r);
ok( ret == SIMPLEREGION, "Expected SIMPLEREGION, got %d\n", ret);
ok( r.left == 2 && r.top == 3 && r.right == 10 && r.bottom == 15,
@ -7589,10 +7589,10 @@ static void test_winregion(void)
hrgn = CreateRectRgn(2, 3, 10, 15);
ret = pMirrorRgn( hwnd, hrgn );
ok( ret == TRUE, "MirrorRgn failed %u\n", ret );
r.left = r.top = r.right = r.bottom = 0;
SetRectEmpty(&r);
GetWindowRect( hwnd, &r );
width = r.right - r.left;
r.left = r.top = r.right = r.bottom = 0;
SetRectEmpty(&r);
ret = GetRgnBox( hrgn, &r );
ok( ret == SIMPLEREGION, "GetRgnBox failed %u\n", ret );
ok( r.left == width - 10 && r.top == 3 && r.right == width - 2 && r.bottom == 15,