user32/tests: Use SetRectEmpty() instead of open coding it.
Michael Stefaniuc
mstefani at redhat.de
Thu Mar 3 02:59:46 CST 2016
Signed-off-by: Michael Stefaniuc <mstefani at redhat.de>
---
dlls/user32/tests/text.c | 10 +++++-----
dlls/user32/tests/win.c | 8 ++++----
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/dlls/user32/tests/text.c b/dlls/user32/tests/text.c
index df8d3ee..0352d66 100644
--- a/dlls/user32/tests/text.c
+++ b/dlls/user32/tests/text.c
@@ -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)
{
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index 4a09e39..44f0557 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -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",
--
2.5.0
More information about the wine-patches
mailing list