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
c0a6c5cd
Commit
c0a6c5cd
authored
Nov 16, 2009
by
Owen Rudge
Committed by
Alexandre Julliard
Nov 17, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/tests: Add hotspot/drag test for IImageList.
parent
341e6ed5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
0 deletions
+77
-0
imagelist.c
dlls/comctl32/tests/imagelist.c
+77
-0
No files found.
dlls/comctl32/tests/imagelist.c
View file @
c0a6c5cd
...
...
@@ -1306,6 +1306,81 @@ static void test_iimagelist(void)
ImageList_Destroy
(
himl
);
}
static
void
testHotspot_v6
(
void
)
{
struct
hotspot
{
int
dx
;
int
dy
;
};
#define SIZEX1 47
#define SIZEY1 31
#define SIZEX2 11
#define SIZEY2 17
#define HOTSPOTS_MAX 4
/* Number of entries in hotspots */
static
const
struct
hotspot
hotspots
[
HOTSPOTS_MAX
]
=
{
{
10
,
7
},
{
SIZEX1
,
SIZEY1
},
{
-
9
,
-
8
},
{
-
7
,
35
}
};
int
i
,
j
;
HIMAGELIST
himl1
=
createImageList
(
SIZEX1
,
SIZEY1
);
HIMAGELIST
himl2
=
createImageList
(
SIZEX2
,
SIZEY2
);
IImageList
*
imgl1
,
*
imgl2
;
HRESULT
hr
;
/* cast to IImageList */
imgl1
=
(
IImageList
*
)
himl1
;
imgl2
=
(
IImageList
*
)
himl2
;
for
(
i
=
0
;
i
<
HOTSPOTS_MAX
;
i
++
)
{
for
(
j
=
0
;
j
<
HOTSPOTS_MAX
;
j
++
)
{
int
dx1
=
hotspots
[
i
].
dx
;
int
dy1
=
hotspots
[
i
].
dy
;
int
dx2
=
hotspots
[
j
].
dx
;
int
dy2
=
hotspots
[
j
].
dy
;
int
correctx
,
correcty
,
newx
,
newy
;
char
loc
[
256
];
IImageList
*
imglNew
;
POINT
ppt
;
hr
=
IImageList_BeginDrag
(
imgl1
,
0
,
dx1
,
dy1
);
ok
(
SUCCEEDED
(
hr
),
"BeginDrag failed for { %d, %d }
\n
"
,
dx1
,
dy1
);
sprintf
(
loc
,
"BeginDrag (%d,%d)
\n
"
,
i
,
j
);
/* check merging the dragged image with a second image */
hr
=
IImageList_SetDragCursorImage
(
imgl2
,
(
IUnknown
*
)
imgl2
,
0
,
dx2
,
dy2
);
ok
(
SUCCEEDED
(
hr
),
"SetDragCursorImage failed for {%d, %d}{%d, %d}
\n
"
,
dx1
,
dy1
,
dx2
,
dy2
);
sprintf
(
loc
,
"SetDragCursorImage (%d,%d)
\n
"
,
i
,
j
);
/* check new hotspot, it should be the same like the old one */
hr
=
IImageList_GetDragImage
(
imgl2
,
NULL
,
&
ppt
,
&
IID_IImageList
,
(
PVOID
*
)
&
imglNew
);
ok
(
SUCCEEDED
(
hr
),
"GetDragImage failed
\n
"
);
ok
(
ppt
.
x
==
dx1
&&
ppt
.
y
==
dy1
,
"Expected drag hotspot [%d,%d] got [%d,%d]
\n
"
,
dx1
,
dy1
,
ppt
.
x
,
ppt
.
y
);
/* check size of new dragged image */
IImageList_GetIconSize
(
imglNew
,
&
newx
,
&
newy
);
correctx
=
max
(
SIZEX1
,
max
(
SIZEX2
+
dx2
,
SIZEX1
-
dx2
));
correcty
=
max
(
SIZEY1
,
max
(
SIZEY2
+
dy2
,
SIZEY1
-
dy2
));
ok
(
newx
==
correctx
&&
newy
==
correcty
,
"Expected drag image size [%d,%d] got [%d,%d]
\n
"
,
correctx
,
correcty
,
newx
,
newy
);
sprintf
(
loc
,
"GetDragImage (%d,%d)
\n
"
,
i
,
j
);
IImageList_EndDrag
(
imgl2
);
}
}
#undef SIZEX1
#undef SIZEY1
#undef SIZEX2
#undef SIZEY2
#undef HOTSPOTS_MAX
IImageList_Release
(
imgl2
);
IImageList_Release
(
imgl1
);
}
static
void
DoTest1_v6
(
void
)
{
IImageList
*
imgl
;
...
...
@@ -1571,6 +1646,8 @@ START_TEST(imagelist)
test_ImageList_DrawIndirect
();
test_shell_imagelist
();
test_iimagelist
();
testHotspot_v6
();
DoTest1_v6
();
DoTest3_v6
();
testMerge_v6
();
...
...
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