Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
69694d49
Commit
69694d49
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: Run Header format mask tests on version 6.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
de4f1783
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
44 deletions
+67
-44
header.c
dlls/comctl32/tests/header.c
+67
-44
No files found.
dlls/comctl32/tests/header.c
View file @
69694d49
...
...
@@ -535,58 +535,79 @@ static HWND create_custom_header_control(HWND hParent, BOOL preloadHeaderItems)
return
childHandle
;
}
static
void
check_auto_format
(
void
)
static
void
header_item_getback
(
HWND
hwnd
,
UINT
mask
,
HDITEMA
*
item
)
{
HDITEMA
hdiCreate
;
HDITEMA
hdiRead
;
static
CHAR
text
[]
=
"Test"
;
ZeroMemory
(
&
hdiCreate
,
sizeof
(
HDITEMA
));
int
ret
;
/* Windows implicitly sets some format bits in INSERTITEM */
ret
=
SendMessageA
(
hwnd
,
HDM_INSERTITEMA
,
0
,
(
LPARAM
)
item
);
ok
(
ret
!=
-
1
,
"Failed to add header item.
\n
"
);
/* HDF_STRING is automatically set and cleared for no text */
hdiCreate
.
mask
=
HDI_TEXT
|
HDI_WIDTH
|
HDI_FORMAT
;
hdiCreate
.
pszText
=
text
;
hdiCreate
.
cxy
=
100
;
hdiCreate
.
fmt
=
HDF_CENTER
;
addReadDelItem
(
hWndHeader
,
&
hdiCreate
,
HDI_FORMAT
,
&
hdiRead
);
ok
(
hdiRead
.
fmt
==
(
HDF_STRING
|
HDF_CENTER
),
"HDF_STRING not set automatically (fmt=%x)
\n
"
,
hdiRead
.
fmt
);
memset
(
item
,
0
,
sizeof
(
*
item
));
item
->
mask
=
mask
;
hdiCreate
.
mask
=
HDI_WIDTH
|
HDI_FORMAT
;
hdiCreate
.
pszText
=
text
;
hdiCreate
.
fmt
=
HDF_CENTER
|
HDF_STRING
;
addReadDelItem
(
hWndHeader
,
&
hdiCreate
,
HDI_FORMAT
,
&
hdiRead
);
ok
(
hdiRead
.
fmt
==
(
HDF_CENTER
),
"HDF_STRING should be automatically cleared (fmt=%x)
\n
"
,
hdiRead
.
fmt
);
ret
=
SendMessageA
(
hwnd
,
HDM_GETITEMA
,
0
,
(
LPARAM
)
item
)
;
ok
(
ret
!=
0
,
"Failed to get item data.
\n
"
)
;
ret
=
SendMessageA
(
hwnd
,
HDM_DELETEITEM
,
0
,
0
)
;
ok
(
ret
!=
0
,
"Failed to delete item.
\n
"
);
}
/* HDF_BITMAP is automatically set and cleared for a NULL bitmap or no bitmap */
hdiCreate
.
mask
=
HDI_BITMAP
|
HDI_WIDTH
|
HDI_FORMAT
;
hdiCreate
.
hbm
=
CreateBitmap
(
16
,
16
,
1
,
8
,
NULL
);
hdiCreate
.
fmt
=
HDF_CENTER
;
addReadDelItem
(
hWndHeader
,
&
hdiCreate
,
HDI_FORMAT
,
&
hdiRead
);
ok
(
hdiRead
.
fmt
==
(
HDF_BITMAP
|
HDF_CENTER
),
"HDF_BITMAP not set automatically (fmt=%x)
\n
"
,
hdiRead
.
fmt
);
DeleteObject
(
hdiCreate
.
hbm
);
static
void
test_item_auto_format
(
HWND
parent
)
{
static
char
text
[]
=
"Test"
;
HDITEMA
item
;
HBITMAP
hbm
;
HWND
hwnd
;
hdiCreate
.
hbm
=
NULL
;
hdiCreate
.
fmt
=
HDF_CENTER
|
HDF_BITMAP
;
addReadDelItem
(
hWndHeader
,
&
hdiCreate
,
HDI_FORMAT
,
&
hdiRead
);
ok
(
hdiRead
.
fmt
==
HDF_CENTER
,
"HDF_BITMAP not cleared automatically for NULL bitmap (fmt=%x)
\n
"
,
hdiRead
.
fmt
);
hwnd
=
create_custom_header_control
(
parent
,
FALSE
);
hdiCreate
.
mask
=
HDI_WIDTH
|
HDI_FORMAT
;
hdiCreate
.
fmt
=
HDF_CENTER
|
HDF_BITMAP
;
addReadDelItem
(
hWndHeader
,
&
hdiCreate
,
HDI_FORMAT
,
&
hdiRead
);
ok
(
hdiRead
.
fmt
==
HDF_CENTER
,
"HDF_BITMAP not cleared automatically for no bitmap (fmt=%x)
\n
"
,
hdiRead
.
fmt
);
/* Windows implicitly sets some format bits in INSERTITEM */
/* HDF_STRING is automatically set and cleared for no text */
item
.
mask
=
HDI_TEXT
|
HDI_WIDTH
|
HDI_FORMAT
;
item
.
pszText
=
text
;
item
.
cxy
=
100
;
item
.
fmt
=
HDF_CENTER
;
header_item_getback
(
hwnd
,
HDI_FORMAT
,
&
item
);
ok
(
item
.
fmt
==
(
HDF_STRING
|
HDF_CENTER
),
"Unexpected item format mask %#x.
\n
"
,
item
.
fmt
);
item
.
mask
=
HDI_WIDTH
|
HDI_FORMAT
;
item
.
pszText
=
text
;
item
.
fmt
=
HDF_CENTER
|
HDF_STRING
;
header_item_getback
(
hwnd
,
HDI_FORMAT
,
&
item
);
ok
(
item
.
fmt
==
HDF_CENTER
,
"Unexpected item format mask %#x.
\n
"
,
item
.
fmt
);
/* HDF_BITMAP is automatically set and cleared for a NULL bitmap or no bitmap */
item
.
mask
=
HDI_BITMAP
|
HDI_WIDTH
|
HDI_FORMAT
;
item
.
hbm
=
hbm
=
CreateBitmap
(
16
,
16
,
1
,
8
,
NULL
);
item
.
fmt
=
HDF_CENTER
;
header_item_getback
(
hwnd
,
HDI_FORMAT
,
&
item
);
ok
(
item
.
fmt
==
(
HDF_BITMAP
|
HDF_CENTER
),
"Unexpected item format mask %#x.
\n
"
,
item
.
fmt
);
DeleteObject
(
hbm
);
item
.
mask
=
HDI_BITMAP
|
HDI_WIDTH
|
HDI_FORMAT
;
item
.
hbm
=
NULL
;
item
.
fmt
=
HDF_CENTER
|
HDF_BITMAP
;
header_item_getback
(
hwnd
,
HDI_FORMAT
,
&
item
);
ok
(
item
.
fmt
==
HDF_CENTER
,
"Unexpected item format mask %#x.
\n
"
,
item
.
fmt
);
item
.
mask
=
HDI_WIDTH
|
HDI_FORMAT
;
item
.
fmt
=
HDF_CENTER
|
HDF_BITMAP
;
header_item_getback
(
hwnd
,
HDI_FORMAT
,
&
item
);
ok
(
item
.
fmt
==
HDF_CENTER
,
"Unexpected item format mask %#x.
\n
"
,
item
.
fmt
);
/* HDF_IMAGE is automatically set but not cleared */
hdiCreate
.
mask
=
HDI_IMAGE
|
HDI_WIDTH
|
HDI_FORMAT
;
hdiCreate
.
iImage
=
17
;
addReadDelItem
(
hWndHeader
,
&
hdiCreate
,
HDI_FORMAT
,
&
hdiRead
);
ok
(
hdiRead
.
fmt
==
(
HDF_IMAGE
|
HDF_CENTER
),
"HDF_IMAGE not set automatically (fmt=%x)
\n
"
,
hdiRead
.
fmt
);
item
.
mask
=
HDI_IMAGE
|
HDI_WIDTH
|
HDI_FORMAT
;
item
.
iImage
=
17
;
header_item_getback
(
hwnd
,
HDI_FORMAT
,
&
item
);
ok
(
item
.
fmt
==
(
HDF_IMAGE
|
HDF_CENTER
),
"Unexpected item format mask %#x.
\n
"
,
item
.
fmt
);
hdiCreate
.
mask
=
HDI_WIDTH
|
HDI_FORMAT
;
hdiCreate
.
fmt
=
HDF_CENTER
|
HDF_IMAGE
;
hdiCreate
.
iImage
=
0
;
addReadDelItem
(
hWndHeader
,
&
hdiCreate
,
HDI_FORMAT
,
&
hdiRead
);
ok
(
hdiRead
.
fmt
==
(
HDF_CENTER
|
HDF_IMAGE
),
"HDF_IMAGE shouldn't be cleared automatically (fmt=%x)
\n
"
,
hdiRead
.
fmt
);
item
.
mask
=
HDI_WIDTH
|
HDI_FORMAT
;
item
.
fmt
=
HDF_CENTER
|
HDF_IMAGE
;
item
.
iImage
=
0
;
header_item_getback
(
hwnd
,
HDI_FORMAT
,
&
item
);
ok
(
item
.
fmt
==
(
HDF_CENTER
|
HDF_IMAGE
),
"Unexpected item format mask %#x.
\n
"
,
item
.
fmt
);
DestroyWindow
(
hwnd
);
}
static
void
check_auto_fields
(
void
)
...
...
@@ -768,7 +789,6 @@ static void test_header_control (void)
/* unexpected notifies cleared by notifies_received in setItem */
delItem
(
hWndHeader
,
0
);
check_auto_format
();
TEST_GET_ITEMCOUNT
(
6
);
check_auto_fields
();
TEST_GET_ITEMCOUNT
(
6
);
...
...
@@ -1820,18 +1840,20 @@ START_TEST(header)
HANDLE
hCtx
;
init_functions
();
init_msg_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
if
(
!
init
())
return
;
test_header_control
();
test_item_auto_format
(
hHeaderParentWnd
);
test_header_order
();
test_hdm_orderarray
();
test_customdraw
();
DestroyWindow
(
hHeaderParentWnd
);
init_msg
_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
flush
_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
parent_hwnd
=
create_custom_parent_window
();
ok_sequence
(
sequences
,
PARENT_SEQ_INDEX
,
create_parent_wnd_seq
,
"create parent windows"
,
FALSE
);
...
...
@@ -1857,6 +1879,7 @@ START_TEST(header)
/* comctl32 version 6 tests start here */
test_hdf_fixedwidth
(
parent_hwnd
);
test_hds_nosizing
(
parent_hwnd
);
test_item_auto_format
(
parent_hwnd
);
unload_v6_module
(
ctx_cookie
,
hCtx
);
...
...
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