Module: wine Branch: oldstable Commit: d1db77cc44210fc766addcb6fd2c0f6c0a66711d URL: https://source.winehq.org/git/wine.git/?a=commit;h=d1db77cc44210fc766addcb6f...
Author: Michael Stefaniuc mstefani@winehq.org Date: Wed Apr 5 15:25:44 2017 +0200
comctl32/tests: Add an ImageList_Copy() test.
Signed-off-by: Michael Stefaniuc mstefani@winehq.org Signed-off-by: Alexandre Julliard julliard@winehq.org (cherry picked from commit a6a9ec4459d1ba912b4ce13671fe8ba0bfe531ee) Signed-off-by: Michael Stefaniuc mstefani@winehq.org
---
dlls/comctl32/tests/imagelist.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
diff --git a/dlls/comctl32/tests/imagelist.c b/dlls/comctl32/tests/imagelist.c index b5445c5..7669fb6 100644 --- a/dlls/comctl32/tests/imagelist.c +++ b/dlls/comctl32/tests/imagelist.c @@ -2230,6 +2230,29 @@ static void test_color_table(UINT ilc) ImageList_Destroy(himl); }
+static void test_copy(void) +{ + HIMAGELIST dst, src; + BOOL ret; + int count; + + dst = ImageList_Create(5, 11, ILC_COLOR, 1, 1); + count = ImageList_GetImageCount(dst); + ok(!count, "ImageList not empty.\n"); + src = createImageList(7, 13); + count = ImageList_GetImageCount(src); + ok(count > 2, "Tests need an ImageList with more than 2 images\n"); + + /* ImageList_Copy() cannot copy between two ImageLists */ + ret = ImageList_Copy(dst, 0, src, 2, ILCF_MOVE); + ok(!ret, "ImageList_Copy() should have returned FALSE\n"); + count = ImageList_GetImageCount(dst); + ok(count == 0, "Expected no image in dst ImageList, got %d\n", count); + + ImageList_Destroy(dst); + ImageList_Destroy(src); +} + static void test_IImageList_Clone(void) { IImageList *imgl, *imgl2; @@ -2380,6 +2403,7 @@ START_TEST(imagelist) test_iconsize(); test_color_table(ILC_COLOR4); test_color_table(ILC_COLOR8); + test_copy();
FreeLibrary(hComCtl32);