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
3e61c712
Commit
3e61c712
authored
Mar 14, 2019
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Mar 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Tests default margin size with various font face.
Signed-off-by:
Akihiro Sagawa
<
sagawa.aki@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
11f05970
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
24 deletions
+47
-24
edit.c
dlls/user32/tests/edit.c
+47
-24
No files found.
dlls/user32/tests/edit.c
View file @
3e61c712
...
...
@@ -1549,7 +1549,7 @@ static void test_margins_usefontinfo(UINT charset)
DeleteObject
(
hfont
);
}
static
void
test_margins_default
(
UINT
charset
)
static
void
test_margins_default
(
const
char
*
facename
,
UINT
charset
)
{
HWND
hwnd
;
HDC
hdc
;
...
...
@@ -1567,7 +1567,7 @@ static void test_margins_default(UINT charset)
lf
.
lfHeight
=
-
11
;
lf
.
lfWeight
=
FW_NORMAL
;
lf
.
lfCharSet
=
charset
;
strcpy
(
lf
.
lfFaceName
,
"Tahoma"
);
strcpy
(
lf
.
lfFaceName
,
facename
);
hfont
=
CreateFontIndirectA
(
&
lf
);
ok
(
hfont
!=
NULL
,
"got %p
\n
"
,
hfont
);
...
...
@@ -1602,16 +1602,16 @@ static void test_margins_default(UINT charset)
SendMessageA
(
hwnd
,
WM_SETFONT
,
(
WPARAM
)
hfont
,
MAKELPARAM
(
TRUE
,
0
));
margins
=
SendMessageA
(
hwnd
,
EM_GETMARGINS
,
0
,
0
);
if
(
!
cjk_charset
)
ok
(
margins
==
expect
,
"%
d: got %d, %d
\n
"
,
charset
,
HIWORD
(
margins
),
LOWORD
(
margins
));
ok
(
margins
==
expect
,
"%
s:%d: got %d, %d
\n
"
,
facename
,
charset
,
HIWORD
(
margins
),
LOWORD
(
margins
));
SendMessageA
(
hwnd
,
EM_SETMARGINS
,
EC_LEFTMARGIN
|
EC_RIGHTMARGIN
,
small_margins
);
SendMessageA
(
hwnd
,
EM_SETMARGINS
,
EC_LEFTMARGIN
|
EC_RIGHTMARGIN
,
MAKELONG
(
EC_USEFONTINFO
,
EC_USEFONTINFO
));
margins
=
SendMessageA
(
hwnd
,
EM_GETMARGINS
,
0
,
0
);
if
(
!
cjk_charset
)
ok
(
margins
==
expect
,
"%
d: got %d, %d
\n
"
,
charset
,
HIWORD
(
margins
),
LOWORD
(
margins
));
ok
(
margins
==
expect
,
"%
s:%d: got %d, %d
\n
"
,
facename
,
charset
,
HIWORD
(
margins
),
LOWORD
(
margins
));
else
{
ok
(
HIWORD
(
margins
)
<=
HIWORD
(
expect
),
"%
d: got %d
\n
"
,
charset
,
HIWORD
(
margins
));
ok
(
LOWORD
(
margins
)
<=
LOWORD
(
expect
),
"%
d: got %d
\n
"
,
charset
,
LOWORD
(
margins
));
ok
(
HIWORD
(
margins
)
<=
HIWORD
(
expect
),
"%
s:%d: got %d
\n
"
,
facename
,
charset
,
HIWORD
(
margins
));
ok
(
LOWORD
(
margins
)
<=
LOWORD
(
expect
),
"%
s:%d: got %d
\n
"
,
facename
,
charset
,
LOWORD
(
margins
));
}
DestroyWindow
(
hwnd
);
...
...
@@ -1627,22 +1627,39 @@ static void test_margins_default(UINT charset)
SendMessageA
(
hwnd
,
WM_SETFONT
,
(
WPARAM
)
hfont
,
MAKELPARAM
(
TRUE
,
0
));
margins
=
SendMessageA
(
hwnd
,
EM_GETMARGINS
,
0
,
0
);
if
(
!
cjk_charset
)
ok
(
margins
==
expect
,
"%
d: got %d, %d
\n
"
,
charset
,
HIWORD
(
margins
),
LOWORD
(
margins
));
ok
(
margins
==
expect
,
"%
s:%d: got %d, %d
\n
"
,
facename
,
charset
,
HIWORD
(
margins
),
LOWORD
(
margins
));
SendMessageA
(
hwnd
,
EM_SETMARGINS
,
EC_LEFTMARGIN
|
EC_RIGHTMARGIN
,
small_margins
);
SendMessageA
(
hwnd
,
EM_SETMARGINS
,
EC_LEFTMARGIN
|
EC_RIGHTMARGIN
,
MAKELONG
(
EC_USEFONTINFO
,
EC_USEFONTINFO
));
margins
=
SendMessageA
(
hwnd
,
EM_GETMARGINS
,
0
,
0
);
if
(
!
cjk_charset
)
ok
(
margins
==
expect
,
"%
d: got %d, %d
\n
"
,
charset
,
HIWORD
(
margins
),
LOWORD
(
margins
));
ok
(
margins
==
expect
,
"%
s:%d: got %d, %d
\n
"
,
facename
,
charset
,
HIWORD
(
margins
),
LOWORD
(
margins
));
else
{
ok
(
HIWORD
(
margins
)
<=
HIWORD
(
expect
),
"%
d: got %d
\n
"
,
charset
,
HIWORD
(
margins
));
ok
(
LOWORD
(
margins
)
<=
LOWORD
(
expect
),
"%
d: got %d
\n
"
,
charset
,
LOWORD
(
margins
));
ok
(
HIWORD
(
margins
)
<=
HIWORD
(
expect
),
"%
s:%d: got %d
\n
"
,
facename
,
charset
,
HIWORD
(
margins
));
ok
(
LOWORD
(
margins
)
<=
LOWORD
(
expect
),
"%
s:%d: got %d
\n
"
,
facename
,
charset
,
LOWORD
(
margins
));
}
DestroyWindow
(
hwnd
);
DeleteObject
(
hfont
);
}
static
INT
CALLBACK
find_font_proc
(
const
LOGFONTA
*
elf
,
const
TEXTMETRICA
*
ntm
,
DWORD
type
,
LPARAM
lParam
)
{
return
0
;
}
static
BOOL
is_font_installed
(
const
char
*
name
)
{
HDC
hdc
=
GetDC
(
NULL
);
BOOL
ret
=
FALSE
;
if
(
!
EnumFontFamiliesA
(
hdc
,
name
,
find_font_proc
,
0
))
ret
=
TRUE
;
ReleaseDC
(
NULL
,
hdc
);
return
ret
;
}
static
void
test_margins
(
void
)
{
HWND
hwEdit
;
...
...
@@ -1718,17 +1735,26 @@ static void test_margins(void)
test_margins_usefontinfo
(
DEFAULT_CHARSET
);
test_margins_default
(
ANSI_CHARSET
);
test_margins_default
(
EASTEUROPE_CHARSET
);
test_margins_default
(
"Tahoma"
,
ANSI_CHARSET
);
test_margins_default
(
"Tahoma"
,
EASTEUROPE_CHARSET
);
test_margins_default
(
SHIFTJIS_CHARSET
);
test_margins_default
(
HANGUL_CHARSET
);
test_margins_default
(
CHINESEBIG5_CHARSET
);
}
test_margins_default
(
"Tahoma"
,
HANGUL_CHARSET
);
test_margins_default
(
"Tahoma"
,
CHINESEBIG5_CHARSET
);
static
INT
CALLBACK
find_font_proc
(
const
LOGFONTA
*
elf
,
const
TEXTMETRICA
*
ntm
,
DWORD
type
,
LPARAM
lParam
)
{
return
0
;
if
(
is_font_installed
(
"MS PGothic"
))
test_margins_default
(
"MS PGothic"
,
SHIFTJIS_CHARSET
);
else
skip
(
"MS PGothic is not available, skipping some margin tests
\n
"
);
if
(
is_font_installed
(
"Ume P Gothic"
))
test_margins_default
(
"Ume P Gothic"
,
SHIFTJIS_CHARSET
);
else
skip
(
"Ume P Gothic is not available, skipping some margin tests
\n
"
);
if
(
is_font_installed
(
"SimSun"
))
test_margins_default
(
"SimSun"
,
GB2312_CHARSET
);
else
skip
(
"SimSun is not available, skipping some margin tests
\n
"
);
}
static
void
test_margins_font_change
(
void
)
...
...
@@ -1737,15 +1763,12 @@ static void test_margins_font_change(void)
DWORD
margins
,
font_margins
;
LOGFONTA
lf
;
HFONT
hfont
,
hfont2
;
HDC
hdc
=
GetDC
(
0
);
if
(
EnumFontFamiliesA
(
hdc
,
"Arial"
,
find_font_proc
,
0
))
if
(
!
is_font_installed
(
"Arial"
))
{
trace
(
"Arial not found - skipping font change margin tests
\n
"
);
ReleaseDC
(
0
,
hdc
);
skip
(
"Arial not found - skipping font change margin tests
\n
"
);
return
;
}
ReleaseDC
(
0
,
hdc
);
hwEdit
=
create_child_editcontrol
(
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