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
90d934b5
Commit
90d934b5
authored
Dec 08, 2023
by
Brendan McGrath
Committed by
Alexandre Julliard
Dec 08, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Add tests for word breaks before punctuation.
Whilst uniscribe won't break on the space here (see LB13 of the Unicode line breaking algorith), DrawText does
parent
12066a21
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
text.c
dlls/user32/tests/text.c
+32
-0
No files found.
dlls/user32/tests/text.c
View file @
90d934b5
...
...
@@ -45,6 +45,8 @@ static void test_DrawTextCalcRect(void)
static
WCHAR
emptystringW
[]
=
{
0
};
static
CHAR
wordbreak_text
[]
=
"line1 line2"
;
static
WCHAR
wordbreak_textW
[]
=
{
'l'
,
'i'
,
'n'
,
'e'
,
'1'
,
' '
,
'l'
,
'i'
,
'n'
,
'e'
,
'2'
,
0
};
static
WCHAR
wordbreak_text_colonW
[]
=
{
'l'
,
'i'
,
'n'
,
'e'
,
'1'
,
' '
,
'l'
,
'i'
,
'n'
,
'e'
,
'2'
,
' '
,
':'
,
0
};
static
WCHAR
wordbreak_text_csbW
[]
=
{
'l'
,
'i'
,
'n'
,
'e'
,
'1'
,
' '
,
'l'
,
'i'
,
'n'
,
'e'
,
'2'
,
' '
,
']'
,
0
};
static
char
tabstring
[]
=
"one
\t
two"
;
INT
textlen
,
textheight
,
heightcheck
;
RECT
rect
=
{
0
,
0
,
100
,
0
},
rect2
;
...
...
@@ -590,6 +592,36 @@ static void test_DrawTextCalcRect(void)
ok
(
textheight
>=
heightcheck
*
6
,
"Got unexpected textheight %d, expected at least %d.
\n
"
,
textheight
,
heightcheck
*
6
);
/* Word break tests with space before punctuation */
SetRect
(
&
rect
,
0
,
0
,
200
,
1
);
textheight
=
DrawTextW
(
hdc
,
wordbreak_text_colonW
,
-
1
,
&
rect
,
DT_CALCRECT
|
DT_WORDBREAK
);
ok
(
textheight
==
heightcheck
,
"Got unexpected textheight %d, expected %d.
\n
"
,
textheight
,
heightcheck
);
rect2
=
rect
;
rect
.
right
--
;
textheight
=
DrawTextW
(
hdc
,
wordbreak_text_colonW
,
-
1
,
&
rect
,
DT_CALCRECT
|
DT_WORDBREAK
);
ok
(
textheight
==
heightcheck
*
2
,
"Got unexpected textheight %d, expected %d.
\n
"
,
textheight
,
heightcheck
*
2
);
todo_wine
ok
(
rect
.
right
>
rect2
.
right
-
10
,
"Got unexpected textwdith %ld, expected larger than %ld.
\n
"
,
rect
.
right
,
rect2
.
right
-
10
);
SetRect
(
&
rect
,
0
,
0
,
200
,
1
);
textheight
=
DrawTextW
(
hdc
,
wordbreak_text_csbW
,
-
1
,
&
rect
,
DT_CALCRECT
|
DT_WORDBREAK
);
ok
(
textheight
==
heightcheck
,
"Got unexpected textheight %d, expected %d.
\n
"
,
textheight
,
heightcheck
);
rect2
=
rect
;
rect
.
right
--
;
textheight
=
DrawTextW
(
hdc
,
wordbreak_text_csbW
,
-
1
,
&
rect
,
DT_CALCRECT
|
DT_WORDBREAK
);
ok
(
textheight
==
heightcheck
*
2
,
"Got unexpected textheight %d, expected %d.
\n
"
,
textheight
,
heightcheck
*
2
);
todo_wine
ok
(
rect
.
right
>
rect2
.
right
-
10
,
"Got unexpected textwdith %ld, expected larger than %ld.
\n
"
,
rect
.
right
,
rect2
.
right
-
10
);
/* DT_TABSTOP | DT_EXPANDTABS tests */
SetRect
(
&
rect
,
0
,
0
,
10
,
10
);
textheight
=
DrawTextA
(
hdc
,
tabstring
,
-
1
,
&
rect
,
DT_TABSTOP
|
DT_EXPANDTABS
);
...
...
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