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
adc439b1
Commit
adc439b1
authored
Apr 21, 2017
by
Huw Davies
Committed by
Alexandre Julliard
Apr 21, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32/tests: Add tests for the size of the icon returned by SHGetFileInfo().
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c4155c52
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
6 deletions
+44
-6
shlfileop.c
dlls/shell32/tests/shlfileop.c
+44
-6
No files found.
dlls/shell32/tests/shlfileop.c
View file @
adc439b1
...
@@ -317,6 +317,40 @@ static void test_get_file_info(void)
...
@@ -317,6 +317,40 @@ static void test_get_file_info(void)
ok
(
shfi
.
iIcon
!=
0xdeadbeef
,
"iIcon was expected to change
\n
"
);
ok
(
shfi
.
iIcon
!=
0xdeadbeef
,
"iIcon was expected to change
\n
"
);
}
}
static
void
check_icon_size
(
HICON
icon
,
DWORD
flags
)
{
ICONINFO
info
;
BITMAP
bm
;
SIZE
list_size
,
metrics_size
;
IImageList
*
list
;
GetIconInfo
(
icon
,
&
info
);
GetObjectW
(
info
.
hbmColor
,
sizeof
(
bm
),
&
bm
);
SHGetImageList
(
(
flags
&
SHGFI_SMALLICON
)
?
SHIL_SMALL
:
SHIL_LARGE
,
&
IID_IImageList
,
(
void
**
)
&
list
);
IImageList_GetIconSize
(
list
,
&
list_size
.
cx
,
&
list_size
.
cy
);
IImageList_Release
(
list
);
metrics_size
.
cx
=
GetSystemMetrics
(
(
flags
&
SHGFI_SMALLICON
)
?
SM_CXSMICON
:
SM_CXICON
);
metrics_size
.
cy
=
GetSystemMetrics
(
(
flags
&
SHGFI_SMALLICON
)
?
SM_CYSMICON
:
SM_CYICON
);
if
(
flags
&
SHGFI_SHELLICONSIZE
)
{
todo_wine_if
(
list_size
.
cx
!=
metrics_size
.
cx
)
{
ok
(
bm
.
bmWidth
==
list_size
.
cx
,
"got %d expected %d
\n
"
,
bm
.
bmWidth
,
list_size
.
cx
);
ok
(
bm
.
bmHeight
==
list_size
.
cy
,
"got %d expected %d
\n
"
,
bm
.
bmHeight
,
list_size
.
cy
);
}
}
else
{
ok
(
bm
.
bmWidth
==
metrics_size
.
cx
,
"got %d expected %d
\n
"
,
bm
.
bmWidth
,
metrics_size
.
cx
);
ok
(
bm
.
bmHeight
==
metrics_size
.
cy
,
"got %d expected %d
\n
"
,
bm
.
bmHeight
,
metrics_size
.
cy
);
}
}
static
void
test_get_file_info_iconlist
(
void
)
static
void
test_get_file_info_iconlist
(
void
)
{
{
/* Test retrieving a handle to the system image list, and
/* Test retrieving a handle to the system image list, and
...
@@ -400,8 +434,8 @@ static void test_get_file_info_iconlist(void)
...
@@ -400,8 +434,8 @@ static void test_get_file_info_iconlist(void)
SHGFI_ICON
|
SHGFI_USEFILEATTRIBUTES
|
SHGFI_PIDL
|
SHGFI_SMALLICON
);
SHGFI_ICON
|
SHGFI_USEFILEATTRIBUTES
|
SHGFI_PIDL
|
SHGFI_SMALLICON
);
ok
(
hr
!=
0
,
" SHGFI_ICON|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_SMALLICON Failed
\n
"
);
ok
(
hr
!=
0
,
" SHGFI_ICON|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_SMALLICON Failed
\n
"
);
ok
(
shInfow
.
iIcon
!=
0xcfcfcfcf
,
"Icon Index Missing
\n
"
);
ok
(
shInfow
.
iIcon
!=
0xcfcfcfcf
,
"Icon Index Missing
\n
"
);
ok
(
shInfow
.
hIcon
!=
(
HICON
)
0xcfcfcfcf
&&
shInfow
.
hIcon
!=
0
,
"hIcon invalid
\n
"
);
check_icon_size
(
shInfow
.
hIcon
,
SHGFI_SMALLICON
);
if
(
shInfow
.
hIcon
!=
(
HICON
)
0xcfcfcfcf
)
DestroyIcon
(
shInfow
.
hIcon
);
DestroyIcon
(
shInfow
.
hIcon
);
todo_wine
ok
(
shInfow
.
dwAttributes
==
0
,
"dwAttributes not set
\n
"
);
todo_wine
ok
(
shInfow
.
dwAttributes
==
0
,
"dwAttributes not set
\n
"
);
memset
(
&
shInfow
,
0xcf
,
sizeof
(
shInfow
));
memset
(
&
shInfow
,
0xcf
,
sizeof
(
shInfow
));
...
@@ -409,8 +443,8 @@ static void test_get_file_info_iconlist(void)
...
@@ -409,8 +443,8 @@ static void test_get_file_info_iconlist(void)
SHGFI_ICON
|
SHGFI_USEFILEATTRIBUTES
|
SHGFI_PIDL
|
SHGFI_LARGEICON
);
SHGFI_ICON
|
SHGFI_USEFILEATTRIBUTES
|
SHGFI_PIDL
|
SHGFI_LARGEICON
);
ok
(
hr
!=
0
,
"SHGFI_ICON|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_LARGEICON Failed
\n
"
);
ok
(
hr
!=
0
,
"SHGFI_ICON|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_LARGEICON Failed
\n
"
);
ok
(
shInfow
.
iIcon
!=
0xcfcfcfcf
,
"Icon Index Missing
\n
"
);
ok
(
shInfow
.
iIcon
!=
0xcfcfcfcf
,
"Icon Index Missing
\n
"
);
ok
(
shInfow
.
hIcon
!=
(
HICON
)
0xcfcfcfcf
&&
shInfow
.
hIcon
!=
0
,
"hIcon invalid
\n
"
);
check_icon_size
(
shInfow
.
hIcon
,
SHGFI_LARGEICON
);
if
(
shInfow
.
hIcon
!=
(
HICON
)
0xcfcfcfcf
)
DestroyIcon
(
shInfow
.
hIcon
);
DestroyIcon
(
shInfow
.
hIcon
);
todo_wine
ok
(
shInfow
.
dwAttributes
==
0
,
"dwAttributes not set
\n
"
);
todo_wine
ok
(
shInfow
.
dwAttributes
==
0
,
"dwAttributes not set
\n
"
);
memset
(
&
shInfow
,
0xcf
,
sizeof
(
shInfow
));
memset
(
&
shInfow
,
0xcf
,
sizeof
(
shInfow
));
...
@@ -509,15 +543,19 @@ static void test_get_file_info_iconlist(void)
...
@@ -509,15 +543,19 @@ static void test_get_file_info_iconlist(void)
memset
(
&
shInfow
,
0xcf
,
sizeof
(
shInfow
));
memset
(
&
shInfow
,
0xcf
,
sizeof
(
shInfow
));
hSysImageList
=
(
HIMAGELIST
)
pSHGetFileInfoW
((
const
WCHAR
*
)
pidList
,
0
,
&
shInfow
,
sizeof
(
shInfow
),
hSysImageList
=
(
HIMAGELIST
)
pSHGetFileInfoW
((
const
WCHAR
*
)
pidList
,
0
,
&
shInfow
,
sizeof
(
shInfow
),
SHGFI_SYSICONINDEX
|
SHGFI_PIDL
|
SHGFI_SMALLICON
|
SHGFI_SHELLICONSIZE
);
SHGFI_SYSICONINDEX
|
SHGFI_PIDL
|
SHGFI_SMALLICON
|
SHGFI_SHELLICONSIZE
|
SHGFI_ICON
);
ok
(
hSysImageList
==
(
HIMAGELIST
)
small_list
,
"got %p expect %p
\n
"
,
hSysImageList
,
small_list
);
ok
(
hSysImageList
==
(
HIMAGELIST
)
small_list
,
"got %p expect %p
\n
"
,
hSysImageList
,
small_list
);
ok
(
shInfow
.
iIcon
!=
0xcfcfcfcf
,
"Icon Index Missing
\n
"
);
ok
(
shInfow
.
iIcon
!=
0xcfcfcfcf
,
"Icon Index Missing
\n
"
);
check_icon_size
(
shInfow
.
hIcon
,
SHGFI_SMALLICON
|
SHGFI_SHELLICONSIZE
);
DestroyIcon
(
shInfow
.
hIcon
);
memset
(
&
shInfow
,
0xcf
,
sizeof
(
shInfow
));
memset
(
&
shInfow
,
0xcf
,
sizeof
(
shInfow
));
hSysImageList
=
(
HIMAGELIST
)
pSHGetFileInfoW
((
const
WCHAR
*
)
pidList
,
0
,
&
shInfow
,
sizeof
(
shInfow
),
hSysImageList
=
(
HIMAGELIST
)
pSHGetFileInfoW
((
const
WCHAR
*
)
pidList
,
0
,
&
shInfow
,
sizeof
(
shInfow
),
SHGFI_SYSICONINDEX
|
SHGFI_PIDL
|
SHGFI_SHELLICONSIZE
);
SHGFI_SYSICONINDEX
|
SHGFI_PIDL
|
SHGFI_SHELLICONSIZE
|
SHGFI_ICON
);
ok
(
hSysImageList
==
(
HIMAGELIST
)
large_list
,
"got %p expect %p
\n
"
,
hSysImageList
,
small_list
);
ok
(
hSysImageList
==
(
HIMAGELIST
)
large_list
,
"got %p expect %p
\n
"
,
hSysImageList
,
small_list
);
ok
(
shInfow
.
iIcon
!=
0xcfcfcfcf
,
"Icon Index Missing
\n
"
);
ok
(
shInfow
.
iIcon
!=
0xcfcfcfcf
,
"Icon Index Missing
\n
"
);
check_icon_size
(
shInfow
.
hIcon
,
SHGFI_LARGEICON
|
SHGFI_SHELLICONSIZE
);
DestroyIcon
(
shInfow
.
hIcon
);
ILFree
(
pidList
);
ILFree
(
pidList
);
IImageList_Release
(
small_list
);
IImageList_Release
(
small_list
);
...
...
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