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
af30ffaa
Commit
af30ffaa
authored
Apr 02, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 02, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/tests: Fix couple of metrics tests that fail on some systems.
parent
e1b160b0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
8 deletions
+36
-8
listview.c
dlls/comctl32/tests/listview.c
+36
-8
No files found.
dlls/comctl32/tests/listview.c
View file @
af30ffaa
...
...
@@ -3915,7 +3915,6 @@ static void test_getitemrect(void)
LVCOLUMNA
col
;
INT
order
[
2
];
POINT
pt
;
HDC
hdc
;
/* rectangle isn't empty for empty text items */
hwnd
=
create_listview_control
(
LVS_LIST
);
...
...
@@ -3929,9 +3928,9 @@ static void test_getitemrect(void)
expect
(
TRUE
,
r
);
expect
(
0
,
rect
.
left
);
expect
(
0
,
rect
.
top
);
hdc
=
GetDC
(
hwnd
);
todo_wine
expect
(((
GetDeviceCaps
(
hdc
,
LOGPIXELSX
)
+
15
)
/
16
)
*
16
,
rect
.
right
);
ReleaseDC
(
hwnd
,
hdc
);
/* estimate it as width / height ratio */
todo_wine
ok
((
rect
.
right
/
rect
.
bottom
)
>=
5
,
"got right %d, bottom %d
\n
"
,
rect
.
right
,
rect
.
bottom
);
DestroyWindow
(
hwnd
);
hwnd
=
create_listview_control
(
LVS_REPORT
);
...
...
@@ -4833,6 +4832,36 @@ static void test_getitemspacing(void)
DestroyWindow
(
hwnd
);
}
static
INT
get_current_font_height
(
HWND
listview
)
{
TEXTMETRICA
tm
;
HFONT
hfont
;
HWND
hwnd
;
HDC
hdc
;
hwnd
=
(
HWND
)
SendMessageA
(
listview
,
LVM_GETHEADER
,
0
,
0
);
if
(
!
hwnd
)
hwnd
=
listview
;
hfont
=
(
HFONT
)
SendMessageA
(
hwnd
,
WM_GETFONT
,
0
,
0
);
if
(
!
hfont
)
{
hdc
=
GetDC
(
hwnd
);
GetTextMetricsA
(
hdc
,
&
tm
);
ReleaseDC
(
hwnd
,
hdc
);
}
else
{
HFONT
oldfont
;
hdc
=
GetDC
(
0
);
oldfont
=
SelectObject
(
hdc
,
hfont
);
GetTextMetricsA
(
hdc
,
&
tm
);
SelectObject
(
hdc
,
oldfont
);
ReleaseDC
(
0
,
hdc
);
}
return
tm
.
tmHeight
;
}
static
void
test_getcolumnwidth
(
void
)
{
HWND
hwnd
;
...
...
@@ -4840,7 +4869,7 @@ static void test_getcolumnwidth(void)
DWORD_PTR
style
;
LVCOLUMNA
col
;
LVITEMA
itema
;
HDC
hdc
;
INT
height
;
/* default column width */
hwnd
=
create_listview_control
(
LVS_ICON
);
...
...
@@ -4864,9 +4893,8 @@ static void test_getcolumnwidth(void)
memset
(
&
itema
,
0
,
sizeof
(
itema
));
SendMessageA
(
hwnd
,
LVM_INSERTITEMA
,
0
,
(
LPARAM
)
&
itema
);
ret
=
SendMessageA
(
hwnd
,
LVM_GETCOLUMNWIDTH
,
0
,
0
);
hdc
=
GetDC
(
hwnd
);
todo_wine
expect
(((
GetDeviceCaps
(
hdc
,
LOGPIXELSX
)
+
15
)
/
16
)
*
16
,
ret
);
ReleaseDC
(
hwnd
,
hdc
);
height
=
get_current_font_height
(
hwnd
);
ok
((
ret
/
height
)
>=
6
,
"got width %d, height %d
\n
"
,
ret
,
height
);
DestroyWindow
(
hwnd
);
}
...
...
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