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
8b809846
Commit
8b809846
authored
Apr 20, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 20, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite/tests: Some basic tests for fontface references.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e48879b1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
2 deletions
+58
-2
font.c
dlls/dwrite/tests/font.c
+58
-2
No files found.
dlls/dwrite/tests/font.c
View file @
8b809846
...
@@ -5797,7 +5797,9 @@ static void test_HasCharacter(void)
...
@@ -5797,7 +5797,9 @@ static void test_HasCharacter(void)
static
void
test_CreateFontFaceReference
(
void
)
static
void
test_CreateFontFaceReference
(
void
)
{
{
static
const
WCHAR
dummyW
[]
=
{
'd'
,
'u'
,
'm'
,
'm'
,
'y'
,
0
};
static
const
WCHAR
dummyW
[]
=
{
'd'
,
'u'
,
'm'
,
'm'
,
'y'
,
0
};
IDWriteFontFaceReference
*
ref
;
IDWriteFontFace3
*
fontface
,
*
fontface1
;
IDWriteFontFaceReference
*
ref
,
*
ref1
;
IDWriteFontFile
*
file
,
*
file1
;
IDWriteFactory3
*
factory3
;
IDWriteFactory3
*
factory3
;
IDWriteFactory
*
factory
;
IDWriteFactory
*
factory
;
UINT32
index
;
UINT32
index
;
...
@@ -5826,18 +5828,72 @@ todo_wine
...
@@ -5826,18 +5828,72 @@ todo_wine
if
(
hr
==
S_OK
)
{
if
(
hr
==
S_OK
)
{
index
=
IDWriteFontFaceReference_GetFontFaceIndex
(
ref
);
index
=
IDWriteFontFaceReference_GetFontFaceIndex
(
ref
);
ok
(
index
==
1
,
"got %u
\n
"
,
index
);
ok
(
index
==
1
,
"got %u
\n
"
,
index
);
hr
=
IDWriteFontFaceReference_GetFontFile
(
ref
,
&
file
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
IDWriteFontFile_Release
(
file
);
hr
=
IDWriteFontFaceReference_CreateFontFace
(
ref
,
&
fontface
);
ok
(
hr
==
DWRITE_E_FILEFORMAT
,
"got 0x%08x
\n
"
,
hr
);
IDWriteFontFaceReference_Release
(
ref
);
}
}
/* path however has to be valid */
/* path however has to be valid */
hr
=
IDWriteFactory3_CreateFontFaceReference
(
factory3
,
dummyW
,
NULL
,
0
,
DWRITE_FONT_SIMULATIONS_NONE
,
&
ref
);
hr
=
IDWriteFactory3_CreateFontFaceReference
(
factory3
,
dummyW
,
NULL
,
0
,
DWRITE_FONT_SIMULATIONS_NONE
,
&
ref
);
todo_wine
todo_wine
ok
(
hr
==
DWRITE_E_FILENOTFOUND
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
DWRITE_E_FILENOTFOUND
,
"got 0x%08x
\n
"
,
hr
);
EXPECT_REF
(
factory3
,
1
);
hr
=
IDWriteFactory3_CreateFontFaceReference
(
factory3
,
path
,
NULL
,
0
,
DWRITE_FONT_SIMULATIONS_NONE
,
&
ref
);
hr
=
IDWriteFactory3_CreateFontFaceReference
(
factory3
,
path
,
NULL
,
0
,
DWRITE_FONT_SIMULATIONS_NONE
,
&
ref
);
todo_wine
todo_wine
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
if
(
hr
==
S_OK
)
{
EXPECT_REF
(
factory3
,
2
);
/* new file is returned */
hr
=
IDWriteFontFaceReference_GetFontFile
(
ref
,
&
file
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDWriteFontFaceReference_GetFontFile
(
ref
,
&
file1
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
file
!=
file1
,
"got %p, previous file %p
\n
"
,
file1
,
file
);
IDWriteFontFile_Release
(
file
);
IDWriteFontFile_Release
(
file1
);
/* references are not reused */
hr
=
IDWriteFactory3_CreateFontFaceReference
(
factory3
,
path
,
NULL
,
0
,
DWRITE_FONT_SIMULATIONS_NONE
,
&
ref1
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
ref1
!=
ref
,
"got %p, previous ref %p
\n
"
,
ref1
,
ref
);
/* created fontfaces are cached */
hr
=
IDWriteFontFaceReference_CreateFontFace
(
ref
,
&
fontface
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDWriteFontFaceReference_CreateFontFace
(
ref1
,
&
fontface1
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
fontface
==
fontface1
,
"got %p, expected %p
\n
"
,
fontface1
,
fontface
);
IDWriteFontFace3_Release
(
fontface
);
IDWriteFontFace3_Release
(
fontface1
);
IDWriteFontFaceReference_Release
(
ref1
);
IDWriteFontFaceReference_Release
(
ref
);
IDWriteFontFaceReference_Release
(
ref
);
/* create reference from a file */
hr
=
IDWriteFactory3_CreateFontFileReference
(
factory3
,
path
,
NULL
,
&
file
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDWriteFactory3_CreateFontFaceReference_
(
factory3
,
file
,
0
,
DWRITE_FONT_SIMULATIONS_NONE
,
&
ref
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDWriteFontFaceReference_GetFontFile
(
ref
,
&
file1
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
file
!=
file1
,
"got %p, previous file %p
\n
"
,
file1
,
file
);
IDWriteFontFaceReference_Release
(
ref
);
IDWriteFontFile_Release
(
file
);
IDWriteFontFile_Release
(
file1
);
}
IDWriteFactory3_Release
(
factory3
);
IDWriteFactory3_Release
(
factory3
);
DELETE_FONTFILE
(
path
);
DELETE_FONTFILE
(
path
);
}
}
...
...
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