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
ced3d81b
Commit
ced3d81b
authored
Jun 21, 2008
by
Adam Petaccia
Committed by
Alexandre Julliard
Jun 25, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Tests for FontFamily.
parent
d6bad2d6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
1 deletion
+55
-1
font.c
dlls/gdiplus/tests/font.c
+55
-1
No files found.
dlls/gdiplus/tests/font.c
View file @
ced3d81b
...
@@ -24,7 +24,12 @@
...
@@ -24,7 +24,12 @@
#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
static
WCHAR
arial
[]
=
{
'A'
,
'r'
,
'i'
,
'a'
,
'l'
,
'\0'
};
static
const
WCHAR
arial
[]
=
{
'A'
,
'r'
,
'i'
,
'a'
,
'l'
,
'\0'
};
static
const
WCHAR
nonexistant
[]
=
{
'T'
,
'h'
,
'i'
,
's'
,
'F'
,
'o'
,
'n'
,
't'
,
's'
,
'h'
,
'o'
,
'u'
,
'l'
,
'd'
,
'N'
,
'o'
,
't'
,
'E'
,
'x'
,
'i'
,
's'
,
't'
,
'\0'
};
static
const
WCHAR
MSSansSerif
[]
=
{
'M'
,
'S'
,
' '
,
'S'
,
'a'
,
'n'
,
's'
,
' '
,
'S'
,
'e'
,
'r'
,
'i'
,
'f'
,
'\0'
};
static
const
WCHAR
MicrosoftSansSerif
[]
=
{
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
' '
,
'S'
,
'a'
,
'n'
,
's'
,
' '
,
'S'
,
'e'
,
'r'
,
'i'
,
'f'
,
'\0'
};
static
const
WCHAR
TimesNewRoman
[]
=
{
'T'
,
'i'
,
'm'
,
'e'
,
's'
,
' '
,
'N'
,
'e'
,
'w'
,
' '
,
'R'
,
'o'
,
'm'
,
'a'
,
'n'
,
'\0'
};
static
const
WCHAR
CourierNew
[]
=
{
'C'
,
'o'
,
'u'
,
'r'
,
'i'
,
'e'
,
'r'
,
' '
,
'N'
,
'e'
,
'w'
,
'\0'
};
static
void
test_logfont
(
void
)
static
void
test_logfont
(
void
)
{
{
...
@@ -94,6 +99,54 @@ static void test_logfont(void)
...
@@ -94,6 +99,54 @@ static void test_logfont(void)
ReleaseDC
(
0
,
hdc
);
ReleaseDC
(
0
,
hdc
);
}
}
static
void
test_fontfamily
(
void
)
{
GpFontFamily
**
family
=
NULL
;
WCHAR
itsName
[
LF_FACESIZE
];
GpStatus
stat
;
/* FontFamily can not be NULL */
stat
=
GdipCreateFontFamilyFromName
(
arial
,
NULL
,
family
);
expect
(
InvalidParameter
,
stat
);
family
=
GdipAlloc
(
sizeof
(
GpFontFamily
*
));
/* FontFamily must be able to actually find the family.
* If it can't, any subsequent calls should fail
*
* We currently fail (meaning we don't) because we don't actually
* test to see if we can successfully get a family
*/
stat
=
GdipCreateFontFamilyFromName
(
nonexistant
,
NULL
,
family
);
expect
(
FontFamilyNotFound
,
stat
);
stat
=
GdipGetFamilyName
(
*
family
,
itsName
,
LANG_NEUTRAL
);
expect
(
InvalidParameter
,
stat
);
ok
((
lstrcmpiW
(
itsName
,
nonexistant
)
!=
0
),
"Expected a non-zero value for nonexistant font!
\n
"
);
stat
=
GdipDeleteFontFamily
(
*
family
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipCreateFontFamilyFromName
(
arial
,
NULL
,
family
);
expect
(
Ok
,
stat
);
stat
=
GdipGetFamilyName
(
*
family
,
itsName
,
LANG_NEUTRAL
);
expect
(
Ok
,
stat
);
expect
(
0
,
lstrcmpiW
(
itsName
,
arial
));
if
(
0
)
{
/* Crashes on Windows XP SP2, Vista, and so Wine as well */
stat
=
GdipGetFamilyName
(
*
family
,
NULL
,
LANG_NEUTRAL
);
expect
(
Ok
,
stat
);
}
stat
=
GdipDeleteFontFamily
(
*
family
);
expect
(
Ok
,
stat
);
if
(
family
)
GdipFree
(
family
);
}
START_TEST
(
font
)
START_TEST
(
font
)
{
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
@@ -107,6 +160,7 @@ START_TEST(font)
...
@@ -107,6 +160,7 @@ START_TEST(font)
GdiplusStartup
(
&
gdiplusToken
,
&
gdiplusStartupInput
,
NULL
);
GdiplusStartup
(
&
gdiplusToken
,
&
gdiplusStartupInput
,
NULL
);
test_logfont
();
test_logfont
();
test_fontfamily
();
GdiplusShutdown
(
gdiplusToken
);
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