comctl32/tests: Fix some rebar tests on older comctl32 versions.

This commit is contained in:
Alexandre Julliard 2009-09-25 15:13:25 +02:00
parent 09f1ace555
commit ae2b8a6e97
1 changed files with 18 additions and 12 deletions

View File

@ -739,7 +739,7 @@ static void expect_band_content(UINT uBand, INT fStyle, COLORREF clrFore,
COLORREF clrBack, LPCSTR lpText, int iImage, HWND hwndChild, COLORREF clrBack, LPCSTR lpText, int iImage, HWND hwndChild,
INT cxMinChild, INT cyMinChild, INT cx, HBITMAP hbmBack, INT wID, INT cxMinChild, INT cyMinChild, INT cx, HBITMAP hbmBack, INT wID,
INT cyChild, INT cyMaxChild, INT cyIntegral, INT cxIdeal, LPARAM lParam, INT cyChild, INT cyMaxChild, INT cyIntegral, INT cxIdeal, LPARAM lParam,
INT cxHeader) INT cxHeader, INT cxHeader_broken)
{ {
CHAR buf[MAX_PATH] = "abc"; CHAR buf[MAX_PATH] = "abc";
REBARBANDINFOA rb; REBARBANDINFOA rb;
@ -769,7 +769,8 @@ static void expect_band_content(UINT uBand, INT fStyle, COLORREF clrFore,
expect_eq(rb.cyIntegral, cyIntegral, int, "%x"); expect_eq(rb.cyIntegral, cyIntegral, int, "%x");
expect_eq(rb.cxIdeal, cxIdeal, int, "%d"); expect_eq(rb.cxIdeal, cxIdeal, int, "%d");
expect_eq(rb.lParam, lParam, LPARAM, "%ld"); expect_eq(rb.lParam, lParam, LPARAM, "%ld");
expect_eq(rb.cxHeader, cxHeader, int, "%d"); ok( rb.cxHeader == cxHeader || broken(rb.cxHeader == cxHeader_broken),
"expected %d for %d\n", cxHeader, rb.cxHeader );
} }
static void bandinfo_test(void) static void bandinfo_test(void)
@ -781,8 +782,13 @@ static void bandinfo_test(void)
rebuild_rebar(&hRebar); rebuild_rebar(&hRebar);
rb.cbSize = REBARBANDINFOA_V6_SIZE; rb.cbSize = REBARBANDINFOA_V6_SIZE;
rb.fMask = 0; rb.fMask = 0;
ok(SendMessageA(hRebar, RB_INSERTBANDA, 0, (LPARAM)&rb), "RB_INSERTBAND failed\n"); if (!SendMessageA(hRebar, RB_INSERTBANDA, 0, (LPARAM)&rb))
expect_band_content(0, 0, 0, GetSysColor(COLOR_3DFACE), "", -1, NULL, 0, 0, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 0); {
win_skip( "V6 info not supported\n" );
DestroyWindow(hRebar);
return;
}
expect_band_content(0, 0, 0, GetSysColor(COLOR_3DFACE), "", -1, NULL, 0, 0, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 0, -1);
rb.fMask = RBBIM_CHILDSIZE; rb.fMask = RBBIM_CHILDSIZE;
rb.cxMinChild = 15; rb.cxMinChild = 15;
@ -791,37 +797,37 @@ static void bandinfo_test(void)
rb.cyMaxChild = 20; rb.cyMaxChild = 20;
rb.cyIntegral = 10; rb.cyIntegral = 10;
ok(SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rb), "RB_SETBANDINFO failed\n"); ok(SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rb), "RB_SETBANDINFO failed\n");
expect_band_content(0, 0, 0, GetSysColor(COLOR_3DFACE), "", -1, NULL, 15, 20, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 0); expect_band_content(0, 0, 0, GetSysColor(COLOR_3DFACE), "", -1, NULL, 15, 20, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 0, -1);
rb.fMask = RBBIM_TEXT; rb.fMask = RBBIM_TEXT;
rb.lpText = szABC; rb.lpText = szABC;
ok(SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rb), "RB_SETBANDINFO failed\n"); ok(SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rb), "RB_SETBANDINFO failed\n");
expect_band_content(0, 0, 0, GetSysColor(COLOR_3DFACE), "ABC", -1, NULL, 15, 20, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 35); expect_band_content(0, 0, 0, GetSysColor(COLOR_3DFACE), "ABC", -1, NULL, 15, 20, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 35, -1);
rb.cbSize = REBARBANDINFOA_V6_SIZE; rb.cbSize = REBARBANDINFOA_V6_SIZE;
rb.fMask = 0; rb.fMask = 0;
ok(SendMessageA(hRebar, RB_INSERTBANDA, 1, (LPARAM)&rb), "RB_INSERTBAND failed\n"); 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); expect_band_content(1, 0, 0, GetSysColor(COLOR_3DFACE), "", -1, NULL, 0, 0, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 9, -1);
expect_band_content(0, 0, 0, GetSysColor(COLOR_3DFACE), "ABC", -1, NULL, 15, 20, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 40); expect_band_content(0, 0, 0, GetSysColor(COLOR_3DFACE), "ABC", -1, NULL, 15, 20, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 40, -1);
rb.fMask = RBBIM_HEADERSIZE; rb.fMask = RBBIM_HEADERSIZE;
rb.cxHeader = 50; rb.cxHeader = 50;
ok(SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rb), "RB_SETBANDINFO failed\n"); ok(SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rb), "RB_SETBANDINFO failed\n");
expect_band_content(0, 0x40000000, 0, GetSysColor(COLOR_3DFACE), "ABC", -1, NULL, 15, 20, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 50); expect_band_content(0, 0x40000000, 0, GetSysColor(COLOR_3DFACE), "ABC", -1, NULL, 15, 20, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 50, -1);
rb.cxHeader = 5; rb.cxHeader = 5;
ok(SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rb), "RB_SETBANDINFO failed\n"); ok(SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rb), "RB_SETBANDINFO failed\n");
expect_band_content(0, 0x40000000, 0, GetSysColor(COLOR_3DFACE), "ABC", -1, NULL, 15, 20, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 5); expect_band_content(0, 0x40000000, 0, GetSysColor(COLOR_3DFACE), "ABC", -1, NULL, 15, 20, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 5, -1);
rb.fMask = RBBIM_TEXT; rb.fMask = RBBIM_TEXT;
rb.lpText = szABCD; rb.lpText = szABCD;
ok(SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rb), "RB_SETBANDINFO failed\n"); ok(SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rb), "RB_SETBANDINFO failed\n");
expect_band_content(0, 0x40000000, 0, GetSysColor(COLOR_3DFACE), "ABCD", -1, NULL, 15, 20, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 5); expect_band_content(0, 0x40000000, 0, GetSysColor(COLOR_3DFACE), "ABCD", -1, NULL, 15, 20, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 5, -1);
rb.fMask = RBBIM_STYLE | RBBIM_TEXT; rb.fMask = RBBIM_STYLE | RBBIM_TEXT;
rb.fStyle = RBBS_VARIABLEHEIGHT; rb.fStyle = RBBS_VARIABLEHEIGHT;
rb.lpText = szABC; rb.lpText = szABC;
ok(SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rb), "RB_SETBANDINFO failed\n"); ok(SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rb), "RB_SETBANDINFO failed\n");
expect_band_content(0, RBBS_VARIABLEHEIGHT, 0, GetSysColor(COLOR_3DFACE), "ABC", -1, NULL, 15, 20, 0, NULL, 0, 20, 0x7fffffff, 0, 0, 0, 40); expect_band_content(0, RBBS_VARIABLEHEIGHT, 0, GetSysColor(COLOR_3DFACE), "ABC", -1, NULL, 15, 20, 0, NULL, 0, 20, 0x7fffffff, 0, 0, 0, 40, 5);
DestroyWindow(hRebar); DestroyWindow(hRebar);
} }