user32/tests: Use EqualRect() 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-06-06 11:15:14 +02:00 committed by Alexandre Julliard
parent fe9f23a2cb
commit 4b26eef83c
3 changed files with 6 additions and 17 deletions

View File

@ -393,9 +393,7 @@ static void test_getmenubarinfo(void)
ok(ret, "GetMenuBarInfo failed with error %d\n", GetLastError());
ret = GetMenuItemRect(hwnd, hmenu, 1, &rci);
ok(ret, "GetMenuItemRect failed.\n");
ok(mbi.rcBar.left == rci.left && mbi.rcBar.top == rci.top &&
mbi.rcBar.bottom == rci.bottom && mbi.rcBar.right == rci.right,
"rcBar: Got %d,%d-%d,%d instead of %d,%d-%d,%d\n",
ok(EqualRect(&mbi.rcBar, &rci), "rcBar: Got %d,%d-%d,%d instead of %d,%d-%d,%d\n",
mbi.rcBar.left, mbi.rcBar.top, mbi.rcBar.right, mbi.rcBar.bottom,
rci.left, rci.top, rci.right, rci.bottom);
ok(mbi.hMenu == hmenu, "hMenu: Got %p instead of %p\n", mbi.hMenu, hmenu);

View File

@ -6499,8 +6499,7 @@ static void check_update_rgn( HWND hwnd, HRGN hrgn )
}
GetRgnBox( update, &r1 );
GetUpdateRect( hwnd, &r2, FALSE );
ok( r1.left == r2.left && r1.top == r2.top && r1.right == r2.right && r1.bottom == r2.bottom,
"Rectangles are different: %d,%d-%d,%d / %d,%d-%d,%d\n",
ok( EqualRect( &r1, &r2 ), "Rectangles are different: %d,%d-%d,%d / %d,%d-%d,%d\n",
r1.left, r1.top, r1.right, r1.bottom, r2.left, r2.top, r2.right, r2.bottom );
DeleteObject( tmp );

View File

@ -2461,9 +2461,7 @@ static void test_SetWindowPos(HWND hwnd, HWND hwnd2)
ret = SetWindowPos(hwnd_child, hwnd2 , 1, 2, 3, 4, 0);
ok(ret, "Got %d\n", ret);
GetWindowRect(hwnd_child, &rc2);
ok(rc1.left == rc2.left && rc1.top == rc2.top &&
rc1.right == rc2.right && rc1.bottom == rc2.bottom,
"(%d, %d, %d, %d) != (%d, %d, %d, %d)\n",
ok(EqualRect(&rc1, &rc2), "(%d, %d, %d, %d) != (%d, %d, %d, %d)\n",
rc1.left, rc1.top, rc1.right, rc1.bottom, rc2.left, rc2.top, rc2.right, rc2.bottom);
check_active_state(hwnd2, hwnd2, hwnd2);
@ -2472,9 +2470,7 @@ static void test_SetWindowPos(HWND hwnd, HWND hwnd2)
ret = SetWindowPos(hwnd2, hwnd_child, 1, 2, 3, 4, 0);
ok(ret, "Got %d\n", ret);
GetWindowRect(hwnd2, &rc2);
ok(rc1.left == rc2.left && rc1.top == rc2.top &&
rc1.right == rc2.right && rc1.bottom == rc2.bottom,
"(%d, %d, %d, %d) != (%d, %d, %d, %d)\n",
ok(EqualRect(&rc1, &rc2), "(%d, %d, %d, %d) != (%d, %d, %d, %d)\n",
rc1.left, rc1.top, rc1.right, rc1.bottom, rc2.left, rc2.top, rc2.right, rc2.bottom);
check_active_state(hwnd2, hwnd2, hwnd2);
@ -2483,9 +2479,7 @@ static void test_SetWindowPos(HWND hwnd, HWND hwnd2)
ret = SetWindowPos(hwnd_grandchild, hwnd_child2, 1, 2, 3, 4, 0);
ok(ret, "Got %d\n", ret);
GetWindowRect(hwnd_grandchild, &rc2);
ok(rc1.left == rc2.left && rc1.top == rc2.top &&
rc1.right == rc2.right && rc1.bottom == rc2.bottom,
"(%d, %d, %d, %d) != (%d, %d, %d, %d)\n",
ok(EqualRect(&rc1, &rc2), "(%d, %d, %d, %d) != (%d, %d, %d, %d)\n",
rc1.left, rc1.top, rc1.right, rc1.bottom, rc2.left, rc2.top, rc2.right, rc2.bottom);
check_active_state(hwnd2, hwnd2, hwnd2);
@ -2520,9 +2514,7 @@ static void test_SetWindowPos(HWND hwnd, HWND hwnd2)
ret = SetWindowPos(hwnd_child, hwnd_desktop, 0, 0, 0, 0, 0);
ok(!ret, "Got %d\n", ret);
GetWindowRect(hwnd_child, &rc2);
ok(rc1.top == rc2.top && rc1.left == rc2.left &&
rc1.bottom == rc2.bottom && rc1.right == rc2.right,
"(%d, %d, %d, %d) != (%d, %d, %d, %d)\n",
ok(EqualRect(&rc1, &rc2), "(%d, %d, %d, %d) != (%d, %d, %d, %d)\n",
rc1.top, rc1.left, rc1.bottom, rc1.right, rc2.top, rc2.left, rc2.bottom, rc2.right);
check_active_state(hwnd2, hwnd2, hwnd2);