user32/tests: Use wine_dbgstr_rect() to print RECTs.

Michael Stefaniuc mstefani at redhat.de
Wed Jul 6 01:57:04 CDT 2016


Signed-off-by: Michael Stefaniuc <mstefani at redhat.de>
---
Missed previously as the RECT fields are not specified in their natural
order.


 dlls/user32/tests/scroll.c | 21 ++++++---------------
 dlls/user32/tests/win.c    |  3 +--
 2 files changed, 7 insertions(+), 17 deletions(-)

diff --git a/dlls/user32/tests/scroll.c b/dlls/user32/tests/scroll.c
index 7691af3..0bda5dd 100644
--- a/dlls/user32/tests/scroll.c
+++ b/dlls/user32/tests/scroll.c
@@ -222,11 +222,8 @@ static void test_GetScrollBarInfo(void)
     ok( ret, "The GetWindowRect() call should not fail.\n" );
     ok( !(sbi.rgstate[0] & (STATE_SYSTEM_INVISIBLE|STATE_SYSTEM_OFFSCREEN)),
         "unexpected rgstate(0x%x)\n", sbi.rgstate[0]);
-    ok( EqualRect(&rect, &sbi.rcScrollBar),
-        "WindowRect(%d, %d, %d, %d) != rcScrollBar(%d, %d, %d, %d)\n",
-        rect.top, rect.left, rect.bottom, rect.right,
-        sbi.rcScrollBar.top, sbi.rcScrollBar.left,
-        sbi.rcScrollBar.bottom, sbi.rcScrollBar.right );
+    ok(EqualRect(&rect, &sbi.rcScrollBar), "WindowRect %s != rcScrollBar %s\n",
+       wine_dbgstr_rect(&rect), wine_dbgstr_rect(&sbi.rcScrollBar));
 
     /* Test windows horizontal and vertical scrollbar to make sure rcScrollBar
      * is still returned in screen coordinates by moving the window, and
@@ -243,11 +240,8 @@ static void test_GetScrollBarInfo(void)
     OffsetRect(&rect, 5, 5);
     ret = pGetScrollBarInfo( hMainWnd, OBJID_HSCROLL, &sbi);
     ok( ret, "The GetScrollBarInfo() call should not fail.\n" );
-    ok( EqualRect(&rect, &sbi.rcScrollBar),
-        "PreviousRect(%d, %d, %d, %d) != CurrentRect(%d, %d, %d, %d)\n",
-        rect.top, rect.left, rect.bottom, rect.right,
-        sbi.rcScrollBar.top, sbi.rcScrollBar.left,
-        sbi.rcScrollBar.bottom, sbi.rcScrollBar.right );
+    ok(EqualRect(&rect, &sbi.rcScrollBar), "PreviousRect %s != CurrentRect %s\n",
+       wine_dbgstr_rect(&rect), wine_dbgstr_rect(&sbi.rcScrollBar));
 
     sbi.cbSize = sizeof(sbi);
     ret = pGetScrollBarInfo( hMainWnd, OBJID_VSCROLL, &sbi);
@@ -260,11 +254,8 @@ static void test_GetScrollBarInfo(void)
     OffsetRect(&rect, 5, 5);
     ret = pGetScrollBarInfo( hMainWnd, OBJID_VSCROLL, &sbi);
     ok( ret, "The GetScrollBarInfo() call should not fail.\n" );
-    ok( EqualRect(&rect, &sbi.rcScrollBar),
-        "PreviousRect(%d, %d, %d, %d) != CurrentRect(%d, %d, %d, %d)\n",
-        rect.top, rect.left, rect.bottom, rect.right,
-        sbi.rcScrollBar.top, sbi.rcScrollBar.left,
-        sbi.rcScrollBar.bottom, sbi.rcScrollBar.right );
+    ok(EqualRect(&rect, &sbi.rcScrollBar), "PreviousRect %s != CurrentRect %s\n",
+       wine_dbgstr_rect(&rect), wine_dbgstr_rect(&sbi.rcScrollBar));
 
     DestroyWindow(hScroll);
     DestroyWindow(hMainWnd);
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index 8505983..7195102 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -2504,8 +2504,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(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);
+    ok(EqualRect(&rc1, &rc2), "%s != %s\n", wine_dbgstr_rect(&rc1), wine_dbgstr_rect(&rc2));
     check_active_state(hwnd2, hwnd2, hwnd2);
 
     ret = SetWindowPos(hwnd_desktop, hwnd_child, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
-- 
2.4.11



More information about the wine-patches mailing list