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
fe3c9428
Commit
fe3c9428
authored
Jul 11, 2006
by
Dan Hipschman
Committed by
Alexandre Julliard
Jul 12, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add conformance test for GetTextExtentExPointW.
parent
d58e7e16
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
font.c
dlls/gdi/tests/font.c
+33
-0
No files found.
dlls/gdi/tests/font.c
View file @
fe3c9428
...
...
@@ -336,11 +336,15 @@ static void test_GetCharABCWidthsW(void)
static
void
test_text_extents
(
void
)
{
const
static
WCHAR
wt
[]
=
{
'O'
,
'n'
,
'e'
,
'\n'
,
't'
,
'w'
,
'o'
,
' '
,
'3'
,
0
};
LPINT
extents
;
INT
i
,
len
,
fit1
,
fit2
;
LOGFONTA
lf
;
TEXTMETRICA
tm
;
HDC
hdc
;
HFONT
hfont
;
SIZE
sz
;
SIZE
sz1
,
sz2
;
memset
(
&
lf
,
0
,
sizeof
(
lf
));
strcpy
(
lf
.
lfFaceName
,
"Arial"
);
...
...
@@ -353,6 +357,35 @@ static void test_text_extents(void)
GetTextExtentPointA
(
hdc
,
"o"
,
1
,
&
sz
);
ok
(
sz
.
cy
==
tm
.
tmHeight
,
"cy %ld tmHeight %ld
\n
"
,
sz
.
cy
,
tm
.
tmHeight
);
len
=
lstrlenW
(
wt
);
extents
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
extents
[
0
]);
memset
(
extents
,
0
,
len
*
sizeof
extents
[
0
]);
extents
[
0
]
=
1
;
/* So that the increasing sequence test will fail
if the extents array is untouched. */
GetTextExtentExPointW
(
hdc
,
wt
,
len
,
32767
,
&
fit1
,
extents
,
&
sz1
);
GetTextExtentPointW
(
hdc
,
wt
,
len
,
&
sz2
);
ok
(
sz1
.
cx
==
sz2
.
cx
&&
sz1
.
cy
==
sz2
.
cy
,
"results from GetTextExtentExPointW and GetTextExtentPointW differ
\n
"
);
for
(
i
=
1
;
i
<
len
;
++
i
)
ok
(
extents
[
i
-
1
]
<=
extents
[
i
],
"GetTextExtentExPointW generated a non-increasing sequence of partial extents (at position %d)
\n
"
,
i
);
ok
(
extents
[
len
-
1
]
==
sz1
.
cx
,
"GetTextExtentExPointW extents and size don't match
\n
"
);
ok
(
0
<=
fit1
&&
fit1
<=
len
,
"GetTextExtentExPointW generated illegal value %d for fit
\n
"
,
fit1
);
ok
(
0
<
fit1
,
"GetTextExtentExPointW says we can't even fit one letter in 32767 logical units
\n
"
);
GetTextExtentExPointW
(
hdc
,
wt
,
len
,
extents
[
2
],
&
fit2
,
NULL
,
&
sz2
);
ok
(
sz1
.
cx
==
sz2
.
cx
&&
sz1
.
cy
==
sz2
.
cy
,
"GetTextExtentExPointW returned different sizes for the same string
\n
"
);
ok
(
fit2
==
3
,
"GetTextExtentExPointW extents isn't consistent with fit
\n
"
);
GetTextExtentExPointW
(
hdc
,
wt
,
len
,
extents
[
2
]
-
1
,
&
fit2
,
NULL
,
&
sz2
);
ok
(
fit2
==
2
,
"GetTextExtentExPointW extents isn't consistent with fit
\n
"
);
GetTextExtentExPointW
(
hdc
,
wt
,
2
,
0
,
NULL
,
extents
+
2
,
&
sz2
);
ok
(
extents
[
0
]
==
extents
[
2
]
&&
extents
[
1
]
==
extents
[
3
],
"GetTextExtentExPointW with lpnFit == NULL returns incorrect results
\n
"
);
GetTextExtentExPointW
(
hdc
,
wt
,
2
,
0
,
NULL
,
NULL
,
&
sz1
);
ok
(
sz1
.
cx
==
sz2
.
cx
&&
sz1
.
cy
==
sz2
.
cy
,
"GetTextExtentExPointW with lpnFit and alpDx both NULL returns incorrect results
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
extents
);
SelectObject
(
hdc
,
hfont
);
DeleteObject
(
hfont
);
ReleaseDC
(
NULL
,
hdc
);
...
...
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