Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
a07c922f
Commit
a07c922f
authored
Nov 13, 2009
by
Owen Rudge
Committed by
Alexandre Julliard
Nov 16, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/tests: Add tests for IImageList based on standard imagelist tests.
parent
dff6be09
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
0 deletions
+67
-0
imagelist.c
dlls/comctl32/tests/imagelist.c
+67
-0
No files found.
dlls/comctl32/tests/imagelist.c
View file @
a07c922f
...
...
@@ -1278,6 +1278,72 @@ static void test_iimagelist(void)
ImageList_Destroy
(
himl
);
}
static
void
DoTest1_v6
(
void
)
{
IImageList
*
imgl
;
HIMAGELIST
himl
;
HRESULT
hr
;
HICON
hicon1
;
HICON
hicon2
;
HICON
hicon3
;
int
ret
=
0
;
/* create an imagelist to play with */
himl
=
ImageList_Create
(
84
,
84
,
0x10
,
0
,
3
);
ok
(
himl
!=
0
,
"failed to create imagelist
\n
"
);
imgl
=
(
IImageList
*
)
himl
;
/* load the icons to add to the image list */
hicon1
=
CreateIcon
(
hinst
,
32
,
32
,
1
,
1
,
icon_bits
,
icon_bits
);
ok
(
hicon1
!=
0
,
"no hicon1
\n
"
);
hicon2
=
CreateIcon
(
hinst
,
32
,
32
,
1
,
1
,
icon_bits
,
icon_bits
);
ok
(
hicon2
!=
0
,
"no hicon2
\n
"
);
hicon3
=
CreateIcon
(
hinst
,
32
,
32
,
1
,
1
,
icon_bits
,
icon_bits
);
ok
(
hicon3
!=
0
,
"no hicon3
\n
"
);
/* remove when nothing exists */
hr
=
IImageList_Remove
(
imgl
,
0
);
ok
(
!
(
SUCCEEDED
(
hr
)),
"removed nonexistent icon
\n
"
);
/* removing everything from an empty imagelist should succeed */
hr
=
IImageList_Remove
(
imgl
,
-
1
);
ok
(
SUCCEEDED
(
hr
),
"removed nonexistent icon
\n
"
);
/* add three */
ok
(
SUCCEEDED
(
IImageList_ReplaceIcon
(
imgl
,
-
1
,
hicon1
,
&
ret
))
&&
(
ret
==
0
),
"failed to add icon1
\n
"
);
ok
(
SUCCEEDED
(
IImageList_ReplaceIcon
(
imgl
,
-
1
,
hicon2
,
&
ret
))
&&
(
ret
==
1
),
"failed to add icon2
\n
"
);
ok
(
SUCCEEDED
(
IImageList_ReplaceIcon
(
imgl
,
-
1
,
hicon3
,
&
ret
))
&&
(
ret
==
2
),
"failed to add icon3
\n
"
);
/* remove an index out of range */
ok
(
!
SUCCEEDED
(
IImageList_Remove
(
imgl
,
4711
)),
"removed nonexistent icon
\n
"
);
/* remove three */
ok
(
SUCCEEDED
(
IImageList_Remove
(
imgl
,
0
)),
"can't remove 0
\n
"
);
ok
(
SUCCEEDED
(
IImageList_Remove
(
imgl
,
0
)),
"can't remove 0
\n
"
);
ok
(
SUCCEEDED
(
IImageList_Remove
(
imgl
,
0
)),
"can't remove 0
\n
"
);
/* remove one extra */
ok
(
!
SUCCEEDED
(
IImageList_Remove
(
imgl
,
0
)),
"removed nonexistent icon
\n
"
);
/* check SetImageCount/GetImageCount */
ok
(
SUCCEEDED
(
IImageList_SetImageCount
(
imgl
,
3
)),
"couldn't increase image count
\n
"
);
ok
(
SUCCEEDED
(
IImageList_GetImageCount
(
imgl
,
&
ret
))
&&
(
ret
==
3
),
"invalid image count after increase
\n
"
);
ok
(
SUCCEEDED
(
IImageList_SetImageCount
(
imgl
,
1
)),
"couldn't decrease image count
\n
"
);
ok
(
SUCCEEDED
(
IImageList_GetImageCount
(
imgl
,
&
ret
))
&&
(
ret
==
1
),
"invalid image count after decrease to 1
\n
"
);
ok
(
SUCCEEDED
(
IImageList_SetImageCount
(
imgl
,
0
)),
"couldn't decrease image count
\n
"
);
ok
(
SUCCEEDED
(
IImageList_GetImageCount
(
imgl
,
&
ret
))
&&
(
ret
==
0
),
"invalid image count after decrease to 0
\n
"
);
/* destroy it */
ok
(
SUCCEEDED
(
IImageList_Release
(
imgl
)),
"release imagelist failed
\n
"
);
ok
(
DestroyIcon
(
hicon1
),
"icon 1 wasn't deleted
\n
"
);
ok
(
DestroyIcon
(
hicon2
),
"icon 2 wasn't deleted
\n
"
);
ok
(
DestroyIcon
(
hicon3
),
"icon 3 wasn't deleted
\n
"
);
}
START_TEST
(
imagelist
)
{
ULONG_PTR
ctx_cookie
;
...
...
@@ -1322,6 +1388,7 @@ START_TEST(imagelist)
test_ImageList_DrawIndirect
();
test_shell_imagelist
();
test_iimagelist
();
DoTest1_v6
();
CoUninitialize
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment