Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
77d5c3df
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
接近 2 年 前同步成功
通知
1
Star
18
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Harfbuzz
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
77d5c3df
编写于
10月 19, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[font] Add failing test amongst font-func parallels infinite-looping
Reported by Nona while updating Android to HarfBuzz 2.0.0.
上级
29d87751
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
64 addition
and
0 deletion
+64
-0
test/api/test-font.c
test/api/test-font.c
+64
-0
未找到文件。
test/api/test-font.c
浏览文件 @
77d5c3df
...
@@ -364,6 +364,69 @@ test_fontfuncs_subclassing (void)
...
@@ -364,6 +364,69 @@ test_fontfuncs_subclassing (void)
hb_font_destroy
(
font2
);
hb_font_destroy
(
font2
);
}
}
static
hb_bool_t
nominal_glyph_func
(
hb_font_t
*
font
HB_UNUSED
,
void
*
font_data
HB_UNUSED
,
hb_codepoint_t
unicode
,
hb_codepoint_t
*
glyph
,
void
*
user_data
HB_UNUSED
)
{
*
glyph
=
0
;
return
FALSE
;
}
static
unsigned
int
nominal_glyphs_func
(
hb_font_t
*
font
HB_UNUSED
,
void
*
font_data
HB_UNUSED
,
unsigned
int
count
HB_UNUSED
,
const
hb_codepoint_t
*
first_unicode
HB_UNUSED
,
unsigned
int
unicode_stride
HB_UNUSED
,
hb_codepoint_t
*
first_glyph
HB_UNUSED
,
unsigned
int
glyph_stride
HB_UNUSED
,
void
*
user_data
HB_UNUSED
)
{
return
0
;
}
static
void
test_fontfuncs_parallels
(
void
)
{
hb_blob_t
*
blob
;
hb_face_t
*
face
;
hb_font_funcs_t
*
ffuncs1
;
hb_font_funcs_t
*
ffuncs2
;
hb_font_t
*
font0
;
hb_font_t
*
font1
;
hb_font_t
*
font2
;
blob
=
hb_blob_create
(
test_data
,
sizeof
(
test_data
),
HB_MEMORY_MODE_READONLY
,
NULL
,
NULL
);
face
=
hb_face_create
(
blob
,
0
);
hb_blob_destroy
(
blob
);
font0
=
hb_font_create
(
face
);
hb_face_destroy
(
face
);
/* setup sub-font1 */
font1
=
hb_font_create_sub_font
(
font0
);
hb_font_destroy
(
font0
);
ffuncs1
=
hb_font_funcs_create
();
hb_font_funcs_set_nominal_glyph_func
(
ffuncs1
,
nominal_glyph_func
,
NULL
,
NULL
);
hb_font_set_funcs
(
font1
,
ffuncs1
,
NULL
,
NULL
);
hb_font_funcs_destroy
(
ffuncs1
);
/* setup sub-font2 */
font2
=
hb_font_create_sub_font
(
font1
);
hb_font_destroy
(
font1
);
ffuncs2
=
hb_font_funcs_create
();
hb_font_funcs_set_nominal_glyphs_func
(
ffuncs1
,
nominal_glyphs_func
,
NULL
,
NULL
);
hb_font_set_funcs
(
font2
,
ffuncs2
,
NULL
,
NULL
);
hb_font_funcs_destroy
(
ffuncs2
);
/* Just test that calling get_nominal_glyph doesn't infinite-loop. */
hb_codepoint_t
glyph
;
hb_font_get_nominal_glyph
(
font2
,
0x0020u
,
&
glyph
);
}
static
void
static
void
test_font_empty
(
void
)
test_font_empty
(
void
)
...
@@ -543,6 +606,7 @@ main (int argc, char **argv)
...
@@ -543,6 +606,7 @@ main (int argc, char **argv)
hb_test_add
(
test_fontfuncs_empty
);
hb_test_add
(
test_fontfuncs_empty
);
hb_test_add
(
test_fontfuncs_nil
);
hb_test_add
(
test_fontfuncs_nil
);
hb_test_add
(
test_fontfuncs_subclassing
);
hb_test_add
(
test_fontfuncs_subclassing
);
hb_test_add
(
test_fontfuncs_parallels
);
hb_test_add
(
test_font_empty
);
hb_test_add
(
test_font_empty
);
hb_test_add
(
test_font_properties
);
hb_test_add
(
test_font_properties
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录