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
6711780a
Commit
6711780a
authored
Jul 26, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 26, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/tests: Merge one test function to existing tests, use explicit message numbers.
parent
16dfb1a0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
38 deletions
+37
-38
treeview.c
dlls/comctl32/tests/treeview.c
+37
-38
No files found.
dlls/comctl32/tests/treeview.c
View file @
6711780a
...
...
@@ -70,8 +70,8 @@ static const struct message rootchild_select_seq[] = {
};
static
const
struct
message
getitemtext_seq
[]
=
{
{
TVM_INSERTITEM
,
sent
},
{
TVM_GETITEM
,
sent
},
{
TVM_INSERTITEM
A
,
sent
},
{
TVM_GETITEM
A
,
sent
},
{
TVM_DELETEITEM
,
sent
},
{
0
}
};
...
...
@@ -134,10 +134,10 @@ static const struct message test_get_set_insertmarkcolor_seq[] = {
};
static
const
struct
message
test_get_set_item_seq
[]
=
{
{
TVM_GETITEM
,
sent
},
{
TVM_SETITEM
,
sent
},
{
TVM_GETITEM
,
sent
},
{
TVM_SETITEM
,
sent
},
{
TVM_GETITEM
A
,
sent
},
{
TVM_SETITEM
A
,
sent
},
{
TVM_GETITEM
A
,
sent
},
{
TVM_SETITEM
A
,
sent
},
{
0
}
};
...
...
@@ -187,8 +187,8 @@ static const struct message test_get_set_unicodeformat_seq[] = {
};
static
const
struct
message
parent_expand_seq
[]
=
{
{
WM_NOTIFY
,
sent
|
id
,
0
,
0
,
TVN_ITEMEXPANDING
},
{
WM_NOTIFY
,
sent
|
id
,
0
,
0
,
TVN_ITEMEXPANDED
},
{
WM_NOTIFY
,
sent
|
id
,
0
,
0
,
TVN_ITEMEXPANDING
A
},
{
WM_NOTIFY
,
sent
|
id
,
0
,
0
,
TVN_ITEMEXPANDED
A
},
{
0
}
};
...
...
@@ -302,7 +302,7 @@ static void fill_tree(HWND hTree)
static
void
test_fillroot
(
void
)
{
TVITEM
tvi
;
TVITEM
A
tvi
;
HWND
hTree
;
hTree
=
create_treeview_control
();
...
...
@@ -323,7 +323,7 @@ static void test_fillroot(void)
/* UMLPad 1.15 depends on this being not -1 (I_IMAGECALLBACK) */
tvi
.
hItem
=
hRoot
;
tvi
.
mask
=
TVIF_IMAGE
|
TVIF_SELECTEDIMAGE
;
SendMessage
(
hTree
,
TVM_GETITEM
,
0
,
(
LPARAM
)
&
tvi
);
SendMessage
(
hTree
,
TVM_GETITEM
A
,
0
,
(
LPARAM
)
&
tvi
);
ok
(
tvi
.
iImage
==
0
,
"tvi.iImage=%d
\n
"
,
tvi
.
iImage
);
ok
(
tvi
.
iSelectedImage
==
0
,
"tvi.iSelectedImage=%d
\n
"
,
tvi
.
iSelectedImage
);
...
...
@@ -335,7 +335,7 @@ static void test_callback(void)
HTREEITEM
hRoot
;
HTREEITEM
hItem1
,
hItem2
;
TVINSERTSTRUCTA
ins
;
TVITEM
tvi
;
TVITEM
A
tvi
;
CHAR
test_string
[]
=
"Test_string"
;
CHAR
buf
[
128
];
LRESULT
ret
;
...
...
@@ -464,7 +464,7 @@ static void test_getitemtext(void)
{
TVINSERTSTRUCTA
ins
;
HTREEITEM
hChild
;
TVITEM
tvi
;
TVITEM
A
tvi
;
HWND
hTree
;
CHAR
szBuffer
[
80
]
=
"Blah"
;
...
...
@@ -490,7 +490,7 @@ static void test_getitemtext(void)
tvi
.
cchTextMax
=
nBufferSize
;
tvi
.
pszText
=
szBuffer
;
SendMessageA
(
hTree
,
TVM_GETITEM
,
0
,
(
LPARAM
)
&
tvi
);
SendMessageA
(
hTree
,
TVM_GETITEM
A
,
0
,
(
LPARAM
)
&
tvi
);
ok
(
!
strcmp
(
szBuffer
,
""
),
"szBuffer=
\"
%s
\"
, expected
\"\"\n
"
,
szBuffer
);
ok
(
SendMessageA
(
hTree
,
TVM_DELETEITEM
,
0
,
(
LPARAM
)
hChild
),
"DeleteItem failed
\n
"
);
ok_sequence
(
sequences
,
TREEVIEW_SEQ_INDEX
,
getitemtext_seq
,
"get item text seq"
,
FALSE
);
...
...
@@ -645,7 +645,7 @@ static void test_get_set_insertmark(void)
static
void
test_get_set_item
(
void
)
{
TVITEM
tviRoot
=
{
0
};
TVITEM
A
tviRoot
=
{
0
};
int
nBufferSize
=
80
;
char
szBuffer
[
80
]
=
{
0
};
HWND
hTree
;
...
...
@@ -660,20 +660,20 @@ static void test_get_set_item(void)
tviRoot
.
mask
=
TVIF_TEXT
;
tviRoot
.
cchTextMax
=
nBufferSize
;
tviRoot
.
pszText
=
szBuffer
;
SendMessage
(
hTree
,
TVM_GETITEM
,
0
,
(
LPARAM
)
&
tviRoot
);
SendMessage
(
hTree
,
TVM_GETITEM
A
,
0
,
(
LPARAM
)
&
tviRoot
);
ok
(
!
strcmp
(
"Root"
,
szBuffer
),
"GetItem: szBuffer=
\"
%s
\"
, expected
\"
Root
\"\n
"
,
szBuffer
);
/* Change the root text */
strncpy
(
szBuffer
,
"Testing123"
,
nBufferSize
);
SendMessage
(
hTree
,
TVM_SETITEM
,
0
,
(
LPARAM
)
&
tviRoot
);
SendMessage
(
hTree
,
TVM_SETITEM
A
,
0
,
(
LPARAM
)
&
tviRoot
);
memset
(
szBuffer
,
0
,
nBufferSize
);
SendMessage
(
hTree
,
TVM_GETITEM
,
0
,
(
LPARAM
)
&
tviRoot
);
SendMessage
(
hTree
,
TVM_GETITEM
A
,
0
,
(
LPARAM
)
&
tviRoot
);
ok
(
!
strcmp
(
"Testing123"
,
szBuffer
),
"GetItem: szBuffer=
\"
%s
\"
, expected
\"
Testing123
\"\n
"
,
szBuffer
);
/* Reset the root text */
memset
(
szBuffer
,
0
,
nBufferSize
);
strncpy
(
szBuffer
,
"Root"
,
nBufferSize
);
SendMessage
(
hTree
,
TVM_SETITEM
,
0
,
(
LPARAM
)
&
tviRoot
);
SendMessage
(
hTree
,
TVM_SETITEM
A
,
0
,
(
LPARAM
)
&
tviRoot
);
ok_sequence
(
sequences
,
TREEVIEW_SEQ_INDEX
,
test_get_set_item_seq
,
"test get set item"
,
FALSE
);
...
...
@@ -889,7 +889,7 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hWnd, UINT message, WPARAM wParam,
break
;
}
case
TVN_ENDLABELEDIT
:
return
TRUE
;
case
TVN_ITEMEXPANDING
:
case
TVN_ITEMEXPANDING
A
:
ok
(
pTreeView
->
itemNew
.
mask
==
(
TVIF_HANDLE
|
TVIF_SELECTEDIMAGE
|
TVIF_IMAGE
|
TVIF_PARAM
|
TVIF_STATE
),
"got wrong mask %x
\n
"
,
pTreeView
->
itemNew
.
mask
);
...
...
@@ -906,7 +906,7 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hWnd, UINT message, WPARAM wParam,
ok
(
ret
==
TRUE
,
"got %lu
\n
"
,
ret
);
}
break
;
case
TVN_ITEMEXPANDED
:
case
TVN_ITEMEXPANDED
A
:
ok
(
pTreeView
->
itemNew
.
mask
&
TVIF_STATE
,
"got wrong mask %x
\n
"
,
pTreeView
->
itemNew
.
mask
);
ok
(
pTreeView
->
itemNew
.
state
&
(
TVIS_EXPANDED
|
TVIS_EXPANDEDONCE
),
"got wrong mask %x
\n
"
,
pTreeView
->
itemNew
.
mask
);
...
...
@@ -920,7 +920,8 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hWnd, UINT message, WPARAM wParam,
ret
=
SendMessageA
(
pHdr
->
hwndFrom
,
TVM_GETITEMA
,
0
,
(
LPARAM
)
&
g_item_expanded
);
ok
(
ret
==
TRUE
,
"got %lu
\n
"
,
ret
);
}
if
(
g_get_rect_in_expand
)
{
if
(
g_get_rect_in_expand
)
{
visibleItem
=
TreeView_GetNextItem
(
pHdr
->
hwndFrom
,
NULL
,
TVGN_FIRSTVISIBLE
);
ok
(
pTreeView
->
itemNew
.
hItem
==
visibleItem
,
"expanded item == first visible item
\n
"
);
*
(
HTREEITEM
*
)
&
rect
=
visibleItem
;
...
...
@@ -1082,7 +1083,7 @@ static void test_itemedit(void)
item
.
hItem
=
hRoot
;
item
.
pszText
=
buff
;
item
.
cchTextMax
=
sizeof
(
buff
)
/
sizeof
(
CHAR
);
r
=
SendMessage
(
hTree
,
TVM_GETITEM
,
0
,
(
LPARAM
)
&
item
);
r
=
SendMessage
(
hTree
,
TVM_GETITEM
A
,
0
,
(
LPARAM
)
&
item
);
expect
(
TRUE
,
r
);
ok
(
!
strcmp
(
"x"
,
buff
),
"Expected item text to change
\n
"
);
...
...
@@ -1188,22 +1189,20 @@ static void test_expandnotify(void)
ok_sequence
(
sequences
,
PARENT_SEQ_INDEX
,
empty_seq
,
"collapse after expand notifications"
,
FALSE
);
DestroyWindow
(
hTree
);
}
static
void
test_rect_retrieval_after_expand_with_select
(
void
)
{
BOOL
ret
;
HWND
hTree
;
hTree
=
create_treeview_control
();
fill_tree
(
hTree
);
g_get_rect_in_expand
=
TRUE
;
ret
=
TreeView_Select
(
hTree
,
hChild
,
TVGN_CARET
);
g_get_rect_in_expand
=
FALSE
;
ok
(
ret
,
"TreeView_Select should return true
\n
"
);
/* test TVM_GETITEMRECT inside TVN_ITEMEXPANDED notification */
hTree
=
create_treeview_control
();
fill_tree
(
hTree
);
g_get_rect_in_expand
=
TRUE
;
ret
=
TreeView_Select
(
hTree
,
hChild
,
TVGN_CARET
);
g_get_rect_in_expand
=
FALSE
;
ok
(
ret
,
"got %d
\n
"
,
ret
);
DestroyWindow
(
hTree
);
}
static
void
test_expandedimage
(
void
)
{
TVITEMEX
item
;
TVITEMEX
A
item
;
HWND
hTree
;
BOOL
ret
;
...
...
@@ -1213,13 +1212,13 @@ static void test_expandedimage(void)
item
.
mask
=
TVIF_EXPANDEDIMAGE
;
item
.
iExpandedImage
=
1
;
item
.
hItem
=
hRoot
;
ret
=
SendMessageA
(
hTree
,
TVM_SETITEM
,
0
,
(
LPARAM
)
&
item
);
ret
=
SendMessageA
(
hTree
,
TVM_SETITEM
A
,
0
,
(
LPARAM
)
&
item
);
ok
(
ret
,
"got %d
\n
"
,
ret
);
item
.
mask
=
TVIF_EXPANDEDIMAGE
;
item
.
iExpandedImage
=
-
1
;
item
.
hItem
=
hRoot
;
ret
=
SendMessageA
(
hTree
,
TVM_GETITEM
,
0
,
(
LPARAM
)
&
item
);
ret
=
SendMessageA
(
hTree
,
TVM_GETITEM
A
,
0
,
(
LPARAM
)
&
item
);
ok
(
ret
,
"got %d
\n
"
,
ret
);
if
(
item
.
iExpandedImage
!=
1
)
...
...
@@ -1233,7 +1232,7 @@ static void test_expandedimage(void)
item
.
mask
=
TVIF_EXPANDEDIMAGE
;
item
.
iExpandedImage
=
-
1
;
item
.
hItem
=
hChild
;
ret
=
SendMessageA
(
hTree
,
TVM_GETITEM
,
0
,
(
LPARAM
)
&
item
);
ret
=
SendMessageA
(
hTree
,
TVM_GETITEM
A
,
0
,
(
LPARAM
)
&
item
);
ok
(
ret
,
"got %d
\n
"
,
ret
);
ok
(
item
.
iExpandedImage
==
(
WORD
)
I_IMAGENONE
,
"got %d
\n
"
,
item
.
iExpandedImage
);
...
...
@@ -1323,7 +1322,6 @@ START_TEST(treeview)
test_itemedit
();
test_treeview_classinfo
();
test_expandnotify
();
test_rect_retrieval_after_expand_with_select
();
test_TVS_SINGLEEXPAND
();
if
(
!
load_v6_module
(
&
ctx_cookie
,
&
hCtx
))
...
...
@@ -1353,7 +1351,8 @@ START_TEST(treeview)
unload_v6_module
(
ctx_cookie
,
hCtx
);
PostMessageA
(
hMainWnd
,
WM_CLOSE
,
0
,
0
);
while
(
GetMessageA
(
&
msg
,
0
,
0
,
0
))
{
while
(
GetMessageA
(
&
msg
,
0
,
0
,
0
))
{
TranslateMessage
(
&
msg
);
DispatchMessageA
(
&
msg
);
}
...
...
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