Michael Stefaniuc : comctl32/tests: Use wine_dbgstr_rect() to print RECTs.

Alexandre Julliard julliard at winehq.org
Wed Jun 8 11:07:36 CDT 2016


Module: wine
Branch: master
Commit: 96185e23b4ed64d89a420eb5bc6ba49926dde201
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=96185e23b4ed64d89a420eb5bc6ba49926dde201

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Wed Jun  8 12:28:46 2016 +0200

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

Signed-off-by: Michael Stefaniuc <mstefani at redhat.de>
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/comctl32/tests/header.c   |  4 ++--
 dlls/comctl32/tests/progress.c | 12 ++++--------
 dlls/comctl32/tests/rebar.c    |  9 ++++-----
 dlls/comctl32/tests/status.c   |  5 ++---
 dlls/comctl32/tests/toolbar.c  |  4 ++--
 5 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/dlls/comctl32/tests/header.c b/dlls/comctl32/tests/header.c
index c828465..5c35b60 100644
--- a/dlls/comctl32/tests/header.c
+++ b/dlls/comctl32/tests/header.c
@@ -1350,8 +1350,8 @@ static void test_hds_nosizing(HWND hParent)
     ok(nm->lItemlParam == lparam, "Invalid lItemlParam %d vs %ld\n", lparam, nm->lItemlParam); \
     ok((nm->rc.top == _top && nm->rc.bottom == _bottom && nm->rc.left == _left && nm->rc.right == _right) || \
         broken(draw_stage != CDDS_ITEMPREPAINT), /* comctl32 < 5.80 */ \
-        "Invalid rect (%d,%d) (%d,%d) vs (%d,%d) (%d,%d)\n", _left, _top, _right, _bottom, \
-        nm->rc.left, nm->rc.top, nm->rc.right, nm->rc.bottom);
+        "Invalid rect (%d,%d)-(%d,%d) vs %s\n", _left, _top, _right, _bottom, \
+        wine_dbgstr_rect(&nm->rc));
 
 static LRESULT customdraw_1(int n, NMCUSTOMDRAW *nm)
 {
diff --git a/dlls/comctl32/tests/progress.c b/dlls/comctl32/tests/progress.c
index f7ae328..7f69c35 100644
--- a/dlls/comctl32/tests/progress.c
+++ b/dlls/comctl32/tests/progress.c
@@ -206,10 +206,8 @@ static void test_redraw(void)
     SetRectEmpty(&last_paint_rect);
     SendMessageA(hProgressWnd, PBM_SETPOS, 10, 0);
     GetClientRect(hProgressWnd, &client_rect);
-    ok(EqualRect(&last_paint_rect, &client_rect),
-       "last_paint_rect was { %d, %d, %d, %d } instead of { %d, %d, %d, %d }\n",
-       last_paint_rect.left, last_paint_rect.top, last_paint_rect.right, last_paint_rect.bottom,
-       client_rect.left, client_rect.top, client_rect.right, client_rect.bottom);
+    ok(EqualRect(&last_paint_rect, &client_rect), "last_paint_rect was %s instead of %s\n",
+       wine_dbgstr_rect(&last_paint_rect), wine_dbgstr_rect(&client_rect));
     update_window(hProgressWnd);
     ok(!erased, "Progress bar shouldn't have erased the background\n");
 
@@ -218,10 +216,8 @@ static void test_redraw(void)
     SetRectEmpty(&last_paint_rect);
     SendMessageA(hProgressWnd, PBM_SETPOS, 0, 0);
     GetClientRect(hProgressWnd, &client_rect);
-    ok(EqualRect(&last_paint_rect, &client_rect),
-       "last_paint_rect was { %d, %d, %d, %d } instead of { %d, %d, %d, %d }\n",
-       last_paint_rect.left, last_paint_rect.top, last_paint_rect.right, last_paint_rect.bottom,
-       client_rect.left, client_rect.top, client_rect.right, client_rect.bottom);
+    ok(EqualRect(&last_paint_rect, &client_rect), "last_paint_rect was %s instead of %s\n",
+       wine_dbgstr_rect(&last_paint_rect), wine_dbgstr_rect(&client_rect));
     update_window(hProgressWnd);
     ok(erased, "Progress bar should have erased the background\n");
 }
diff --git a/dlls/comctl32/tests/rebar.c b/dlls/comctl32/tests/rebar.c
index 0c3e2dd..6430ba2 100644
--- a/dlls/comctl32/tests/rebar.c
+++ b/dlls/comctl32/tests/rebar.c
@@ -36,14 +36,13 @@ static int system_font_height;
 
 
 #define check_rect(name, val, exp) ok(EqualRect(&val, &exp), \
-    "invalid rect (" name ") (%d,%d) (%d,%d) - expected (%d,%d) (%d,%d)\n", \
-    val.left, val.top, val.right, val.bottom, exp.left, exp.top, exp.right, exp.bottom);
+    "invalid rect (" name ") %s - expected %s\n", wine_dbgstr_rect(&val), wine_dbgstr_rect(&exp));
 
 #define check_rect_no_top(name, val, exp) { \
         ok((val.bottom - val.top == exp.bottom - exp.top) && \
-            val.left == exp.left && val.right == exp.right, "invalid rect (" name ") (%d,%d) (%d,%d) - expected (%d,%d) (%d,%d), ignoring top\n", \
-            val.left, val.top, val.right, val.bottom, exp.left, exp.top, exp.right, exp.bottom); \
-    }
+            val.left == exp.left && val.right == exp.right, \
+            "invalid rect (" name ") %s - expected %s, ignoring top\n", \
+            wine_dbgstr_rect(&val), wine_dbgstr_rect(&exp)); }
 
 #define compare(val, exp, format) ok((val) == (exp), #val " value " format " expected " format "\n", (val), (exp));
 
diff --git a/dlls/comctl32/tests/status.c b/dlls/comctl32/tests/status.c
index f537fe0..fa0d970 100644
--- a/dlls/comctl32/tests/status.c
+++ b/dlls/comctl32/tests/status.c
@@ -30,9 +30,8 @@
         RECT exp = {abs(got.left - _left), abs(got.top - _top), \
                     abs(got.right - _right), abs(got.bottom - _bottom)}; \
         ok(exp.left <= 2 && exp.top <= 2 && exp.right <= 2 && exp.bottom <= 2, \
-           "Expected rect {%d,%d, %d,%d}, got {%d,%d, %d,%d}\n", \
-           _left, _top, _right, _bottom, \
-           (got).left, (got).top, (got).right, (got).bottom); } while (0)
+           "Expected rect (%d,%d)-(%d,%d), got %s\n", _left, _top, _right, _bottom, \
+           wine_dbgstr_rect(&(got))); } while (0)
 
 static HINSTANCE hinst;
 static WNDPROC g_status_wndproc;
diff --git a/dlls/comctl32/tests/toolbar.c b/dlls/comctl32/tests/toolbar.c
index 01c4214..d825e18 100644
--- a/dlls/comctl32/tests/toolbar.c
+++ b/dlls/comctl32/tests/toolbar.c
@@ -109,8 +109,8 @@ static const struct message restore_parent_seq[] = {
 #define expect(EXPECTED,GOT) ok((GOT)==(EXPECTED), "Expected %d, got %d\n", (EXPECTED), (GOT))
 
 #define check_rect(name, val, exp, ...) ok(EqualRect(&val, &exp), \
-    "invalid rect (%d,%d) (%d,%d) - expected (%d,%d) (%d,%d) - (" name ")\n", \
-    val.left, val.top, val.right, val.bottom, exp.left, exp.top, exp.right, exp.bottom, __VA_ARGS__);
+    "invalid rect %s - expected %s - (" name ")\n", \
+    wine_dbgstr_rect(&val), wine_dbgstr_rect(&exp), __VA_ARGS__);
  
 #define compare(val, exp, format) ok((val) == (exp), #val " value " format " expected " format "\n", (val), (exp));
 




More information about the wine-cvs mailing list