Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
61510b63
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看板
未验证
提交
61510b63
编写于
10月 16, 2018
作者:
E
Ebrahim Byagowi
提交者:
GitHub
10月 16, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[test] Minor cleanup in test-multithread and test-ot-name (#1256)
上级
42b75dc3
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
36 addition
and
32 deletion
+36
-32
test/api/CMakeLists.txt
test/api/CMakeLists.txt
+1
-1
test/api/Makefile.am
test/api/Makefile.am
+1
-1
test/api/test-multithread.c
test/api/test-multithread.c
+4
-2
test/api/test-ot-name.c
test/api/test-ot-name.c
+30
-28
未找到文件。
test/api/CMakeLists.txt
浏览文件 @
61510b63
...
@@ -4,7 +4,7 @@ if (HB_HAVE_GLIB)
...
@@ -4,7 +4,7 @@ if (HB_HAVE_GLIB)
list
(
APPEND TEST_PROGS
list
(
APPEND TEST_PROGS
test-ot-color
test-ot-color
test-ot-name
id
test-ot-name
test-ot-tag
test-ot-tag
test-c
test-c
test-cplusplus
test-cplusplus
...
...
test/api/Makefile.am
浏览文件 @
61510b63
...
@@ -71,7 +71,7 @@ endif
...
@@ -71,7 +71,7 @@ endif
TEST_PROGS
+=
\
TEST_PROGS
+=
\
test-ot-color
\
test-ot-color
\
test-ot-name
id
\
test-ot-name
\
test-ot-tag
\
test-ot-tag
\
$(NULL)
$(NULL)
...
...
test/api/test-multithread.c
浏览文件 @
61510b63
...
@@ -154,13 +154,15 @@ main (int argc, char **argv)
...
@@ -154,13 +154,15 @@ main (int argc, char **argv)
hb_face_t
*
face
=
hb_face_create
(
blob
,
0
);
hb_face_t
*
face
=
hb_face_create
(
blob
,
0
);
font
=
hb_font_create
(
face
);
font
=
hb_font_create
(
face
);
hb_ot_font_set_funcs
(
font
);
/* Fill the reference */
ref_buffer
=
hb_buffer_create
();
ref_buffer
=
hb_buffer_create
();
fill_the_buffer
(
ref_buffer
);
fill_the_buffer
(
ref_buffer
);
/* Unnecessary, since version 2 it is ot-font by default */
hb_ot_font_set_funcs
(
font
);
test_body
();
test_body
();
/* Test hb-ft in multithread */
hb_ft_font_set_funcs
(
font
);
hb_ft_font_set_funcs
(
font
);
test_body
();
test_body
();
...
...
test/api/test-ot-name
id
.c
→
test/api/test-ot-name.c
浏览文件 @
61510b63
...
@@ -23,35 +23,16 @@
...
@@ -23,35 +23,16 @@
*
*
*/
*/
#include <hb.h>
#include "hb-test.h"
#include <hb-ot.h>
#include <hb-ot.h>
#include <glib.h>
static
const
char
*
font_path
=
"fonts/cv01.otf"
;
static
const
char
*
font_path
=
"fonts/cv01.otf"
;
static
hb_face_t
*
face
;
int
static
void
main
(
int
argc
,
char
**
argv
)
test_ot_layout_feature_get_name_ids_and_characters
(
)
{
{
g_test_init
(
&
argc
,
&
argv
,
NULL
);
#if GLIB_CHECK_VERSION(2,37,2)
gchar
*
default_path
=
g_test_build_filename
(
G_TEST_DIST
,
font_path
,
NULL
);
#else
gchar
*
default_path
=
g_strdup
(
font_path
);
#endif
hb_blob_t
*
blob
;
hb_face_t
*
face
;
hb_font_t
*
font
;
char
*
path
=
argc
>
1
&&
*
argv
[
1
]
?
argv
[
1
]
:
(
char
*
)
default_path
;
blob
=
hb_blob_create_from_file
(
path
);
if
(
hb_blob_get_length
(
blob
)
==
0
)
g_error
(
"Font not found."
);
face
=
hb_face_create
(
blob
,
0
);
font
=
hb_font_create
(
face
);
hb_tag_t
cv01
=
HB_TAG
(
'c'
,
'v'
,
'0'
,
'1'
);
hb_tag_t
cv01
=
HB_TAG
(
'c'
,
'v'
,
'0'
,
'1'
);
unsigned
int
feature_index
;
unsigned
int
feature_index
;
if
(
!
hb_ot_layout_language_find_feature
(
face
,
if
(
!
hb_ot_layout_language_find_feature
(
face
,
...
@@ -89,12 +70,33 @@ main (int argc, char **argv)
...
@@ -89,12 +70,33 @@ main (int argc, char **argv)
g_assert
(
char_count
==
2
);
g_assert
(
char_count
==
2
);
g_assert
(
characters
[
0
]
==
10
);
g_assert
(
characters
[
0
]
==
10
);
g_assert
(
characters
[
1
]
==
24030
);
g_assert
(
characters
[
1
]
==
24030
);
}
int
main
(
int
argc
,
char
**
argv
)
{
g_test_init
(
&
argc
,
&
argv
,
NULL
);
#if GLIB_CHECK_VERSION(2,37,2)
gchar
*
default_path
=
g_test_build_filename
(
G_TEST_DIST
,
font_path
,
NULL
);
#else
gchar
*
default_path
=
g_strdup
(
font_path
);
#endif
hb_blob_t
*
blob
;
char
*
path
=
argc
>
1
&&
*
argv
[
1
]
?
argv
[
1
]
:
(
char
*
)
default_path
;
blob
=
hb_blob_create_from_file
(
path
);
if
(
hb_blob_get_length
(
blob
)
==
0
)
g_error
(
"Font not found."
);
hb_font_destroy
(
font
);
face
=
hb_face_create
(
blob
,
0
);
hb_test_add
(
test_ot_layout_feature_get_name_ids_and_characters
);
unsigned
int
result
=
hb_test_run
();
hb_face_destroy
(
face
);
hb_face_destroy
(
face
);
hb_blob_destroy
(
blob
);
hb_blob_destroy
(
blob
);
g_free
(
default_path
);
g_free
(
default_path
);
return
result
;
return
0
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录