Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lucas pereira de Freitas
wine
Commits
390e1dfa
Commit
390e1dfa
authored
16 years ago
by
Mikołaj Zalewski
Committed by
Alexandre Julliard
16 years ago
Browse files
Options
Downloads
Patches
Plain Diff
comctl32: treeview: Add a test showing that a pszText of NULL is equivalent to LPSTR_CALLBACK.
parent
59a4a5d9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/comctl32/tests/treeview.c
+70
-0
70 additions, 0 deletions
dlls/comctl32/tests/treeview.c
with
70 additions
and
0 deletions
dlls/comctl32/tests/treeview.c
+
70
−
0
View file @
390e1dfa
...
...
@@ -32,6 +32,8 @@
#include
"wine/test.h"
#include
"msg.h"
const
char
*
TEST_CALLBACK_TEXT
=
"callback_text"
;
#define NUM_MSG_SEQUENCES 1
#define LISTVIEW_SEQ_INDEX 0
...
...
@@ -264,6 +266,64 @@ static void FillRoot(void)
ok
(
!
strcmp
(
sequence
,
"AB."
),
"Item creation
\n
"
);
}
static
void
TestCallback
(
void
)
{
HTREEITEM
hRoot
;
HTREEITEM
hItem1
,
hItem2
;
TVINSERTSTRUCTA
ins
;
TVITEM
tvi
;
CHAR
test_string
[]
=
"Test_string"
;
CHAR
buf
[
128
];
LRESULT
ret
;
TreeView_DeleteAllItems
(
hTree
);
ins
.
hParent
=
TVI_ROOT
;
ins
.
hInsertAfter
=
TVI_ROOT
;
U
(
ins
).
item
.
mask
=
TVIF_TEXT
;
U
(
ins
).
item
.
pszText
=
LPSTR_TEXTCALLBACK
;
hRoot
=
TreeView_InsertItem
(
hTree
,
&
ins
);
assert
(
hRoot
);
tvi
.
hItem
=
hRoot
;
tvi
.
mask
=
TVIF_TEXT
;
tvi
.
pszText
=
buf
;
tvi
.
cchTextMax
=
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]);
ret
=
TreeView_GetItem
(
hTree
,
&
tvi
);
ok
(
ret
==
1
,
"ret"
);
ok
(
strcmp
(
tvi
.
pszText
,
TEST_CALLBACK_TEXT
)
==
0
,
"Callback item text mismatch %s vs %s
\n
"
,
tvi
.
pszText
,
TEST_CALLBACK_TEXT
);
ins
.
hParent
=
hRoot
;
ins
.
hInsertAfter
=
TVI_FIRST
;
U
(
ins
).
item
.
mask
=
TVIF_TEXT
;
U
(
ins
).
item
.
pszText
=
test_string
;
hItem1
=
TreeView_InsertItem
(
hTree
,
&
ins
);
assert
(
hItem1
);
tvi
.
hItem
=
hItem1
;
TreeView_GetItem
(
hTree
,
&
tvi
);
ok
(
strcmp
(
tvi
.
pszText
,
test_string
)
==
0
,
"Item text mismatch %s vs %s
\n
"
,
tvi
.
pszText
,
test_string
);
/* undocumented: pszText of NULL also means LPSTR_CALLBACK: */
tvi
.
pszText
=
NULL
;
ret
=
TreeView_SetItem
(
hTree
,
&
tvi
);
ok
(
ret
==
1
,
"Expected SetItem return 1, got %ld
\n
"
,
ret
);
tvi
.
pszText
=
buf
;
TreeView_GetItem
(
hTree
,
&
tvi
);
todo_wine
ok
(
strcmp
(
tvi
.
pszText
,
TEST_CALLBACK_TEXT
)
==
0
,
"Item text mismatch %s vs %s
\n
"
,
tvi
.
pszText
,
TEST_CALLBACK_TEXT
);
U
(
ins
).
item
.
pszText
=
NULL
;
hItem2
=
TreeView_InsertItem
(
hTree
,
&
ins
);
assert
(
hItem2
);
tvi
.
hItem
=
hItem2
;
memset
(
buf
,
0
,
sizeof
(
buf
));
TreeView_GetItem
(
hTree
,
&
tvi
);
todo_wine
ok
(
strcmp
(
tvi
.
pszText
,
TEST_CALLBACK_TEXT
)
==
0
,
"Item text mismatch %s vs %s
\n
"
,
tvi
.
pszText
,
TEST_CALLBACK_TEXT
);
}
static
void
DoTest1
(
void
)
{
BOOL
r
;
...
...
@@ -664,6 +724,13 @@ static LRESULT CALLBACK MyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa
IdentifyItem
(
pTreeView
->
itemOld
.
hItem
);
IdentifyItem
(
pTreeView
->
itemNew
.
hItem
);
return
0
;
case
TVN_GETDISPINFOA
:
{
NMTVDISPINFOA
*
disp
=
(
NMTVDISPINFOA
*
)
lParam
;
if
(
disp
->
item
.
mask
&
TVIF_TEXT
)
{
lstrcpyn
(
disp
->
item
.
pszText
,
TEST_CALLBACK_TEXT
,
disp
->
item
.
cchTextMax
);
}
return
0
;
}
}
}
return
0
;
...
...
@@ -746,6 +813,9 @@ START_TEST(treeview)
/* Sequences tested inside due to number */
TestGetSet
();
/* Clears all the previous items */
TestCallback
();
PostMessageA
(
hMainWnd
,
WM_CLOSE
,
0
,
0
);
while
(
GetMessageA
(
&
msg
,
0
,
0
,
0
))
{
TranslateMessage
(
&
msg
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment