[PATCH] comctl32/tests: Change expect_band_content test into a macro to ensure line numbers are reported correctly on test failure.

Austin Lund austin.lund at gmail.com
Mon Nov 8 04:29:31 CST 2010


---
 dlls/comctl32/tests/rebar.c |   69 ++++++++++++++++++++----------------------
 1 files changed, 33 insertions(+), 36 deletions(-)

diff --git a/dlls/comctl32/tests/rebar.c b/dlls/comctl32/tests/rebar.c
index 98fd4e5..cdcfb5a 100644
--- a/dlls/comctl32/tests/rebar.c
+++ b/dlls/comctl32/tests/rebar.c
@@ -746,42 +746,39 @@ static void test_resize(void)
     }
 }
 
-static void expect_band_content(HWND hRebar, UINT uBand, INT fStyle, COLORREF clrFore,
-    COLORREF clrBack, LPCSTR lpText, int iImage, HWND hwndChild,
-    INT cxMinChild, INT cyMinChild, INT cx, HBITMAP hbmBack, INT wID,
-    INT cyChild, INT cyMaxChild, INT cyIntegral, INT cxIdeal, LPARAM lParam,
-    INT cxHeader, INT cxHeader_broken)
-{
-    CHAR buf[MAX_PATH] = "abc";
-    REBARBANDINFOA rb;
-
-    memset(&rb, 0xdd, sizeof(rb));
-    rb.cbSize = REBARBANDINFOA_V6_SIZE;
-    rb.fMask = RBBIM_BACKGROUND | RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_COLORS
-        | RBBIM_HEADERSIZE | RBBIM_ID | RBBIM_IDEALSIZE | RBBIM_IMAGE | RBBIM_LPARAM
-        | RBBIM_SIZE | RBBIM_STYLE | RBBIM_TEXT;
-    rb.lpText = buf;
-    rb.cch = MAX_PATH;
-    ok(SendMessageA(hRebar, RB_GETBANDINFOA, uBand, (LPARAM)&rb), "RB_GETBANDINFO failed\n");
-    expect_eq(rb.fStyle, fStyle, int, "%x");
-    expect_eq(rb.clrFore, clrFore, COLORREF, "%x");
-    expect_eq(rb.clrBack, clrBack, COLORREF, "%x");
-    expect_eq(strcmp(rb.lpText, lpText), 0, int, "%d");
-    expect_eq(rb.iImage, iImage, int, "%x");
-    expect_eq(rb.hwndChild, hwndChild, HWND, "%p");
-    expect_eq(rb.cxMinChild, cxMinChild, int, "%d");
-    expect_eq(rb.cyMinChild, cyMinChild, int, "%d");
-    expect_eq(rb.cx, cx, int, "%d");
-    expect_eq(rb.hbmBack, hbmBack, HBITMAP, "%p");
-    expect_eq(rb.wID, wID, int, "%d");
-    /* the values of cyChild, cyMaxChild and cyIntegral can't be read unless the band is RBBS_VARIABLEHEIGHT */
-    expect_eq(rb.cyChild, cyChild, int, "%x");
-    expect_eq(rb.cyMaxChild, cyMaxChild, int, "%x");
-    expect_eq(rb.cyIntegral, cyIntegral, int, "%x");
-    expect_eq(rb.cxIdeal, cxIdeal, int, "%d");
-    expect_eq(rb.lParam, lParam, LPARAM, "%ld");
-    ok( rb.cxHeader == cxHeader || broken(rb.cxHeader == cxHeader_broken),
-        "expected %d for %d\n", cxHeader, rb.cxHeader );
+#define expect_band_content(hRebar, uBand, fStylep, clrForep, clrBackp, \
+ lpTextp, iImagep, hwndChildp, cxMinChildp, cyMinChildp, cxp, hbmBackp, \
+ wIDp, cyChildp, cyMaxChildp, cyIntegralp, cxIdealp, lParamp, cxHeaderp, cxHeader_brokenp) \
+{ \
+    CHAR buf[MAX_PATH] = "abc"; \
+    REBARBANDINFOA rb; \
+    memset(&rb, 0xdd, sizeof(rb)); \
+    rb.cbSize = REBARBANDINFOA_V6_SIZE; \
+    rb.fMask = RBBIM_BACKGROUND | RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_COLORS \
+        | RBBIM_HEADERSIZE | RBBIM_ID | RBBIM_IDEALSIZE | RBBIM_IMAGE | RBBIM_LPARAM \
+        | RBBIM_SIZE | RBBIM_STYLE | RBBIM_TEXT; \
+    rb.lpText = buf; \
+    rb.cch = MAX_PATH; \
+    ok(SendMessageA(hRebar, RB_GETBANDINFOA, uBand, (LPARAM)&rb), "RB_GETBANDINFO failed\n"); \
+    expect_eq(rb.fStyle, fStylep, int, "%x"); \
+    expect_eq(rb.clrFore, clrForep, COLORREF, "%x"); \
+    expect_eq(rb.clrBack, clrBackp, COLORREF, "%x"); \
+    expect_eq(strcmp(rb.lpText, lpTextp), 0, int, "%d"); \
+    expect_eq(rb.iImage, iImagep, int, "%x"); \
+    expect_eq(rb.hwndChild, hwndChildp, HWND, "%p"); \
+    expect_eq(rb.cxMinChild, cxMinChildp, int, "%d"); \
+    expect_eq(rb.cyMinChild, cyMinChildp, int, "%d"); \
+    expect_eq(rb.cx, cxp, int, "%d"); \
+    expect_eq(rb.hbmBack, hbmBackp, HBITMAP, "%p"); \
+    expect_eq(rb.wID, wIDp, int, "%d"); \
+    /* the values of cyChild, cyMaxChild and cyIntegral can't be read unless the band is RBBS_VARIABLEHEIGHT */ \
+    expect_eq(rb.cyChild, cyChildp, int, "%x"); \
+    expect_eq(rb.cyMaxChild, cyMaxChildp, int, "%x"); \
+    expect_eq(rb.cyIntegral, cyIntegralp, int, "%x"); \
+    expect_eq(rb.cxIdeal, cxIdealp, int, "%d"); \
+    expect_eq(rb.lParam, (LPARAM)lParamp, LPARAM, "%ld"); \
+    ok( rb.cxHeader == cxHeaderp || broken(rb.cxHeader == cxHeader_brokenp), \
+        "expected %d for %d\n", cxHeaderp, rb.cxHeader ); \
 }
 
 static void test_bandinfo(void)
-- 
1.7.1




More information about the wine-patches mailing list