Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
b37009ee
Commit
b37009ee
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 further tests for IImageList.
parent
8a4a7616
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
80 additions
and
0 deletions
+80
-0
imagelist.c
dlls/comctl32/tests/imagelist.c
+80
-0
No files found.
dlls/comctl32/tests/imagelist.c
View file @
b37009ee
...
...
@@ -1344,6 +1344,85 @@ static void DoTest1_v6(void)
ok
(
DestroyIcon
(
hicon3
),
"icon 3 wasn't deleted
\n
"
);
}
static
void
DoTest3_v6
(
void
)
{
IImageList
*
imgl
;
HIMAGELIST
himl
;
HBITMAP
hbm1
;
HBITMAP
hbm2
;
HBITMAP
hbm3
;
IMAGELISTDRAWPARAMS
imldp
;
HWND
hwndfortest
;
HDC
hdc
;
int
ret
;
hwndfortest
=
create_a_window
();
hdc
=
GetDC
(
hwndfortest
);
ok
(
hdc
!=
NULL
,
"couldn't get DC
\n
"
);
/* create an imagelist to play with */
himl
=
ImageList_Create
(
48
,
48
,
0x10
,
0
,
3
);
ok
(
himl
!=
0
,
"failed to create imagelist
\n
"
);
imgl
=
(
IImageList
*
)
himl
;
/* load the icons to add to the image list */
hbm1
=
CreateBitmap
(
48
,
48
,
1
,
1
,
bitmap_bits
);
ok
(
hbm1
!=
0
,
"no bitmap 1
\n
"
);
hbm2
=
CreateBitmap
(
48
,
48
,
1
,
1
,
bitmap_bits
);
ok
(
hbm2
!=
0
,
"no bitmap 2
\n
"
);
hbm3
=
CreateBitmap
(
48
,
48
,
1
,
1
,
bitmap_bits
);
ok
(
hbm3
!=
0
,
"no bitmap 3
\n
"
);
/* add three */
ok
(
SUCCEEDED
(
IImageList_Add
(
imgl
,
hbm1
,
0
,
&
ret
))
&&
(
ret
==
0
),
"failed to add bitmap 1
\n
"
);
ok
(
SUCCEEDED
(
IImageList_Add
(
imgl
,
hbm2
,
0
,
&
ret
))
&&
(
ret
==
1
),
"failed to add bitmap 2
\n
"
);
ok
(
SUCCEEDED
(
IImageList_SetImageCount
(
imgl
,
3
)),
"Setimage count failed
\n
"
);
ok
(
SUCCEEDED
(
IImageList_Replace
(
imgl
,
2
,
hbm3
,
0
)),
"failed to replace bitmap 3
\n
"
);
memset
(
&
imldp
,
0
,
sizeof
(
imldp
));
ok
(
SUCCEEDED
(
!
IImageList_Draw
(
imgl
,
&
imldp
)),
"zero data succeeded!
\n
"
);
imldp
.
cbSize
=
sizeof
(
imldp
);
ok
(
SUCCEEDED
(
!
IImageList_Draw
(
imgl
,
&
imldp
)),
"zero hdc succeeded!
\n
"
);
imldp
.
hdcDst
=
hdc
;
ok
(
SUCCEEDED
(
!
IImageList_Draw
(
imgl
,
&
imldp
)),
"zero himl succeeded!
\n
"
);
REDRAW
(
hwndfortest
);
WAIT
;
imldp
.
fStyle
=
SRCCOPY
;
imldp
.
rgbBk
=
CLR_DEFAULT
;
imldp
.
rgbFg
=
CLR_DEFAULT
;
imldp
.
y
=
100
;
imldp
.
x
=
100
;
ok
(
SUCCEEDED
(
IImageList_Draw
(
imgl
,
&
imldp
)),
"should succeed
\n
"
);
imldp
.
i
++
;
ok
(
SUCCEEDED
(
IImageList_Draw
(
imgl
,
&
imldp
)),
"should succeed
\n
"
);
imldp
.
i
++
;
ok
(
SUCCEEDED
(
IImageList_Draw
(
imgl
,
&
imldp
)),
"should succeed
\n
"
);
imldp
.
i
++
;
ok
(
!
SUCCEEDED
(
IImageList_Draw
(
imgl
,
&
imldp
)),
"should fail
\n
"
);
/* remove three */
ok
(
SUCCEEDED
(
IImageList_Remove
(
imgl
,
0
)),
"removing 1st bitmap
\n
"
);
ok
(
SUCCEEDED
(
IImageList_Remove
(
imgl
,
0
)),
"removing 2nd bitmap
\n
"
);
ok
(
SUCCEEDED
(
IImageList_Remove
(
imgl
,
0
)),
"removing 3rd bitmap
\n
"
);
/* destroy it */
ok
(
SUCCEEDED
(
IImageList_Release
(
imgl
)),
"release imagelist failed
\n
"
);
/* bitmaps should not be deleted by the imagelist */
ok
(
DeleteObject
(
hbm1
),
"bitmap 1 can't be deleted
\n
"
);
ok
(
DeleteObject
(
hbm2
),
"bitmap 2 can't be deleted
\n
"
);
ok
(
DeleteObject
(
hbm3
),
"bitmap 3 can't be deleted
\n
"
);
ReleaseDC
(
hwndfortest
,
hdc
);
DestroyWindow
(
hwndfortest
);
}
START_TEST
(
imagelist
)
{
ULONG_PTR
ctx_cookie
;
...
...
@@ -1389,6 +1468,7 @@ START_TEST(imagelist)
test_shell_imagelist
();
test_iimagelist
();
DoTest1_v6
();
DoTest3_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