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
1556fbf8
Commit
1556fbf8
authored
Aug 12, 2009
by
Owen Rudge
Committed by
Alexandre Julliard
Aug 13, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/tests: Add basic test for IImageList using SHGetImageList.
parent
cfd1703e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
0 deletions
+58
-0
imagelist.c
dlls/comctl32/tests/imagelist.c
+58
-0
No files found.
dlls/comctl32/tests/imagelist.c
View file @
1556fbf8
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
* Copyright 2004 Michael Stefaniuc
* Copyright 2004 Michael Stefaniuc
* Copyright 2002 Mike McCormack for CodeWeavers
* Copyright 2002 Mike McCormack for CodeWeavers
* Copyright 2007 Dmitry Timoshkov
* Copyright 2007 Dmitry Timoshkov
* Copyright 2009 Owen Rudge for CodeWeavers
*
*
* This library is free software; you can redistribute it and/or
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* modify it under the terms of the GNU Lesser General Public
...
@@ -33,8 +34,12 @@
...
@@ -33,8 +34,12 @@
#include "winuser.h"
#include "winuser.h"
#include "objbase.h"
#include "objbase.h"
#include "commctrl.h"
/* must be included after objbase.h to get ImageList_Write */
#include "commctrl.h"
/* must be included after objbase.h to get ImageList_Write */
#include "initguid.h"
#include "commoncontrols.h"
#include "shellapi.h"
#include "wine/test.h"
#include "wine/test.h"
#include "v6util.h"
#undef VISIBLE
#undef VISIBLE
...
@@ -981,8 +986,52 @@ static void test_imagelist_storage(void)
...
@@ -981,8 +986,52 @@ static void test_imagelist_storage(void)
iml_clear_stream_data
();
iml_clear_stream_data
();
}
}
static
void
test_shell_imagelist
(
void
)
{
BOOL
(
WINAPI
*
pSHGetImageList
)(
INT
,
REFIID
,
void
**
);
IImageList
*
iml
=
NULL
;
HMODULE
hShell32
;
HRESULT
hr
;
int
out
=
0
;
RECT
rect
;
/* Try to load function from shell32 */
hShell32
=
LoadLibrary
(
"shell32.dll"
);
pSHGetImageList
=
(
void
*
)
GetProcAddress
(
hShell32
,
(
LPCSTR
)
727
);
if
(
!
pSHGetImageList
)
{
win_skip
(
"SHGetImageList not available, skipping test
\n
"
);
return
;
}
/* Get system image list */
hr
=
(
pSHGetImageList
)(
SHIL_LARGE
,
&
IID_IImageList
,
(
void
**
)
&
iml
);
todo_wine
ok
(
SUCCEEDED
(
hr
),
"SHGetImageList failed, hr=%x
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
return
;
IImageList_GetImageCount
(
iml
,
&
out
);
todo_wine
ok
(
out
>
0
,
"IImageList_GetImageCount returned out <= 0"
);
/* right and bottom should be 32x32 for large icons, or 48x48 if larger
icons enabled in control panel */
IImageList_GetImageRect
(
iml
,
0
,
&
rect
);
todo_wine
ok
((((
rect
.
right
==
32
)
&&
(
rect
.
bottom
==
32
))
||
((
rect
.
right
==
48
)
&&
(
rect
.
bottom
==
48
))),
"IImageList_GetImageRect returned r:%d,b:%d"
,
rect
.
right
,
rect
.
bottom
);
IImageList_Release
(
iml
);
FreeLibrary
(
hShell32
);
}
START_TEST
(
imagelist
)
START_TEST
(
imagelist
)
{
{
ULONG_PTR
ctx_cookie
;
HMODULE
hComCtl32
=
GetModuleHandle
(
"comctl32.dll"
);
HMODULE
hComCtl32
=
GetModuleHandle
(
"comctl32.dll"
);
pImageList_DrawIndirect
=
(
void
*
)
GetProcAddress
(
hComCtl32
,
"ImageList_DrawIndirect"
);
pImageList_DrawIndirect
=
(
void
*
)
GetProcAddress
(
hComCtl32
,
"ImageList_DrawIndirect"
);
pImageList_SetImageCount
=
(
void
*
)
GetProcAddress
(
hComCtl32
,
"ImageList_SetImageCount"
);
pImageList_SetImageCount
=
(
void
*
)
GetProcAddress
(
hComCtl32
,
"ImageList_SetImageCount"
);
...
@@ -998,4 +1047,13 @@ START_TEST(imagelist)
...
@@ -998,4 +1047,13 @@ START_TEST(imagelist)
DoTest3
();
DoTest3
();
testMerge
();
testMerge
();
test_imagelist_storage
();
test_imagelist_storage
();
/* Now perform v6 tests */
if
(
!
load_v6_module
(
&
ctx_cookie
))
return
;
test_shell_imagelist
();
unload_v6_module
(
ctx_cookie
);
}
}
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