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
cf5c16c4
Commit
cf5c16c4
authored
Mar 25, 2010
by
Justin Chevrier
Committed by
Alexandre Julliard
Mar 26, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus/tests: Add GdipGetFontHeightGivenDPI tests.
parent
43a92c66
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
76 additions
and
0 deletions
+76
-0
font.c
dlls/gdiplus/tests/font.c
+76
-0
No files found.
dlls/gdiplus/tests/font.c
View file @
cf5c16c4
...
...
@@ -18,11 +18,14 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <math.h>
#include "windows.h"
#include "gdiplus.h"
#include "wine/test.h"
#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
#define expectf(expected, got) ok(fabs(expected - got) < 0.0001, "Expected %.2f, got %.2f\n", expected, got)
static
const
WCHAR
arial
[]
=
{
'A'
,
'r'
,
'i'
,
'a'
,
'l'
,
'\0'
};
static
const
WCHAR
nonexistent
[]
=
{
'T'
,
'h'
,
'i'
,
's'
,
'F'
,
'o'
,
'n'
,
't'
,
's'
,
'h'
,
'o'
,
'u'
,
'l'
,
'd'
,
'N'
,
'o'
,
't'
,
'E'
,
'x'
,
'i'
,
's'
,
't'
,
'\0'
};
...
...
@@ -345,6 +348,78 @@ static void test_installedfonts (void)
ok
(
collection
!=
NULL
,
"got NULL font collection
\n
"
);
}
static
void
test_heightgivendpi
(
void
)
{
GpStatus
stat
;
GpFont
*
font
=
NULL
;
GpFontFamily
*
fontfamily
=
NULL
;
REAL
height
;
stat
=
GdipCreateFontFamilyFromName
(
arial
,
NULL
,
&
fontfamily
);
if
(
stat
==
FontFamilyNotFound
)
{
skip
(
"Arial not installed
\n
"
);
return
;
}
expect
(
Ok
,
stat
);
stat
=
GdipCreateFont
(
fontfamily
,
30
,
FontStyleRegular
,
UnitPixel
,
&
font
);
expect
(
Ok
,
stat
);
stat
=
GdipGetFontHeightGivenDPI
(
NULL
,
96
,
&
height
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipGetFontHeightGivenDPI
(
font
,
96
,
NULL
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipGetFontHeightGivenDPI
(
font
,
96
,
&
height
);
expect
(
Ok
,
stat
);
expectf
((
REAL
)
34
.
497070
,
height
);
GdipDeleteFont
(
font
);
height
=
12345
;
stat
=
GdipCreateFont
(
fontfamily
,
30
,
FontStyleRegular
,
UnitWorld
,
&
font
);
expect
(
Ok
,
stat
);
stat
=
GdipGetFontHeightGivenDPI
(
font
,
96
,
&
height
);
todo_wine
expect
(
Ok
,
stat
);
todo_wine
expectf
((
REAL
)
34
.
497070
,
height
);
GdipDeleteFont
(
font
);
height
=
12345
;
stat
=
GdipCreateFont
(
fontfamily
,
30
,
FontStyleRegular
,
UnitPoint
,
&
font
);
expect
(
Ok
,
stat
);
stat
=
GdipGetFontHeightGivenDPI
(
font
,
96
,
&
height
);
expect
(
Ok
,
stat
);
expectf
((
REAL
)
45
.
996094
,
height
);
GdipDeleteFont
(
font
);
height
=
12345
;
stat
=
GdipCreateFont
(
fontfamily
,
30
,
FontStyleRegular
,
UnitInch
,
&
font
);
expect
(
Ok
,
stat
);
stat
=
GdipGetFontHeightGivenDPI
(
font
,
96
,
&
height
);
expect
(
Ok
,
stat
);
expectf
((
REAL
)
3311
.
718750
,
height
);
GdipDeleteFont
(
font
);
height
=
12345
;
stat
=
GdipCreateFont
(
fontfamily
,
30
,
FontStyleRegular
,
UnitDocument
,
&
font
);
expect
(
Ok
,
stat
);
stat
=
GdipGetFontHeightGivenDPI
(
font
,
96
,
&
height
);
expect
(
Ok
,
stat
);
expectf
((
REAL
)
11
.
03
9062
,
height
);
GdipDeleteFont
(
font
);
height
=
12345
;
stat
=
GdipCreateFont
(
fontfamily
,
30
,
FontStyleRegular
,
UnitMillimeter
,
&
font
);
expect
(
Ok
,
stat
);
stat
=
GdipGetFontHeightGivenDPI
(
font
,
96
,
&
height
);
expect
(
Ok
,
stat
);
expectf
((
REAL
)
130
.
382614
,
height
);
GdipDeleteFont
(
font
);
GdipDeleteFontFamily
(
fontfamily
);
}
START_TEST
(
font
)
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
...
@@ -363,6 +438,7 @@ START_TEST(font)
test_fontfamily_properties
();
test_getgenerics
();
test_installedfonts
();
test_heightgivendpi
();
GdiplusShutdown
(
gdiplusToken
);
}
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