From 4ecd206f61c0427d1c65ee40d3e403cb0f71fcc7 Mon Sep 17 00:00:00 2001 From: Sergey Khodych Date: Wed, 3 Jun 2009 12:41:19 +0300 Subject: comctl32:rebar: Add more tests for rebar band text. --- dlls/comctl32/tests/rebar.c | 30 +++++++++++++++++++++++++++++- 1 files changed, 29 insertions(+), 1 deletions(-) diff --git a/dlls/comctl32/tests/rebar.c b/dlls/comctl32/tests/rebar.c index 5cc47a0..a376104 100644 --- a/dlls/comctl32/tests/rebar.c +++ b/dlls/comctl32/tests/rebar.c @@ -757,6 +757,11 @@ static void resize_test(void) } } +static BOOL strdif( LPCSTR a, LPCSTR b ) +{ + return ( (a && !b) || (b && !a) || (a && b && lstrcmp(a, b) ) ); +} + static void expect_band_content(UINT uBand, INT fStyle, COLORREF clrFore, COLORREF clrBack, LPCSTR lpText, int iImage, HWND hwndChild, INT cxMinChild, INT cyMinChild, INT cx, HBITMAP hbmBack, INT wID, @@ -777,7 +782,7 @@ static void expect_band_content(UINT uBand, INT fStyle, COLORREF clrFore, expect_eq(rb.fStyle, fStyle, int, "%x"); todo_wine expect_eq(rb.clrFore, clrFore, COLORREF, "%x"); todo_wine expect_eq(rb.clrBack, clrBack, unsigned, "%x"); - expect_eq(strcmp(rb.lpText, lpText), 0, int, "%d"); + expect_eq(strdif(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"); @@ -799,6 +804,29 @@ static void bandinfo_test(void) REBARBANDINFOA rb; CHAR szABC[] = "ABC"; CHAR szABCD[] = "ABCD"; + CHAR szEmpty[] = ""; + + rebuild_rebar(&hRebar); + rb.cbSize = sizeof(REBARBANDINFO); + rb.fMask = RBBIM_TEXT; + rb.lpText = NULL; + ok(SendMessageA(hRebar, RB_INSERTBANDA, 0, (LPARAM)&rb), "RB_INSERTBAND failed\n"); + expect_band_content(0, 0, 0, GetSysColor(COLOR_3DFACE), "", -1, NULL, 0, 0, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 0); + + rb.fMask = RBBIM_TEXT; + rb.lpText = szEmpty; + ok(SendMessageA(hRebar, RB_INSERTBANDA, 1, (LPARAM)&rb), "RB_INSERTBAND failed\n"); + expect_band_content(1, 0, 0, GetSysColor(COLOR_3DFACE), "", -1, NULL, 0, 0, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 9); + + rb.fMask = RBBIM_TEXT; + rb.lpText = szEmpty; + ok(SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rb), "RB_SETBANDINFO failed\n"); + expect_band_content(0, 0, 0, GetSysColor(COLOR_3DFACE), "", -1, NULL, 0, 0, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 9); + + rb.fMask = RBBIM_TEXT; + rb.lpText = NULL; + ok(SendMessageA(hRebar, RB_SETBANDINFOA, 1, (LPARAM)&rb), "RB_SETBANDINFO failed\n"); + expect_band_content(1, 0, 0, GetSysColor(COLOR_3DFACE), "", -1, NULL, 0, 0, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 9); rebuild_rebar(&hRebar); rb.cbSize = sizeof(REBARBANDINFO); -- 1.5.3.3