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
1f051b8a
Commit
1f051b8a
authored
May 19, 2008
by
Tomasz Jezierski
Committed by
Alexandre Julliard
May 21, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Conformance test for multiple selection in listbox.
parent
5315da84
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
76 additions
and
0 deletions
+76
-0
listview.c
dlls/comctl32/tests/listview.c
+76
-0
No files found.
dlls/comctl32/tests/listview.c
View file @
1f051b8a
...
...
@@ -1127,6 +1127,81 @@ static void test_getorigin(void)
}
static
void
test_multiselect
(
void
)
{
typedef
struct
t_select_task
{
const
char
*
descr
;
int
initPos
;
int
loopVK
;
int
count
;
int
result
;
}
select_task
;
HWND
hwnd
;
DWORD
r
;
int
i
,
j
,
item_count
,
selected_count
;
static
const
int
items
=
5
;
BYTE
kstate
[
256
];
select_task
task
;
static
struct
t_select_task
task_list
[]
=
{
{
"using VK_DOWN"
,
0
,
VK_DOWN
,
-
1
,
-
1
},
{
"using VK_UP"
,
-
1
,
VK_UP
,
-
1
,
-
1
},
{
"using VK_END"
,
0
,
VK_END
,
1
,
-
1
},
{
"using VK_HOME"
,
-
1
,
VK_HOME
,
1
,
-
1
}
};
hwnd
=
create_listview_control
();
for
(
i
=
0
;
i
<
items
;
i
++
)
{
insert_item
(
hwnd
,
0
);
}
item_count
=
(
int
)
SendMessage
(
hwnd
,
LVM_GETITEMCOUNT
,
0
,
0
);
expect
(
items
,
item_count
);
for
(
i
=
0
;
i
<
4
;
i
++
)
{
task
=
task_list
[
i
];
/* deselect all items */
ListView_SetItemState
(
hwnd
,
-
1
,
0
,
LVIS_SELECTED
);
SendMessage
(
hwnd
,
LVM_SETSELECTIONMARK
,
0
,
-
1
);
/* set initial position */
SendMessage
(
hwnd
,
LVM_SETSELECTIONMARK
,
0
,
(
task
.
initPos
==
-
1
?
item_count
:
task
.
initPos
));
ListView_SetItemState
(
hwnd
,(
task
.
initPos
==
-
1
?
item_count
-
1
:
task
.
initPos
),
LVIS_SELECTED
,
LVIS_SELECTED
);
selected_count
=
(
int
)
SendMessage
(
hwnd
,
LVM_GETSELECTEDCOUNT
,
0
,
0
);
ok
(
selected_count
==
1
,
"There should be only one selected item at the begining (is %d)
\n
"
,
selected_count
);
/* Set SHIFT key pressed */
GetKeyboardState
(
kstate
);
kstate
[
VK_SHIFT
]
=
0x80
;
SetKeyboardState
(
kstate
);
for
(
j
=
1
;
j
<=
(
task
.
count
==
-
1
?
item_count
:
task
.
count
);
j
++
)
{
r
=
SendMessage
(
hwnd
,
WM_KEYDOWN
,
task
.
loopVK
,
0
);
expect
(
0
,
r
);
r
=
SendMessage
(
hwnd
,
WM_KEYUP
,
task
.
loopVK
,
0
);
expect
(
0
,
r
);
}
selected_count
=
(
int
)
SendMessage
(
hwnd
,
LVM_GETSELECTEDCOUNT
,
0
,
0
);
ok
((
task
.
result
==
-
1
?
item_count
:
task
.
result
)
==
selected_count
,
"Failed multiple selection %s. There should be %d selected items (is %d)
\n
"
,
task
.
descr
,
item_count
,
selected_count
);
/* Set SHIFT key released */
GetKeyboardState
(
kstate
);
kstate
[
VK_SHIFT
]
=
0x00
;
SetKeyboardState
(
kstate
);
}
DestroyWindow
(
hwnd
);
}
START_TEST
(
listview
)
{
HMODULE
hComctl32
;
...
...
@@ -1163,4 +1238,5 @@ START_TEST(listview)
test_item_position
();
test_columns
();
test_getorigin
();
test_multiselect
();
}
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