user32/tests: Use SetRectEmpty() 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-03-03 09:59:46 +01:00 committed by Alexandre Julliard
parent d49201138d
commit 3a74fd3f72
2 changed files with 9 additions and 9 deletions

View File

@ -315,16 +315,16 @@ static void test_DrawTextCalcRect(void)
dtp.cbSize = sizeof(dtp);
dtp.iLeftMargin = 0;
dtp.iRightMargin = 0;
SetRect( &rect, 0, 0, 0, 0);
SetRectEmpty(&rect);
DrawTextExA(hdc, text, -1, &rect, DT_CALCRECT, &dtp);
textlen = rect.right; /* Width without margin */
dtp.iLeftMargin = 8;
SetRect( &rect, 0, 0, 0, 0);
SetRectEmpty(&rect);
DrawTextExA(hdc, text, -1, &rect, DT_CALCRECT, &dtp);
ok(rect.right==dtp.iLeftMargin+textlen ,"Incorrect left margin calculated rc(%d,%d)\n", rect.left, rect.right);
dtp.iLeftMargin = 0;
dtp.iRightMargin = 8;
SetRect( &rect, 0, 0, 0, 0);
SetRectEmpty(&rect);
DrawTextExA(hdc, text, -1, &rect, DT_CALCRECT, &dtp);
ok(rect.right==dtp.iRightMargin+textlen ,"Incorrect right margin calculated rc(%d,%d)\n", rect.left, rect.right);
@ -535,7 +535,7 @@ static void test_DrawTextCalcRect(void)
}
/* More test cases from bug 12226 */
SetRect(&rect, 0, 0, 0, 0);
SetRectEmpty(&rect);
textheight = DrawTextA(hdc, emptystring, -1, &rect, DT_CALCRECT | DT_LEFT | DT_SINGLELINE);
ok(textheight, "DrawTextA error %u\n", GetLastError());
ok(0 == rect.left, "expected 0, got %d\n", rect.left);
@ -543,7 +543,7 @@ static void test_DrawTextCalcRect(void)
ok(0 == rect.top, "expected 0, got %d\n", rect.top);
ok(rect.bottom, "rect.bottom should not be 0\n");
SetRect(&rect, 0, 0, 0, 0);
SetRectEmpty(&rect);
textheight = DrawTextW(hdc, emptystringW, -1, &rect, DT_CALCRECT | DT_LEFT | DT_SINGLELINE);
if (!textheight && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
{

View File

@ -5687,7 +5687,7 @@ static void test_CreateWindow(void)
DestroyWindow(hwnd);
expected_cx = expected_cy = -10;
SetRect( &expected_rect, 0, 0, 0, 0 );
SetRectEmpty(&expected_rect);
SetRect( &broken_rect, 0, 0, -10, -10 );
hwnd = CreateWindowExA(0, "Sizes_WndClass", NULL, WS_CHILD, -20, -20, -10, -10, parent, 0, 0, NULL);
ok( hwnd != 0, "creation failed err %u\n", GetLastError());
@ -5697,7 +5697,7 @@ static void test_CreateWindow(void)
DestroyWindow(hwnd);
expected_cx = expected_cy = -200000;
SetRect( &expected_rect, 0, 0, 0, 0 );
SetRectEmpty(&expected_rect);
SetRect( &broken_rect, 0, 0, -200000, -200000 );
hwnd = CreateWindowExA(0, "Sizes_WndClass", NULL, WS_CHILD, -300000, -300000, -200000, -200000, parent, 0, 0, NULL);
ok( hwnd != 0, "creation failed err %u\n", GetLastError());
@ -6249,7 +6249,7 @@ static void test_GetUpdateRect(void)
flush_events( TRUE );
ShowWindow(hchild, SW_HIDE);
SetRect(&rc2, 0, 0, 0, 0);
SetRectEmpty(&rc2);
ret = GetUpdateRect(hgrandparent, &rc1, FALSE);
ok(!ret, "GetUpdateRect returned not empty region\n");
ok(EqualRect(&rc1, &rc2), "rects do not match (%d,%d,%d,%d) / (%d,%d,%d,%d)\n",
@ -6313,7 +6313,7 @@ static void test_GetUpdateRect(void)
ShowWindow(hchild, SW_HIDE);
SetRect(&rc2, 0, 0, 0, 0);
SetRectEmpty(&rc2);
ret = GetUpdateRect(hgrandparent, &rc1, FALSE);
ok(!ret, "GetUpdateRect returned not empty region\n");
ok(EqualRect(&rc1, &rc2), "rects do not match (%d,%d,%d,%d) / (%d,%d,%d,%d)\n",