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
2c0f6d96
Commit
2c0f6d96
authored
Feb 28, 2018
by
Piotr Caban
Committed by
Alexandre Julliard
Mar 01, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/tests: Add listbox WM_MEASUREITEM tests.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0bb2cb3d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
listbox.c
dlls/comctl32/tests/listbox.c
+55
-0
No files found.
dlls/comctl32/tests/listbox.c
View file @
2c0f6d96
...
...
@@ -43,6 +43,15 @@ static const char * const strings[4] = {
static
const
char
BAD_EXTENSION
[]
=
"*.badtxt"
;
static
int
strcmp_aw
(
LPCWSTR
strw
,
const
char
*
stra
)
{
WCHAR
buf
[
1024
];
if
(
!
stra
)
return
1
;
MultiByteToWideChar
(
CP_ACP
,
0
,
stra
,
-
1
,
buf
,
sizeof
(
buf
)
/
sizeof
(
WCHAR
));
return
lstrcmpW
(
strw
,
buf
);
}
static
HWND
create_listbox
(
DWORD
add_style
,
HWND
parent
)
{
INT_PTR
ctl_id
=
0
;
...
...
@@ -229,6 +238,31 @@ static LRESULT WINAPI main_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA
{
switch
(
msg
)
{
case
WM_MEASUREITEM
:
{
DWORD
style
=
GetWindowLongA
(
GetWindow
(
hwnd
,
GW_CHILD
),
GWL_STYLE
);
MEASUREITEMSTRUCT
*
mi
=
(
void
*
)
lparam
;
ok
(
wparam
==
mi
->
CtlID
,
"got wParam=%08lx, expected %08x
\n
"
,
wparam
,
mi
->
CtlID
);
ok
(
mi
->
CtlType
==
ODT_LISTBOX
,
"mi->CtlType = %u
\n
"
,
mi
->
CtlType
);
ok
(
mi
->
CtlID
==
1
,
"mi->CtlID = %u
\n
"
,
mi
->
CtlID
);
ok
(
mi
->
itemHeight
,
"mi->itemHeight = 0
\n
"
);
if
(
mi
->
itemID
>
4
||
style
&
LBS_OWNERDRAWFIXED
)
break
;
if
(
style
&
LBS_HASSTRINGS
)
{
ok
(
!
strcmp_aw
((
WCHAR
*
)
mi
->
itemData
,
strings
[
mi
->
itemID
]),
"mi->itemData = %s (%d)
\n
"
,
wine_dbgstr_w
((
WCHAR
*
)
mi
->
itemData
),
mi
->
itemID
);
}
else
{
ok
((
void
*
)
mi
->
itemData
==
strings
[
mi
->
itemID
],
"mi->itemData = %08lx, expected %p
\n
"
,
mi
->
itemData
,
strings
[
mi
->
itemID
]);
}
break
;
}
case
WM_DRAWITEM
:
{
RECT
rc_item
,
rc_client
,
rc_clip
;
...
...
@@ -1837,6 +1871,26 @@ static void test_listbox(void)
run_test
(
EMS_NS
);
}
static
void
test_WM_MEASUREITEM
(
void
)
{
HWND
parent
,
listbox
;
LRESULT
data
;
parent
=
create_parent
();
listbox
=
create_listbox
(
WS_CHILD
|
LBS_OWNERDRAWVARIABLE
,
parent
);
data
=
SendMessageA
(
listbox
,
LB_GETITEMDATA
,
0
,
0
);
ok
(
data
==
(
LRESULT
)
strings
[
0
],
"data = %08lx, expected %p
\n
"
,
data
,
strings
[
0
]);
DestroyWindow
(
parent
);
parent
=
create_parent
();
listbox
=
create_listbox
(
WS_CHILD
|
LBS_OWNERDRAWVARIABLE
|
LBS_HASSTRINGS
,
parent
);
data
=
SendMessageA
(
listbox
,
LB_GETITEMDATA
,
0
,
0
);
ok
(
!
data
,
"data = %08lx
\n
"
,
data
);
DestroyWindow
(
parent
);
}
START_TEST
(
listbox
)
{
ULONG_PTR
ctx_cookie
;
...
...
@@ -1859,6 +1913,7 @@ START_TEST(listbox)
test_GetListBoxInfo
();
test_missing_lbuttonup
();
test_extents
();
test_WM_MEASUREITEM
();
unload_v6_module
(
ctx_cookie
,
hCtx
);
}
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