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
762280ea
Commit
762280ea
authored
Nov 17, 2009
by
André Hentschel
Committed by
Alexandre Julliard
Nov 18, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32/tests: Simplify testcase.
parent
d568c2ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
44 deletions
+17
-44
font.c
dlls/gdi32/tests/font.c
+17
-44
No files found.
dlls/gdi32/tests/font.c
View file @
762280ea
...
...
@@ -2980,61 +2980,34 @@ static void test_GetTextMetrics2(const char *fontname, int font_height)
void
test_CreateFontIndirect
(
void
)
{
LOGFONTA
lf
,
getobj_lf
;
int
ret
;
int
ret
,
i
;
HFONT
hfont
;
char
TestName
[][
16
]
=
{
"Arial"
,
"Arial Bold"
,
"Arial Italic"
};
memset
(
&
lf
,
0
,
sizeof
(
lf
));
lf
.
lfCharSet
=
ANSI_CHARSET
;
lf
.
lfClipPrecision
=
CLIP_DEFAULT_PRECIS
;
lf
.
lfHeight
=
16
;
lf
.
lfWidth
=
16
;
lf
.
lfQuality
=
DEFAULT_QUALITY
;
lf
.
lfItalic
=
FALSE
;
lf
.
lfWeight
=
FW_DONTCARE
;
lstrcpyA
(
lf
.
lfFaceName
,
"Arial"
);
hfont
=
CreateFontIndirectA
(
&
lf
);
ok
(
hfont
!=
0
,
"CreateFontIndirectA failed
\n
"
);
ret
=
GetObject
(
hfont
,
sizeof
(
getobj_lf
),
&
getobj_lf
);
ok
(
lf
.
lfWeight
==
getobj_lf
.
lfWeight
||
broken
((
SHORT
)
lf
.
lfWeight
==
getobj_lf
.
lfWeight
),
/* win9x */
"lfWeight: expect %08x got %08x
\n
"
,
lf
.
lfWeight
,
getobj_lf
.
lfWeight
);
ok
(
lf
.
lfItalic
==
getobj_lf
.
lfItalic
,
"lfItalic: expect %02x got %02x
\n
"
,
lf
.
lfItalic
,
getobj_lf
.
lfItalic
);
ok
(
!
lstrcmpA
(
lf
.
lfFaceName
,
getobj_lf
.
lfFaceName
)
||
broken
(
!
memcmp
(
lf
.
lfFaceName
,
getobj_lf
.
lfFaceName
,
LF_FACESIZE
-
1
)),
/* win9x doesn't ensure '\0' termination */
"font names don't match: %s != %s
\n
"
,
lf
.
lfFaceName
,
getobj_lf
.
lfFaceName
);
DeleteObject
(
hfont
);
lf
.
lfItalic
=
FALSE
;
lf
.
lfWeight
=
FW_DONTCARE
;
lstrcpyA
(
lf
.
lfFaceName
,
"Arial Bold"
);
hfont
=
CreateFontIndirectA
(
&
lf
);
ok
(
hfont
!=
0
,
"CreateFontIndirectA failed
\n
"
);
ret
=
GetObject
(
hfont
,
sizeof
(
getobj_lf
),
&
getobj_lf
);
ok
(
lf
.
lfItalic
==
getobj_lf
.
lfItalic
,
"lfItalic: expect %02x got %02x
\n
"
,
lf
.
lfItalic
,
getobj_lf
.
lfItalic
);
ok
(
lf
.
lfWeight
==
getobj_lf
.
lfWeight
||
broken
((
SHORT
)
lf
.
lfWeight
==
getobj_lf
.
lfWeight
),
/* win9x */
"lfWeight: expect %08x got %08x
\n
"
,
lf
.
lfWeight
,
getobj_lf
.
lfWeight
);
ok
(
!
lstrcmpA
(
lf
.
lfFaceName
,
getobj_lf
.
lfFaceName
)
||
broken
(
!
memcmp
(
lf
.
lfFaceName
,
getobj_lf
.
lfFaceName
,
LF_FACESIZE
-
1
)),
/* win9x doesn't ensure '\0' termination */
"font names don't match: %s != %s
\n
"
,
lf
.
lfFaceName
,
getobj_lf
.
lfFaceName
);
DeleteObject
(
hfont
);
lf
.
lfItalic
=
FALSE
;
lf
.
lfWeight
=
FW_DONTCARE
;
lstrcpyA
(
lf
.
lfFaceName
,
"Arial Italic"
);
hfont
=
CreateFontIndirectA
(
&
lf
);
ok
(
hfont
!=
0
,
"CreateFontIndirectA failed
\n
"
);
ret
=
GetObject
(
hfont
,
sizeof
(
getobj_lf
),
&
getobj_lf
);
ok
(
lf
.
lfWeight
==
getobj_lf
.
lfWeight
||
broken
((
SHORT
)
lf
.
lfWeight
==
getobj_lf
.
lfWeight
),
/* win9x */
"lfWeight: expect %08x got %08x
\n
"
,
lf
.
lfWeight
,
getobj_lf
.
lfWeight
);
ok
(
lf
.
lfItalic
==
getobj_lf
.
lfItalic
,
"lfItalic: expect %02x got %02x
\n
"
,
lf
.
lfItalic
,
getobj_lf
.
lfItalic
);
ok
(
!
lstrcmpA
(
lf
.
lfFaceName
,
getobj_lf
.
lfFaceName
)
||
broken
(
!
memcmp
(
lf
.
lfFaceName
,
getobj_lf
.
lfFaceName
,
LF_FACESIZE
-
1
)),
/* win9x doesn't ensure '\0' termination */
"font names don't match: %s != %s
\n
"
,
lf
.
lfFaceName
,
getobj_lf
.
lfFaceName
);
DeleteObject
(
hfont
);
for
(
i
=
0
;
i
<
sizeof
(
TestName
)
/
sizeof
(
TestName
[
0
]);
i
++
)
{
lstrcpyA
(
lf
.
lfFaceName
,
TestName
[
i
]);
hfont
=
CreateFontIndirectA
(
&
lf
);
ok
(
hfont
!=
0
,
"CreateFontIndirectA failed
\n
"
);
ret
=
GetObject
(
hfont
,
sizeof
(
getobj_lf
),
&
getobj_lf
);
ok
(
lf
.
lfItalic
==
getobj_lf
.
lfItalic
,
"lfItalic: expect %02x got %02x
\n
"
,
lf
.
lfItalic
,
getobj_lf
.
lfItalic
);
ok
(
lf
.
lfWeight
==
getobj_lf
.
lfWeight
||
broken
((
SHORT
)
lf
.
lfWeight
==
getobj_lf
.
lfWeight
),
/* win9x */
"lfWeight: expect %08x got %08x
\n
"
,
lf
.
lfWeight
,
getobj_lf
.
lfWeight
);
ok
(
!
lstrcmpA
(
lf
.
lfFaceName
,
getobj_lf
.
lfFaceName
)
||
broken
(
!
memcmp
(
lf
.
lfFaceName
,
getobj_lf
.
lfFaceName
,
LF_FACESIZE
-
1
)),
/* win9x doesn't ensure '\0' termination */
"font names don't match: %s != %s
\n
"
,
lf
.
lfFaceName
,
getobj_lf
.
lfFaceName
);
DeleteObject
(
hfont
);
}
}
START_TEST
(
font
)
...
...
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