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
72186db5
Commit
72186db5
authored
Jan 29, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/tests: Add more tests for tab focus.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
69694d49
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
13 deletions
+57
-13
tab.c
dlls/comctl32/tests/tab.c
+57
-13
No files found.
dlls/comctl32/tests/tab.c
View file @
72186db5
...
@@ -215,6 +215,11 @@ static const struct message selchange_parent_seq[] = {
...
@@ -215,6 +215,11 @@ static const struct message selchange_parent_seq[] = {
{
0
}
{
0
}
};
};
static
const
struct
message
setfocus_parent_seq
[]
=
{
{
WM_NOTIFY
,
sent
|
id
,
0
,
0
,
TCN_FOCUSCHANGE
},
{
0
}
};
static
HWND
static
HWND
create_tabcontrol
(
DWORD
style
,
DWORD
mask
)
create_tabcontrol
(
DWORD
style
,
DWORD
mask
)
{
{
...
@@ -593,7 +598,7 @@ static void test_width(void)
...
@@ -593,7 +598,7 @@ static void test_width(void)
static
void
test_curfocus
(
void
)
static
void
test_curfocus
(
void
)
{
{
const
INT
nTabs
=
5
;
const
INT
nTabs
=
5
;
INT
focusIndex
;
INT
ret
;
HWND
hTab
;
HWND
hTab
;
hTab
=
createFilledTabControl
(
parent_wnd
,
TCS_FIXEDWIDTH
,
TCIF_TEXT
|
TCIF_IMAGE
,
nTabs
);
hTab
=
createFilledTabControl
(
parent_wnd
,
TCS_FIXEDWIDTH
,
TCIF_TEXT
|
TCIF_IMAGE
,
nTabs
);
...
@@ -602,24 +607,63 @@ static void test_curfocus(void)
...
@@ -602,24 +607,63 @@ static void test_curfocus(void)
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
/* Testing CurFocus with largest appropriate value */
/* Testing CurFocus with largest appropriate value */
SendMessageA
(
hTab
,
TCM_SETCURFOCUS
,
nTabs
-
1
,
0
);
ret
=
SendMessageA
(
hTab
,
TCM_SETCURFOCUS
,
nTabs
-
1
,
0
);
focusIndex
=
SendMessageA
(
hTab
,
TCM_GETCURFOCUS
,
0
,
0
);
ok
(
ret
==
0
,
"Unexpected ret value %d.
\n
"
,
ret
);
expect
(
nTabs
-
1
,
focusIndex
);
ret
=
SendMessageA
(
hTab
,
TCM_GETCURFOCUS
,
0
,
0
);
ok
(
ret
==
nTabs
-
1
,
"Unexpected focus index %d.
\n
"
,
ret
);
/* Testing CurFocus with negative value */
/* Testing CurFocus with negative value */
SendMessageA
(
hTab
,
TCM_SETCURFOCUS
,
-
10
,
0
);
ret
=
SendMessageA
(
hTab
,
TCM_SETCURFOCUS
,
-
10
,
0
);
focusIndex
=
SendMessageA
(
hTab
,
TCM_GETCURFOCUS
,
0
,
0
);
ok
(
ret
==
0
,
"Unexpected ret value %d.
\n
"
,
ret
);
expect
(
-
1
,
focusIndex
);
ret
=
SendMessageA
(
hTab
,
TCM_GETCURFOCUS
,
0
,
0
);
ok
(
ret
==
-
1
,
"Unexpected focus index %d.
\n
"
,
ret
);
/* Testing CurFocus with value larger than number of tabs */
/* Testing CurFocus with value larger than number of tabs */
focusIndex
=
SendMessageA
(
hTab
,
TCM_SETCURSEL
,
1
,
0
);
ret
=
SendMessageA
(
hTab
,
TCM_SETCURSEL
,
1
,
0
);
expect
(
-
1
,
focusIndex
);
ok
(
ret
==
-
1
,
"Unexpected focus index %d.
\n
"
,
ret
);
SendMessageA
(
hTab
,
TCM_SETCURFOCUS
,
nTabs
+
1
,
0
);
ret
=
SendMessageA
(
hTab
,
TCM_SETCURFOCUS
,
nTabs
+
1
,
0
);
focusIndex
=
SendMessageA
(
hTab
,
TCM_GETCURFOCUS
,
0
,
0
);
ok
(
ret
==
0
,
"Unexpected ret value %d.
\n
"
,
ret
);
expect
(
1
,
focusIndex
);
ret
=
SendMessageA
(
hTab
,
TCM_GETCURFOCUS
,
0
,
0
);
ok
(
ret
==
1
,
"Unexpected focus index %d.
\n
"
,
ret
);
ok_sequence
(
sequences
,
TAB_SEQ_INDEX
,
getset_cur_focus_seq
,
"Set focused tab sequence"
,
FALSE
);
ok_sequence
(
sequences
,
PARENT_SEQ_INDEX
,
empty_sequence
,
"Set focused tab parent sequence"
,
TRUE
);
DestroyWindow
(
hTab
);
/* TCS_BUTTONS */
hTab
=
createFilledTabControl
(
parent_wnd
,
TCS_BUTTONS
,
TCIF_TEXT
|
TCIF_IMAGE
,
nTabs
);
ok
(
hTab
!=
NULL
,
"Failed to create tab control
\n
"
);
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
/* Testing CurFocus with largest appropriate value */
ret
=
SendMessageA
(
hTab
,
TCM_SETCURFOCUS
,
nTabs
-
1
,
0
);
ok
(
ret
==
0
,
"Unexpected ret value %d.
\n
"
,
ret
);
ret
=
SendMessageA
(
hTab
,
TCM_GETCURFOCUS
,
0
,
0
);
ok
(
ret
==
nTabs
-
1
,
"Unexpected focus index %d.
\n
"
,
ret
);
/* Testing CurFocus with negative value */
ret
=
SendMessageA
(
hTab
,
TCM_SETCURFOCUS
,
-
10
,
0
);
ok
(
ret
==
0
,
"Unexpected ret value %d.
\n
"
,
ret
);
ret
=
SendMessageA
(
hTab
,
TCM_GETCURFOCUS
,
0
,
0
);
todo_wine
ok
(
ret
==
nTabs
-
1
,
"Unexpected focus index %d.
\n
"
,
ret
);
/* Testing CurFocus with value larger than number of tabs */
ret
=
SendMessageA
(
hTab
,
TCM_SETCURSEL
,
1
,
0
);
todo_wine
ok
(
ret
==
0
,
"Unexpected focus index %d.
\n
"
,
ret
);
ret
=
SendMessageA
(
hTab
,
TCM_SETCURFOCUS
,
nTabs
+
1
,
0
);
ok
(
ret
==
0
,
"Unexpected ret value %d.
\n
"
,
ret
);
ret
=
SendMessageA
(
hTab
,
TCM_GETCURFOCUS
,
0
,
0
);
todo_wine
ok
(
ret
==
nTabs
-
1
,
"Unexpected focus index %d.
\n
"
,
ret
);
ok_sequence
(
sequences
,
TAB_SEQ_INDEX
,
getset_cur_focus_seq
,
"Getset curFoc test sequence"
,
FALSE
);
ok_sequence
(
sequences
,
TAB_SEQ_INDEX
,
getset_cur_focus_seq
,
"TCS_BUTTONS: set focused tab sequence"
,
FALSE
);
ok_sequence
(
sequences
,
PARENT_SEQ_INDEX
,
setfocus_parent_seq
,
"TCS_BUTTONS: set focused tab parent sequence"
,
TRUE
);
DestroyWindow
(
hTab
);
DestroyWindow
(
hTab
);
}
}
...
...
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