From 4b26eef83c8f5742fb19840391ab5d415ed5a7d9 Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Mon, 6 Jun 2016 11:15:14 +0200 Subject: [PATCH] user32/tests: Use EqualRect() instead of open coding it. Signed-off-by: Michael Stefaniuc Signed-off-by: Alexandre Julliard --- dlls/user32/tests/menu.c | 4 +--- dlls/user32/tests/msg.c | 3 +-- dlls/user32/tests/win.c | 16 ++++------------ 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/dlls/user32/tests/menu.c b/dlls/user32/tests/menu.c index e56cdc37845..250cba5db9c 100644 --- a/dlls/user32/tests/menu.c +++ b/dlls/user32/tests/menu.c @@ -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); diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 52cf901ca7a..5ab639b5151 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -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 ); diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 138a6f15cea..40685dc7857 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -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); -- 2.11.4.GIT