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

Alexandre Julliard julliard at winehq.org
Mon Nov 8 09:40:26 CST 2010


Austin Lund <austin.lund at gmail.com> writes:

> +#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 ); \

Please don't define huge macros like that.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list