Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/comctl32/tests/button.c | 10 ++-------- dlls/comctl32/tests/v6util.h | 43 +++++++------------------------------------ 2 files changed, 9 insertions(+), 44 deletions(-)
diff --git a/dlls/comctl32/tests/button.c b/dlls/comctl32/tests/button.c index 41cf165ad9..441ca581c5 100644 --- a/dlls/comctl32/tests/button.c +++ b/dlls/comctl32/tests/button.c @@ -54,20 +54,14 @@ struct wndclass_redirect_data /* returned pointer is valid as long as activation context is alive */ static WCHAR* get_versioned_classname(const WCHAR *name) { - BOOL (WINAPI *pFindActCtxSectionStringW)(DWORD,const GUID *,ULONG,LPCWSTR,PACTCTX_SECTION_KEYED_DATA); struct wndclass_redirect_data *wnddata; ACTCTX_SECTION_KEYED_DATA data; BOOL ret;
- pFindActCtxSectionStringW = (void*)GetProcAddress(GetModuleHandleA("kernel32"), "FindActCtxSectionStringW"); - memset(&data, 0, sizeof(data)); data.cbSize = sizeof(data); - - ret = pFindActCtxSectionStringW(0, NULL, - ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, - name, &data); - ok(ret, "got %d, error %u\n", ret, GetLastError()); + ret = FindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, name, &data); + ok(ret, "Failed to find class redirection section, error %u\n", GetLastError()); wnddata = (struct wndclass_redirect_data*)data.lpData; return (WCHAR*)((BYTE*)wnddata + wnddata->name_offset); } diff --git a/dlls/comctl32/tests/v6util.h b/dlls/comctl32/tests/v6util.h index 9f5a9c48da..afdc12c65a 100644 --- a/dlls/comctl32/tests/v6util.h +++ b/dlls/comctl32/tests/v6util.h @@ -62,48 +62,19 @@ static const CHAR manifest[] =
static void unload_v6_module(ULONG_PTR cookie, HANDLE hCtx) { - HANDLE hKernel32; - BOOL (WINAPI *pDeactivateActCtx)(DWORD, ULONG_PTR); - VOID (WINAPI *pReleaseActCtx)(HANDLE); - - hKernel32 = GetModuleHandleA("kernel32.dll"); - pDeactivateActCtx = (void*)GetProcAddress(hKernel32, "DeactivateActCtx"); - pReleaseActCtx = (void*)GetProcAddress(hKernel32, "ReleaseActCtx"); - if (!pDeactivateActCtx || !pReleaseActCtx) - { - win_skip("Activation contexts unsupported\n"); - return; - } - - pDeactivateActCtx(0, cookie); - pReleaseActCtx(hCtx); + DeactivateActCtx(0, cookie); + ReleaseActCtx(hCtx);
DeleteFileA(manifest_name); }
static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx) { - HANDLE hKernel32; - HANDLE (WINAPI *pCreateActCtxA)(ACTCTXA*); - BOOL (WINAPI *pActivateActCtx)(HANDLE, ULONG_PTR*); - BOOL (WINAPI *pFindActCtxSectionStringA)(DWORD,const GUID *,ULONG,LPCSTR,PACTCTX_SECTION_KEYED_DATA); - ACTCTX_SECTION_KEYED_DATA data; - + DWORD written; ACTCTXA ctx; - BOOL ret; HANDLE file; - DWORD written; - - hKernel32 = GetModuleHandleA("kernel32.dll"); - pCreateActCtxA = (void*)GetProcAddress(hKernel32, "CreateActCtxA"); - pActivateActCtx = (void*)GetProcAddress(hKernel32, "ActivateActCtx"); - pFindActCtxSectionStringA = (void*)GetProcAddress(hKernel32, "FindActCtxSectionStringA"); - if (!(pCreateActCtxA && pActivateActCtx)) - { - win_skip("Activation contexts unsupported. No version 6 tests possible.\n"); - return FALSE; - } + BOOL ret;
/* create manifest */ file = CreateFileA( manifest_name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL ); @@ -131,10 +102,10 @@ static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx) ctx.cbSize = sizeof(ctx); ctx.lpSource = manifest_name;
- *hCtx = pCreateActCtxA(&ctx); + *hCtx = CreateActCtxA(&ctx); ok(*hCtx != 0, "Expected context handle\n");
- ret = pActivateActCtx(*hCtx, pcookie); + ret = ActivateActCtx(*hCtx, pcookie); expect(TRUE, ret);
if (!ret) @@ -144,7 +115,7 @@ static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx) }
data.cbSize = sizeof(data); - ret = pFindActCtxSectionStringA(0, NULL, ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, + ret = FindActCtxSectionStringA(0, NULL, ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "comctl32.dll", &data); ok(ret, "failed to find comctl32.dll in active context, %u\n", GetLastError()); if (ret)
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/comctl32/tests/v6util.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/dlls/comctl32/tests/v6util.h b/dlls/comctl32/tests/v6util.h index afdc12c65a..b78290a50a 100644 --- a/dlls/comctl32/tests/v6util.h +++ b/dlls/comctl32/tests/v6util.h @@ -20,8 +20,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#define expect(expected, got) ok(got == expected, "Expected %d, got %d\n", expected, got) - #ifdef __i386__ #define ARCH "x86" #elif defined __x86_64__ @@ -106,7 +104,7 @@ static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx) ok(*hCtx != 0, "Expected context handle\n");
ret = ActivateActCtx(*hCtx, pcookie); - expect(TRUE, ret); + ok(ret, "Failed to activate context, error %d.\n", GetLastError());
if (!ret) { @@ -124,5 +122,4 @@ static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx) return ret; }
-#undef expect #undef ARCH
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/comctl32/tests/imagelist.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/dlls/comctl32/tests/imagelist.c b/dlls/comctl32/tests/imagelist.c index d72e22a6b3..958c82f7f7 100644 --- a/dlls/comctl32/tests/imagelist.c +++ b/dlls/comctl32/tests/imagelist.c @@ -1029,12 +1029,22 @@ static void check_iml_data(HIMAGELIST himl, INT cx, INT cy, INT cur, INT max, IN cleanup_memstream(&stream); }
-static void image_list_init(HIMAGELIST himl) +static void image_list_add_bitmap(HIMAGELIST himl, BYTE grey, int i) { - HBITMAP hbm; char comment[16]; - INT n = 1; - DWORD i; + HBITMAP hbm; + int ret; + + sprintf(comment, "%d", i); + hbm = create_bitmap(BMP_CX, BMP_CX, RGB(grey, grey, grey), comment); + ret = pImageList_Add(himl, hbm, NULL); + ok(ret != -1, "Failed to add image to imagelist.\n"); + DeleteObject(hbm); +} + +static void image_list_init(HIMAGELIST himl) +{ + unsigned int i; static const struct test_data { BYTE grey; @@ -1070,18 +1080,11 @@ static void image_list_init(HIMAGELIST himl)
check_iml_data(himl, BMP_CX, BMP_CX, 0, 2, 4, ILC_COLOR24, "total 0");
-#define add_bitmap(grey) \ - sprintf(comment, "%d", n++); \ - hbm = create_bitmap(BMP_CX, BMP_CX, RGB((grey),(grey),(grey)), comment); \ - ImageList_Add(himl, hbm, NULL); \ - DeleteObject(hbm); - for (i = 0; i < sizeof(td)/sizeof(td[0]); i++) { - add_bitmap(td[i].grey); + image_list_add_bitmap(himl, td[i].grey, i + 1); check_iml_data(himl, td[i].cx, td[i].cy, td[i].cur, td[i].max, td[i].grow, td[i].bpp, td[i].comment); } -#undef add_bitmap }
static void test_imagelist_storage(void)
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/comctl32/tests/imagelist.c | 152 +++++++++++++++++++++++----------------- 1 file changed, 88 insertions(+), 64 deletions(-)
diff --git a/dlls/comctl32/tests/imagelist.c b/dlls/comctl32/tests/imagelist.c index 958c82f7f7..653467c999 100644 --- a/dlls/comctl32/tests/imagelist.c +++ b/dlls/comctl32/tests/imagelist.c @@ -898,16 +898,30 @@ static BOOL is_v6_header(const ILHEAD *header)
static void check_ilhead_data(const ILHEAD *ilh, INT cx, INT cy, INT cur, INT max, INT grow, INT flags) { + INT grow_aligned; + ok(ilh->usMagic == IMAGELIST_MAGIC, "wrong usMagic %4x (expected %02x)\n", ilh->usMagic, IMAGELIST_MAGIC); ok(ilh->usVersion == 0x101 || ilh->usVersion == 0x600 || /* WinXP/W2k3 */ ilh->usVersion == 0x620, "Unknown usVersion %#x.\n", ilh->usVersion); ok(ilh->cCurImage == cur, "wrong cCurImage %d (expected %d)\n", ilh->cCurImage, cur); - if (!is_v6_header(ilh)) + + grow = max(grow, 1); + grow_aligned = (WORD)(grow + 3) & ~3; + + if (is_v6_header(ilh)) { + grow = (WORD)(grow + 2 + 3) & ~3; + ok(ilh->cGrow == grow || broken(ilh->cGrow == grow_aligned) /* XP/Vista */, + "Unexpected cGrow %d, expected %d\n", ilh->cGrow, grow); + } + else + { + grow = (WORD)(grow + 3) & ~3; ok(ilh->cMaxImage == max, "wrong cMaxImage %d (expected %d)\n", ilh->cMaxImage, max); - ok(ilh->cGrow == grow, "Unexpected cGrow %d (expected %d)\n", ilh->cGrow, grow); + ok(ilh->cGrow == grow_aligned, "Unexpected cGrow %d, expected %d\n", ilh->cGrow, grow_aligned); } + ok(ilh->cx == cx, "wrong cx %d (expected %d)\n", ilh->cx, cx); ok(ilh->cy == cy, "wrong cy %d (expected %d)\n", ilh->cy, cy); ok(ilh->bkcolor == CLR_NONE, "wrong bkcolor %x\n", ilh->bkcolor); @@ -968,6 +982,7 @@ static inline void imagelist_get_bitmap_size(const ILHEAD *header, SIZE *sz) } }
+/* Grow argument matches what was used when imagelist was created. */ static void check_iml_data(HIMAGELIST himl, INT cx, INT cy, INT cur, INT max, INT grow, INT flags, const char *comment) { @@ -1042,93 +1057,93 @@ static void image_list_add_bitmap(HIMAGELIST himl, BYTE grey, int i) DeleteObject(hbm); }
-static void image_list_init(HIMAGELIST himl) +static void image_list_init(HIMAGELIST himl, INT grow) { unsigned int i; static const struct test_data { BYTE grey; - INT cx, cy, cur, max, grow, bpp; + INT cx, cy, cur, max, bpp; const char *comment; } td[] = { - { 255, BMP_CX, BMP_CX, 1, 2, 4, 24, "total 1" }, - { 170, BMP_CX, BMP_CX, 2, 7, 4, 24, "total 2" }, - { 85, BMP_CX, BMP_CX, 3, 7, 4, 24, "total 3" }, - { 0, BMP_CX, BMP_CX, 4, 7, 4, 24, "total 4" }, - { 0, BMP_CX, BMP_CX, 5, 7, 4, 24, "total 5" }, - { 85, BMP_CX, BMP_CX, 6, 7, 4, 24, "total 6" }, - { 170, BMP_CX, BMP_CX, 7, 12, 4, 24, "total 7" }, - { 255, BMP_CX, BMP_CX, 8, 12, 4, 24, "total 8" }, - { 255, BMP_CX, BMP_CX, 9, 12, 4, 24, "total 9" }, - { 170, BMP_CX, BMP_CX, 10, 12, 4, 24, "total 10" }, - { 85, BMP_CX, BMP_CX, 11, 12, 4, 24, "total 11" }, - { 0, BMP_CX, BMP_CX, 12, 17, 4, 24, "total 12" }, - { 0, BMP_CX, BMP_CX, 13, 17, 4, 24, "total 13" }, - { 85, BMP_CX, BMP_CX, 14, 17, 4, 24, "total 14" }, - { 170, BMP_CX, BMP_CX, 15, 17, 4, 24, "total 15" }, - { 255, BMP_CX, BMP_CX, 16, 17, 4, 24, "total 16" }, - { 255, BMP_CX, BMP_CX, 17, 22, 4, 24, "total 17" }, - { 170, BMP_CX, BMP_CX, 18, 22, 4, 24, "total 18" }, - { 85, BMP_CX, BMP_CX, 19, 22, 4, 24, "total 19" }, - { 0, BMP_CX, BMP_CX, 20, 22, 4, 24, "total 20" }, - { 0, BMP_CX, BMP_CX, 21, 22, 4, 24, "total 21" }, - { 85, BMP_CX, BMP_CX, 22, 27, 4, 24, "total 22" }, - { 170, BMP_CX, BMP_CX, 23, 27, 4, 24, "total 23" }, - { 255, BMP_CX, BMP_CX, 24, 27, 4, 24, "total 24" } + { 255, BMP_CX, BMP_CX, 1, 2, 24, "total 1" }, + { 170, BMP_CX, BMP_CX, 2, 7, 24, "total 2" }, + { 85, BMP_CX, BMP_CX, 3, 7, 24, "total 3" }, + { 0, BMP_CX, BMP_CX, 4, 7, 24, "total 4" }, + { 0, BMP_CX, BMP_CX, 5, 7, 24, "total 5" }, + { 85, BMP_CX, BMP_CX, 6, 7, 24, "total 6" }, + { 170, BMP_CX, BMP_CX, 7, 12, 24, "total 7" }, + { 255, BMP_CX, BMP_CX, 8, 12, 24, "total 8" }, + { 255, BMP_CX, BMP_CX, 9, 12, 24, "total 9" }, + { 170, BMP_CX, BMP_CX, 10, 12, 24, "total 10" }, + { 85, BMP_CX, BMP_CX, 11, 12, 24, "total 11" }, + { 0, BMP_CX, BMP_CX, 12, 17, 24, "total 12" }, + { 0, BMP_CX, BMP_CX, 13, 17, 24, "total 13" }, + { 85, BMP_CX, BMP_CX, 14, 17, 24, "total 14" }, + { 170, BMP_CX, BMP_CX, 15, 17, 24, "total 15" }, + { 255, BMP_CX, BMP_CX, 16, 17, 24, "total 16" }, + { 255, BMP_CX, BMP_CX, 17, 22, 24, "total 17" }, + { 170, BMP_CX, BMP_CX, 18, 22, 24, "total 18" }, + { 85, BMP_CX, BMP_CX, 19, 22, 24, "total 19" }, + { 0, BMP_CX, BMP_CX, 20, 22, 24, "total 20" }, + { 0, BMP_CX, BMP_CX, 21, 22, 24, "total 21" }, + { 85, BMP_CX, BMP_CX, 22, 27, 24, "total 22" }, + { 170, BMP_CX, BMP_CX, 23, 27, 24, "total 23" }, + { 255, BMP_CX, BMP_CX, 24, 27, 24, "total 24" } };
- check_iml_data(himl, BMP_CX, BMP_CX, 0, 2, 4, ILC_COLOR24, "total 0"); + check_iml_data(himl, BMP_CX, BMP_CX, 0, 2, grow, ILC_COLOR24, "total 0");
for (i = 0; i < sizeof(td)/sizeof(td[0]); i++) { image_list_add_bitmap(himl, td[i].grey, i + 1); - check_iml_data(himl, td[i].cx, td[i].cy, td[i].cur, td[i].max, td[i].grow, td[i].bpp, td[i].comment); + check_iml_data(himl, td[i].cx, td[i].cy, td[i].cur, td[i].max, grow, td[i].bpp, td[i].comment); } }
static void test_imagelist_storage(void) { HIMAGELIST himl; + INT ret, grow; HBITMAP hbm; HICON icon; - INT ret;
himl = pImageList_Create(BMP_CX, BMP_CX, ILC_COLOR24, 1, 1); ok(himl != 0, "ImageList_Create failed\n");
- check_iml_data(himl, BMP_CX, BMP_CX, 0, 2, 4, ILC_COLOR24, "empty"); + check_iml_data(himl, BMP_CX, BMP_CX, 0, 2, 1, ILC_COLOR24, "empty");
- image_list_init(himl); - check_iml_data(himl, BMP_CX, BMP_CX, 24, 27, 4, ILC_COLOR24, "orig"); + image_list_init(himl, 1); + check_iml_data(himl, BMP_CX, BMP_CX, 24, 27, 1, ILC_COLOR24, "orig");
ret = pImageList_Remove(himl, 4); ok(ret, "ImageList_Remove failed\n"); - check_iml_data(himl, BMP_CX, BMP_CX, 23, 27, 4, ILC_COLOR24, "1"); + check_iml_data(himl, BMP_CX, BMP_CX, 23, 27, 1, ILC_COLOR24, "1");
ret = pImageList_Remove(himl, 5); ok(ret, "ImageList_Remove failed\n"); - check_iml_data(himl, BMP_CX, BMP_CX, 22, 27, 4, ILC_COLOR24, "2"); + check_iml_data(himl, BMP_CX, BMP_CX, 22, 27, 1, ILC_COLOR24, "2");
ret = pImageList_Remove(himl, 6); ok(ret, "ImageList_Remove failed\n"); - check_iml_data(himl, BMP_CX, BMP_CX, 21, 27, 4, ILC_COLOR24, "3"); + check_iml_data(himl, BMP_CX, BMP_CX, 21, 27, 1, ILC_COLOR24, "3");
ret = pImageList_Remove(himl, 7); ok(ret, "ImageList_Remove failed\n"); - check_iml_data(himl, BMP_CX, BMP_CX, 20, 27, 4, ILC_COLOR24, "4"); + check_iml_data(himl, BMP_CX, BMP_CX, 20, 27, 1, ILC_COLOR24, "4");
ret = pImageList_Remove(himl, -2); ok(!ret, "ImageList_Remove(-2) should fail\n"); - check_iml_data(himl, BMP_CX, BMP_CX, 20, 27, 4, ILC_COLOR24, "5"); + check_iml_data(himl, BMP_CX, BMP_CX, 20, 27, 1, ILC_COLOR24, "5");
ret = pImageList_Remove(himl, 20); ok(!ret, "ImageList_Remove(20) should fail\n"); - check_iml_data(himl, BMP_CX, BMP_CX, 20, 27, 4, ILC_COLOR24, "6"); + check_iml_data(himl, BMP_CX, BMP_CX, 20, 27, 1, ILC_COLOR24, "6");
ret = pImageList_Remove(himl, -1); ok(ret, "ImageList_Remove(-1) failed\n"); - check_iml_data(himl, BMP_CX, BMP_CX, 0, 4, 4, ILC_COLOR24, "7"); + check_iml_data(himl, BMP_CX, BMP_CX, 0, 4, 1, ILC_COLOR24, "7");
ret = pImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n"); @@ -1162,13 +1177,13 @@ static void test_imagelist_storage(void)
himl = pImageList_Create(BMP_CX, BMP_CX, ILC_COLOR24, 207, 209); ok(himl != 0, "ImageList_Create failed\n"); - check_iml_data(himl, BMP_CX, BMP_CX, 0, 208, 212, ILC_COLOR24, "init 207 grow 209"); + check_iml_data(himl, BMP_CX, BMP_CX, 0, 208, 209, ILC_COLOR24, "init 207 grow 209"); ret = pImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n");
himl = pImageList_Create(BMP_CX, BMP_CX, ILC_COLOR24, 209, 207); ok(himl != 0, "ImageList_Create failed\n"); - check_iml_data(himl, BMP_CX, BMP_CX, 0, 210, 208, ILC_COLOR24, "init 209 grow 207"); + check_iml_data(himl, BMP_CX, BMP_CX, 0, 210, 207, ILC_COLOR24, "init 209 grow 207"); ret = pImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n");
@@ -1180,13 +1195,13 @@ static void test_imagelist_storage(void)
himl = pImageList_Create(BMP_CX, BMP_CX, ILC_COLOR24, 5, 9); ok(himl != 0, "ImageList_Create failed\n"); - check_iml_data(himl, BMP_CX, BMP_CX, 0, 6, 12, ILC_COLOR24, "init 5 grow 9"); + check_iml_data(himl, BMP_CX, BMP_CX, 0, 6, 9, ILC_COLOR24, "init 5 grow 9"); ret = pImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n");
himl = pImageList_Create(BMP_CX, BMP_CX, ILC_COLOR24, 9, 5); ok(himl != 0, "ImageList_Create failed\n"); - check_iml_data(himl, BMP_CX, BMP_CX, 0, 10, 8, ILC_COLOR24, "init 9 grow 5"); + check_iml_data(himl, BMP_CX, BMP_CX, 0, 10, 5, ILC_COLOR24, "init 9 grow 5"); ret = pImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n");
@@ -1198,79 +1213,88 @@ static void test_imagelist_storage(void)
himl = pImageList_Create(BMP_CX, BMP_CX, ILC_COLOR24, 4, 2); ok(himl != 0, "ImageList_Create failed\n"); - check_iml_data(himl, BMP_CX, BMP_CX, 0, 5, 4, ILC_COLOR24, "init 4 grow 2"); + check_iml_data(himl, BMP_CX, BMP_CX, 0, 5, 2, ILC_COLOR24, "init 4 grow 2"); ret = pImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n");
himl = pImageList_Create(BMP_CX, BMP_CX, ILC_COLOR8, 4, 2); ok(himl != 0, "ImageList_Create failed\n"); - check_iml_data(himl, BMP_CX, BMP_CX, 0, 5, 4, ILC_COLOR8, "bpp 8"); + check_iml_data(himl, BMP_CX, BMP_CX, 0, 5, 2, ILC_COLOR8, "bpp 8"); ret = pImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n");
himl = pImageList_Create(BMP_CX, BMP_CX, ILC_COLOR4, 4, 2); ok(himl != 0, "ImageList_Create failed\n"); - check_iml_data(himl, BMP_CX, BMP_CX, 0, 5, 4, ILC_COLOR4, "bpp 4"); + check_iml_data(himl, BMP_CX, BMP_CX, 0, 5, 2, ILC_COLOR4, "bpp 4"); ret = pImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n");
himl = pImageList_Create(BMP_CX, BMP_CX, 0, 4, 2); ok(himl != 0, "ImageList_Create failed\n"); - check_iml_data(himl, BMP_CX, BMP_CX, 0, 5, 4, ILC_COLOR4, "bpp default"); + check_iml_data(himl, BMP_CX, BMP_CX, 0, 5, 2, ILC_COLOR4, "bpp default"); icon = CreateIcon(hinst, 32, 32, 1, 1, icon_bits, icon_bits); ok( pImageList_ReplaceIcon(himl, -1, icon) == 0, "Failed to add icon.\n"); ok( pImageList_ReplaceIcon(himl, -1, icon) == 1, "Failed to add icon.\n"); DestroyIcon( icon ); - check_iml_data(himl, BMP_CX, BMP_CX, 2, 5, 4, ILC_COLOR4, "bpp default"); + check_iml_data(himl, BMP_CX, BMP_CX, 2, 5, 2, ILC_COLOR4, "bpp default"); ret = pImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n");
himl = pImageList_Create(BMP_CX, BMP_CX, ILC_COLOR24|ILC_MASK, 4, 2); ok(himl != 0, "ImageList_Create failed\n"); - check_iml_data(himl, BMP_CX, BMP_CX, 0, 5, 4, ILC_COLOR24|ILC_MASK, "bpp 24 + mask"); + check_iml_data(himl, BMP_CX, BMP_CX, 0, 5, 2, ILC_COLOR24|ILC_MASK, "bpp 24 + mask"); icon = CreateIcon(hinst, 32, 32, 1, 1, icon_bits, icon_bits); ok( pImageList_ReplaceIcon(himl, -1, icon) == 0, "Failed to add icon.\n"); ok( pImageList_ReplaceIcon(himl, -1, icon) == 1, "Failed to add icon.\n"); DestroyIcon( icon ); - check_iml_data(himl, BMP_CX, BMP_CX, 2, 5, 4, ILC_COLOR24|ILC_MASK, "bpp 24 + mask"); + check_iml_data(himl, BMP_CX, BMP_CX, 2, 5, 2, ILC_COLOR24|ILC_MASK, "bpp 24 + mask"); ret = pImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n");
himl = pImageList_Create(BMP_CX, BMP_CX, ILC_COLOR4|ILC_MASK, 4, 2); ok(himl != 0, "ImageList_Create failed\n"); - check_iml_data(himl, BMP_CX, BMP_CX, 0, 5, 4, ILC_COLOR4|ILC_MASK, "bpp 4 + mask"); + check_iml_data(himl, BMP_CX, BMP_CX, 0, 5, 2, ILC_COLOR4|ILC_MASK, "bpp 4 + mask"); icon = CreateIcon(hinst, 32, 32, 1, 1, icon_bits, icon_bits); ok( pImageList_ReplaceIcon(himl, -1, icon) == 0, "Failed to add icon.\n"); ok( pImageList_ReplaceIcon(himl, -1, icon) == 1, "Failed to add icon.\n"); DestroyIcon( icon ); - check_iml_data(himl, BMP_CX, BMP_CX, 2, 5, 4, ILC_COLOR4|ILC_MASK, "bpp 4 + mask"); + check_iml_data(himl, BMP_CX, BMP_CX, 2, 5, 2, ILC_COLOR4|ILC_MASK, "bpp 4 + mask"); ret = pImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n");
himl = pImageList_Create(BMP_CX, BMP_CX, ILC_COLOR4|ILC_MASK, 2, 99); ok(himl != 0, "ImageList_Create failed\n"); - check_iml_data(himl, BMP_CX, BMP_CX, 0, 3, 100, ILC_COLOR4|ILC_MASK, "init 2 grow 99"); + check_iml_data(himl, BMP_CX, BMP_CX, 0, 3, 99, ILC_COLOR4|ILC_MASK, "init 2 grow 99"); icon = CreateIcon(hinst, 32, 32, 1, 1, icon_bits, icon_bits); ok( pImageList_ReplaceIcon(himl, -1, icon) == 0, "Failed to add icon.\n"); ok( pImageList_ReplaceIcon(himl, -1, icon) == 1, "Failed to add icon.\n"); - check_iml_data(himl, BMP_CX, BMP_CX, 2, 3, 100, ILC_COLOR4|ILC_MASK, "init 2 grow 99 2 icons"); + check_iml_data(himl, BMP_CX, BMP_CX, 2, 3, 99, ILC_COLOR4|ILC_MASK, "init 2 grow 99 2 icons"); ok( pImageList_ReplaceIcon(himl, -1, icon) == 2, "Failed to add icon\n"); DestroyIcon( icon ); - check_iml_data(himl, BMP_CX, BMP_CX, 3, 104, 100, ILC_COLOR4|ILC_MASK, "init 2 grow 99 3 icons"); + check_iml_data(himl, BMP_CX, BMP_CX, 3, 104, 99, ILC_COLOR4|ILC_MASK, "init 2 grow 99 3 icons"); ok( pImageList_Remove(himl, -1) == TRUE, "Failed to remove icon.\n"); - check_iml_data(himl, BMP_CX, BMP_CX, 0, 100, 100, ILC_COLOR4|ILC_MASK, "init 2 grow 99 empty"); + check_iml_data(himl, BMP_CX, BMP_CX, 0, 100, 99, ILC_COLOR4|ILC_MASK, "init 2 grow 99 empty"); ok( pImageList_SetImageCount(himl, 22) == TRUE, "Failed to set image count.\n"); - check_iml_data(himl, BMP_CX, BMP_CX, 22, 23, 100, ILC_COLOR4|ILC_MASK, "init 2 grow 99 set count 22"); + check_iml_data(himl, BMP_CX, BMP_CX, 22, 23, 99, ILC_COLOR4|ILC_MASK, "init 2 grow 99 set count 22"); ok( pImageList_SetImageCount(himl, 0) == TRUE, "Failed to set image count.\n"); - check_iml_data(himl, BMP_CX, BMP_CX, 0, 1, 100, ILC_COLOR4|ILC_MASK, "init 2 grow 99 set count 0"); + check_iml_data(himl, BMP_CX, BMP_CX, 0, 1, 99, ILC_COLOR4|ILC_MASK, "init 2 grow 99 set count 0"); ok( pImageList_SetImageCount(himl, 42) == TRUE, "Failed to set image count.\n"); - check_iml_data(himl, BMP_CX, BMP_CX, 42, 43, 100, ILC_COLOR4|ILC_MASK, "init 2 grow 99 set count 42"); + check_iml_data(himl, BMP_CX, BMP_CX, 42, 43, 99, ILC_COLOR4|ILC_MASK, "init 2 grow 99 set count 42"); ret = pImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n");
+ for (grow = 1; grow <= 16; grow++) + { + himl = pImageList_Create(BMP_CX, BMP_CX, ILC_COLOR4|ILC_MASK, 2, grow); + ok(himl != 0, "ImageList_Create failed\n"); + check_iml_data(himl, BMP_CX, BMP_CX, 0, 3, grow, ILC_COLOR4|ILC_MASK, "grow test"); + ret = pImageList_Destroy(himl); + ok(ret, "ImageList_Destroy failed\n"); + } + himl = pImageList_Create(BMP_CX, BMP_CX, ILC_COLOR4|ILC_MASK, 2, -20); ok(himl != 0, "ImageList_Create failed\n"); - check_iml_data(himl, BMP_CX, BMP_CX, 0, 3, 4, ILC_COLOR4|ILC_MASK, "init 2 grow -20"); + check_iml_data(himl, BMP_CX, BMP_CX, 0, 3, -20, ILC_COLOR4|ILC_MASK, "init 2 grow -20"); ret = pImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n");
@@ -1279,13 +1303,13 @@ static void test_imagelist_storage(void) { himl = pImageList_Create(BMP_CX, BMP_CX, ILC_COLOR4|ILC_MASK, 2, 65536+12); ok(himl != 0, "ImageList_Create failed\n"); - check_iml_data(himl, BMP_CX, BMP_CX, 0, 3, 12, ILC_COLOR4|ILC_MASK, "init 2 grow 65536+12"); + check_iml_data(himl, BMP_CX, BMP_CX, 0, 3, 65536+12, ILC_COLOR4|ILC_MASK, "init 2 grow 65536+12"); ret = pImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n");
himl = pImageList_Create(BMP_CX, BMP_CX, ILC_COLOR4|ILC_MASK, 2, 65535); ok(himl != 0, "ImageList_Create failed\n"); - check_iml_data(himl, BMP_CX, BMP_CX, 0, 3, 0, ILC_COLOR4|ILC_MASK, "init 2 grow 65535"); + check_iml_data(himl, BMP_CX, BMP_CX, 0, 3, 65535, ILC_COLOR4|ILC_MASK, "init 2 grow 65535"); ret = pImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n"); }