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
025508f7
Commit
025508f7
authored
Apr 16, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 18, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/tests: Fix wrong use of HDM_GETITEM when getting item text.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7f9a3a9a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
14 deletions
+16
-14
header.c
dlls/comctl32/tests/header.c
+16
-14
No files found.
dlls/comctl32/tests/header.c
View file @
025508f7
...
...
@@ -1078,10 +1078,7 @@ static void test_hdm_bitmapmarginMessages(HWND hParent)
static
void
test_hdm_index_messages
(
HWND
hParent
)
{
HWND
hChild
;
int
retVal
;
int
loopcnt
;
int
strcmpResult
;
int
iSize
;
int
retVal
,
i
,
iSize
;
static
const
int
lpiarray
[
2
]
=
{
1
,
0
};
static
int
lpiarrayReceived
[
2
];
static
char
firstHeaderItem
[]
=
"Name"
;
...
...
@@ -1091,10 +1088,7 @@ static void test_hdm_index_messages(HWND hParent)
static
char
*
items
[]
=
{
firstHeaderItem
,
secondHeaderItem
,
thirdHeaderItem
,
fourthHeaderItem
};
RECT
rect
;
HDITEMA
hdItem
;
hdItem
.
mask
=
HDI_TEXT
|
HDI_WIDTH
|
HDI_FORMAT
;
hdItem
.
fmt
=
HDF_LEFT
;
hdItem
.
cxy
=
80
;
hdItem
.
cchTextMax
=
260
;
char
buffA
[
32
];
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
hChild
=
create_custom_header_control
(
hParent
,
FALSE
);
...
...
@@ -1105,11 +1099,15 @@ static void test_hdm_index_messages(HWND hParent)
ok_sequence
(
sequences
,
PARENT_SEQ_INDEX
,
add_header_to_parent_seq
,
"adder header control to parent"
,
FALSE
);
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
for
(
loopcnt
=
0
;
loopcnt
<
4
;
loopcnt
++
)
for
(
i
=
0
;
i
<
sizeof
(
items
)
/
sizeof
(
items
[
0
]);
i
++
)
{
hdItem
.
pszText
=
items
[
loopcnt
];
retVal
=
SendMessageA
(
hChild
,
HDM_INSERTITEMA
,
loopcnt
,
(
LPARAM
)
&
hdItem
);
ok
(
retVal
==
loopcnt
,
"Adding item %d failed with return value %d
\n
"
,
(
loopcnt
+
1
),
retVal
);
hdItem
.
mask
=
HDI_TEXT
|
HDI_WIDTH
|
HDI_FORMAT
;
hdItem
.
pszText
=
items
[
i
];
hdItem
.
fmt
=
HDF_LEFT
;
hdItem
.
cxy
=
80
;
retVal
=
SendMessageA
(
hChild
,
HDM_INSERTITEMA
,
i
,
(
LPARAM
)
&
hdItem
);
ok
(
retVal
==
i
,
"Adding item %d failed with return value %d
\n
"
,
i
,
retVal
);
}
ok_sequence
(
sequences
,
HEADER_SEQ_INDEX
,
insertItem_seq
,
"insertItem sequence testing"
,
FALSE
);
...
...
@@ -1135,17 +1133,21 @@ static void test_hdm_index_messages(HWND hParent)
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
hdItem
.
mask
=
HDI_WIDTH
;
retVal
=
SendMessageA
(
hChild
,
HDM_GETITEMA
,
3
,
(
LPARAM
)
&
hdItem
);
ok
(
retVal
==
FALSE
,
"Getting already-deleted item should return FALSE, got %d
\n
"
,
retVal
);
hdItem
.
mask
=
HDI_TEXT
|
HDI_WIDTH
;
hdItem
.
pszText
=
buffA
;
hdItem
.
cchTextMax
=
sizeof
(
buffA
)
/
sizeof
(
buffA
[
0
]);
retVal
=
SendMessageA
(
hChild
,
HDM_GETITEMA
,
0
,
(
LPARAM
)
&
hdItem
);
ok
(
retVal
==
TRUE
,
"Getting the 1st header item should return TRUE, got %d
\n
"
,
retVal
);
ok_sequence
(
sequences
,
HEADER_SEQ_INDEX
,
getItem_seq
,
"getItem sequence testing"
,
FALSE
);
/* check if the item is the right one */
strcmpResult
=
strcmp
(
hdItem
.
pszText
,
firstHeaderItem
);
expect
(
0
,
strcmpResult
);
ok
(
!
strcmp
(
hdItem
.
pszText
,
firstHeaderItem
),
"got wrong item %s, expected %s
\n
"
,
hdItem
.
pszText
,
firstHeaderItem
);
expect
(
80
,
hdItem
.
cxy
);
iSize
=
SendMessageA
(
hChild
,
HDM_GETITEMCOUNT
,
0
,
0
);
...
...
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