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
e6cd0f7d
Commit
e6cd0f7d
authored
Nov 18, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 19, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite/tests: Some tests for ReadFileFragment().
parent
f16960ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
0 deletions
+72
-0
font.c
dlls/dwrite/tests/font.c
+72
-0
No files found.
dlls/dwrite/tests/font.c
View file @
e6cd0f7d
...
...
@@ -2412,6 +2412,77 @@ static void test_CreateStreamFromKey(void)
DeleteFileW
(
test_fontfile
);
}
static
void
test_ReadFileFragment
(
void
)
{
IDWriteLocalFontFileLoader
*
localloader
;
IDWriteFontFileStream
*
stream
;
IDWriteFontFileLoader
*
loader
;
IDWriteFactory
*
factory
;
IDWriteFontFile
*
file
;
const
void
*
fragment
,
*
fragment2
;
void
*
key
,
*
context
,
*
context2
;
UINT64
filesize
;
UINT32
size
;
HRESULT
hr
;
factory
=
create_factory
();
create_testfontfile
(
test_fontfile
);
hr
=
IDWriteFactory_CreateFontFileReference
(
factory
,
test_fontfile
,
NULL
,
&
file
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
key
=
NULL
;
size
=
0
;
hr
=
IDWriteFontFile_GetReferenceKey
(
file
,
(
const
void
**
)
&
key
,
&
size
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
size
!=
0
,
"got %u
\n
"
,
size
);
hr
=
IDWriteFontFile_GetLoader
(
file
,
&
loader
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
IDWriteFontFileLoader_QueryInterface
(
loader
,
&
IID_IDWriteLocalFontFileLoader
,
(
void
**
)
&
localloader
);
IDWriteFontFileLoader_Release
(
loader
);
hr
=
IDWriteLocalFontFileLoader_CreateStreamFromKey
(
localloader
,
key
,
size
,
&
stream
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDWriteFontFileStream_GetFileSize
(
stream
,
&
filesize
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
/* reading past the end of the stream */
fragment
=
(
void
*
)
0xdeadbeef
;
context
=
(
void
*
)
0xdeadbeef
;
hr
=
IDWriteFontFileStream_ReadFileFragment
(
stream
,
&
fragment
,
0
,
filesize
+
1
,
&
context
);
todo_wine
{
ok
(
hr
==
E_FAIL
,
"got 0x%08x
\n
"
,
hr
);
ok
(
context
==
NULL
,
"got %p
\n
"
,
context
);
ok
(
fragment
==
NULL
,
"got %p
\n
"
,
fragment
);
}
fragment
=
(
void
*
)
0xdeadbeef
;
context
=
(
void
*
)
0xdeadbeef
;
hr
=
IDWriteFontFileStream_ReadFileFragment
(
stream
,
&
fragment
,
0
,
filesize
,
&
context
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
context
==
NULL
,
"got %p
\n
"
,
context
);
ok
(
fragment
!=
NULL
,
"got %p
\n
"
,
fragment
);
fragment2
=
(
void
*
)
0xdeadbeef
;
context2
=
(
void
*
)
0xdeadbeef
;
hr
=
IDWriteFontFileStream_ReadFileFragment
(
stream
,
&
fragment2
,
0
,
filesize
,
&
context2
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
todo_wine
{
ok
(
context2
==
NULL
,
"got %p
\n
"
,
context2
);
ok
(
fragment
==
fragment2
,
"got %p, %p
\n
"
,
fragment
,
fragment2
);
}
IDWriteFontFileStream_ReleaseFileFragment
(
stream
,
context
);
IDWriteFontFileStream_ReleaseFileFragment
(
stream
,
context2
);
IDWriteFontFileStream_Release
(
stream
);
IDWriteLocalFontFileLoader_Release
(
localloader
);
IDWriteFactory_Release
(
factory
);
DeleteFileW
(
test_fontfile
);
}
START_TEST
(
font
)
{
IDWriteFactory
*
factory
;
...
...
@@ -2444,6 +2515,7 @@ START_TEST(font)
test_TryGetFontTable
();
test_ConvertFontToLOGFONT
();
test_CreateStreamFromKey
();
test_ReadFileFragment
();
IDWriteFactory_Release
(
factory
);
}
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