Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
db60c96f
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看板
提交
db60c96f
编写于
4月 11, 2011
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[teset] Test hb_script_t
上级
99b74760
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
42 addition
and
1 deletion
+42
-1
test/hb-test.h
test/hb-test.h
+8
-0
test/test-types.c
test/test-types.c
+34
-1
未找到文件。
test/hb-test.h
浏览文件 @
db60c96f
...
@@ -62,6 +62,14 @@ hb_test_bug_redhat (unsigned int number)
...
@@ -62,6 +62,14 @@ hb_test_bug_redhat (unsigned int number)
hb_test_bug
(
"http://bugzilla.redhat.com/"
,
number
);
hb_test_bug
(
"http://bugzilla.redhat.com/"
,
number
);
}
}
/* Misc */
/* This is too ugly to be public API, but quite handy. */
#define HB_TAG_CHAR4(s) (HB_TAG(((const char *) s)[0], \
((const char *) s)[1], \
((const char *) s)[2], \
((const char *) s)[3]))
HB_END_DECLS
HB_END_DECLS
#endif
/* HB_TEST_H */
#endif
/* HB_TEST_H */
test/test-types.c
浏览文件 @
db60c96f
...
@@ -50,7 +50,7 @@ test_types_int (void)
...
@@ -50,7 +50,7 @@ test_types_int (void)
static
void
static
void
test_types_direction
(
void
)
test_types_direction
(
void
)
{
{
g_assert_cmpint
((
signed
)
HB_DIRECTION_INVALID
,
<
,
0
);
g_assert_cmpint
((
signed
)
HB_DIRECTION_INVALID
,
==
,
-
1
);
g_assert_cmpint
(
HB_DIRECTION_LTR
,
==
,
0
);
g_assert_cmpint
(
HB_DIRECTION_LTR
,
==
,
0
);
g_assert
(
HB_DIRECTION_IS_HORIZONTAL
(
HB_DIRECTION_LTR
));
g_assert
(
HB_DIRECTION_IS_HORIZONTAL
(
HB_DIRECTION_LTR
));
...
@@ -96,6 +96,38 @@ test_types_tag (void)
...
@@ -96,6 +96,38 @@ test_types_tag (void)
g_assert_cmphex
(
hb_tag_from_string
(
NULL
),
==
,
HB_TAG_NONE
);
g_assert_cmphex
(
hb_tag_from_string
(
NULL
),
==
,
HB_TAG_NONE
);
}
}
static
void
test_types_script
(
void
)
{
hb_tag_t
arab
=
HB_TAG_CHAR4
(
"arab"
);
hb_tag_t
Arab
=
HB_TAG_CHAR4
(
"Arab"
);
hb_tag_t
ARAB
=
HB_TAG_CHAR4
(
"ARAB"
);
hb_tag_t
wWyZ
=
HB_TAG_CHAR4
(
"wWyZ"
);
hb_tag_t
Wwyz
=
HB_TAG_CHAR4
(
"Wwyz"
);
hb_tag_t
x123
=
HB_TAG_CHAR4
(
"x123"
);
g_assert_cmpint
((
signed
)
HB_SCRIPT_INVALID
,
==
,
-
1
);
g_assert_cmphex
(
HB_SCRIPT_ARABIC
,
!=
,
HB_SCRIPT_LATIN
);
g_assert_cmphex
(
HB_SCRIPT_ARABIC
,
==
,
hb_script_from_iso15924_tag
(
arab
));
g_assert_cmphex
(
HB_SCRIPT_ARABIC
,
==
,
hb_script_from_iso15924_tag
(
Arab
));
g_assert_cmphex
(
HB_SCRIPT_ARABIC
,
==
,
hb_script_from_iso15924_tag
(
ARAB
));
/* Arbitrary tags that look like may be valid ISO 15924 should be preserved. */
g_assert_cmphex
(
HB_SCRIPT_UNKNOWN
,
!=
,
hb_script_from_iso15924_tag
(
wWyZ
));
/* Otherwise, UNKNOWN should be returned. */
g_assert_cmphex
(
HB_SCRIPT_UNKNOWN
,
==
,
hb_script_from_iso15924_tag
(
x123
));
g_assert_cmphex
(
hb_script_to_iso15924_tag
(
HB_SCRIPT_ARABIC
),
==
,
Arab
);
g_assert_cmphex
(
hb_script_to_iso15924_tag
(
hb_script_from_iso15924_tag
(
wWyZ
)),
==
,
Wwyz
);
g_assert_cmpint
(
hb_script_get_horizontal_direction
(
HB_SCRIPT_LATIN
),
==
,
HB_DIRECTION_LTR
);
g_assert_cmpint
(
hb_script_get_horizontal_direction
(
HB_SCRIPT_ARABIC
),
==
,
HB_DIRECTION_RTL
);
g_assert_cmpint
(
hb_script_get_horizontal_direction
(
hb_script_from_iso15924_tag
(
wWyZ
)),
==
,
HB_DIRECTION_LTR
);
}
int
int
main
(
int
argc
,
char
**
argv
)
main
(
int
argc
,
char
**
argv
)
{
{
...
@@ -104,6 +136,7 @@ main (int argc, char **argv)
...
@@ -104,6 +136,7 @@ main (int argc, char **argv)
g_test_add_func
(
"/types/direction"
,
test_types_direction
);
g_test_add_func
(
"/types/direction"
,
test_types_direction
);
g_test_add_func
(
"/types/int"
,
test_types_int
);
g_test_add_func
(
"/types/int"
,
test_types_int
);
g_test_add_func
(
"/types/tag"
,
test_types_tag
);
g_test_add_func
(
"/types/tag"
,
test_types_tag
);
g_test_add_func
(
"/types/script"
,
test_types_tag
);
return
g_test_run
();
return
g_test_run
();
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录