Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
42d453b0
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
11 个月 前同步成功
通知
0
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
42d453b0
编写于
6月 28, 2011
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[test] Name tests after their input string
上级
27413169
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
100 addition
and
52 deletion
+100
-52
test/Makefile.am
test/Makefile.am
+1
-1
test/test-shape-complex.c
test/test-shape-complex.c
+99
-51
未找到文件。
test/Makefile.am
浏览文件 @
42d453b0
...
...
@@ -82,7 +82,7 @@ check-tool-raw:
# check-gtester: Run tests under gtester
GTESTER
=
gtester
check-gtester
:
$(AM_V_at)$(MAKE)
$(AM_MAKEFLGS)
check-tool-raw
TOOL
=
"
$(GTESTER)
--verbose"
$(AM_V_at)$(MAKE)
$(AM_MAKEFLGS)
check-tool-raw
TOOL
=
"
$(GTESTER)
--verbose
--keep-going
"
# Check tests under valgrind. Saves log to log-valgrind.txt
...
...
test/test-shape-complex.c
浏览文件 @
42d453b0
...
...
@@ -44,6 +44,13 @@ typedef struct
/* TODO add min/max face version */
}
font_data_t
;
static
char
*
get_font_file
(
const
font_data_t
*
font_data
)
{
return
g_strdup_printf
(
"%s/fonts/%s"
,
srcdir
(),
font_data
->
font_file
);
}
typedef
struct
{
char
comments
[
64
];
...
...
@@ -54,13 +61,13 @@ typedef struct
typedef
struct
{
const
font_data_t
font_data
;
const
test_data_t
tests
[];
const
test_data_t
test
_data
s
[];
}
test_set_t
;
typedef
struct
{
const
font_data_t
font_data
;
const
test_data_t
tests
[]
;
const
font_data_t
*
font_data
;
const
test_data_t
*
test_data
;
}
test_t
;
...
...
@@ -79,7 +86,7 @@ static const test_set_t tests_greek = {
}
};
static
const
test_set_t
tests_devanagari
_
1
=
{
static
const
test_set_t
tests_devanagari1
=
{
{
"raghu.ttf"
,
0
},
{
{
"Ka"
,
...
...
@@ -134,7 +141,7 @@ static const test_set_t tests_devanagari_1 = {
}
};
static
const
test_set_t
tests_devanagari
_
2
=
{
static
const
test_set_t
tests_devanagari2
=
{
{
"mangal.ttf"
,
0
},
{
{
"Ka"
,
...
...
@@ -189,7 +196,7 @@ static const test_set_t tests_devanagari_2 = {
}
};
static
const
test_set_t
tests_bengali
_
1
=
{
static
const
test_set_t
tests_bengali1
=
{
{
"AkaashNormal.ttf"
,
0
},
{
{
"Ka"
,
...
...
@@ -337,7 +344,7 @@ static const test_set_t tests_bengali_1 = {
}
};
static
const
test_set_t
tests_bengali
_
2
=
{
static
const
test_set_t
tests_bengali2
=
{
{
"MuktiNarrow.ttf"
,
0
},
{
{
"Ka"
,
...
...
@@ -460,7 +467,7 @@ static const test_set_t tests_bengali_2 = {
}
};
static
const
test_set_t
tests_bengali
_
3
=
{
static
const
test_set_t
tests_bengali3
=
{
{
"LikhanNormal.ttf"
,
0
},
{
{
""
,
...
...
@@ -691,7 +698,7 @@ static const test_set_t tests_telugu = {
}
};
static
const
test_set_t
tests_kannada
_
1
=
{
static
const
test_set_t
tests_kannada1
=
{
{
"Sampige.ttf"
,
0
},
{
{
""
,
...
...
@@ -738,7 +745,7 @@ static const test_set_t tests_kannada_1 = {
}
};
static
const
test_set_t
tests_kannada
_
2
=
{
static
const
test_set_t
tests_kannada2
=
{
{
"tunga.ttf"
,
0
},
{
{
""
,
...
...
@@ -773,7 +780,7 @@ static const test_set_t tests_kannada_2 = {
}
};
static
const
test_set_t
tests_malayalam
_
1
=
{
static
const
test_set_t
tests_malayalam1
=
{
{
"AkrutiMal2Normal.ttf"
,
0
},
{
{
""
,
...
...
@@ -853,7 +860,7 @@ static const test_set_t tests_malayalam_1 = {
}
};
static
const
test_set_t
tests_malayalam
_
2
=
{
static
const
test_set_t
tests_malayalam2
=
{
{
"Rachana.ttf"
,
0
},
{
{
""
,
...
...
@@ -995,6 +1002,8 @@ static const test_set_t tests_linearb = {
typedef
struct
{
FT_Library
ft_library
;
FT_Face
ft_face
;
...
...
@@ -1004,15 +1013,16 @@ typedef struct {
static
void
ft_fixture_init
(
ft_fixture_t
*
f
,
gconstpointer
user_data
)
{
const
test_set_t
*
test
=
user_data
;
char
*
font_file
=
g_strdup_printf
(
"%s/fonts/%s"
,
srcdir
(),
test
->
font_data
.
font_file
);
const
test_t
*
test
=
user_data
;
char
*
font_file
=
get_font_file
(
test
->
font_data
);
FT_Error
err
;
FT_Init_FreeType
(
&
f
->
ft_library
);
if
(
FT_New_Face
(
f
->
ft_library
,
font_file
,
test
->
font_data
.
face_index
,
&
f
->
ft_face
))
g_test_message
(
"Font file %s not found. Skipping test."
,
font_file
);
else
f
->
font
=
hb_ft_font_create
(
f
->
ft_face
,
NULL
);
err
=
FT_New_Face
(
f
->
ft_library
,
font_file
,
test
->
font_data
->
face_index
,
&
f
->
ft_face
);
g_assert_cmpint
(
err
,
==
,
0
);
f
->
font
=
hb_ft_font_create
(
f
->
ft_face
,
NULL
);
g_free
(
font_file
);
}
...
...
@@ -1029,45 +1039,83 @@ ft_fixture_finish (ft_fixture_t *f, gconstpointer user_data)
static
void
test_shape_complex
(
ft_fixture_t
*
f
,
gconstpointer
user_data
)
{
const
test_
set_t
*
test_se
t
=
user_data
;
const
test_data_t
*
data
;
if
(
!
f
->
font
)
return
;
/* Skip test */
const
test_
t
*
tes
t
=
user_data
;
const
test_data_t
*
data
=
test
->
test_data
;
hb_buffer_t
*
buffer
;
unsigned
int
i
,
len
,
expected_len
;
hb_glyph_info_t
*
glyphs
;
for
(
data
=
test_set
->
tests
;
data
->
characters
[
0
];
data
++
)
{
hb_buffer_t
*
buffer
;
unsigned
int
i
,
len
,
expected_len
;
hb_glyph_info_t
*
glyphs
;
g_assert
(
f
->
font
);
if
(
data
->
comments
[
0
])
g_test_message
(
"Test comments: %s"
,
data
->
comments
);
if
(
data
->
comments
[
0
])
g_test_message
(
"Test comments: %s"
,
data
->
comments
);
buffer
=
hb_buffer_create
(
0
);
for
(
len
=
0
;
data
->
characters
[
len
];
len
++
)
;
hb_buffer_add_utf32
(
buffer
,
data
->
characters
,
len
,
0
,
len
);
buffer
=
hb_buffer_create
(
0
);
for
(
len
=
0
;
data
->
characters
[
len
];
len
++
)
;
hb_buffer_add_utf32
(
buffer
,
data
->
characters
,
len
,
0
,
len
);
hb_shape
(
f
->
font
,
buffer
,
NULL
,
0
);
hb_shape
(
f
->
font
,
buffer
,
NULL
,
0
);
for
(
len
=
0
;
data
->
glyphs
[
len
];
len
++
)
;
expected_len
=
len
;
for
(
len
=
0
;
data
->
glyphs
[
len
];
len
++
)
;
expected_len
=
len
;
glyphs
=
hb_buffer_get_glyph_infos
(
buffer
,
&
len
);
g_assert_cmpint
(
len
,
==
,
expected_len
);
for
(
i
=
0
;
i
<
len
;
i
++
)
g_assert_cmphex
(
glyphs
[
i
].
codepoint
,
==
,
data
->
glyphs
[
i
]);
glyphs
=
hb_buffer_get_glyph_infos
(
buffer
,
&
len
);
g_assert_cmpint
(
len
,
==
,
expected_len
);
for
(
i
=
0
;
i
<
len
;
i
++
)
g_assert_cmpint
(
glyphs
[
i
].
codepoint
,
==
,
data
->
glyphs
[
i
]);
hb_buffer_destroy
(
buffer
);
}
hb_buffer_destroy
(
buffer
);
}
static
void
test_shape_complex_skipped
(
gconstpointer
user_data
)
{
const
test_t
*
test
=
user_data
;
const
test_data_t
*
data
=
test
->
test_data
;
if
(
data
->
comments
[
0
])
g_test_message
(
"Test comments: %s"
,
data
->
comments
);
g_test_message
(
"Skipping test"
);
}
static
void
add_test_set
(
const
test_set_t
*
test_set
,
const
char
*
set_name
)
{
const
test_data_t
*
data
;
char
*
font_file
;
hb_bool_t
skip
;
font_file
=
get_font_file
(
&
test_set
->
font_data
);
skip
=
!
g_file_test
(
font_file
,
G_FILE_TEST_EXISTS
);
g_free
(
font_file
);
for
(
data
=
test_set
->
test_datas
;
data
->
characters
[
0
];
data
++
)
{
char
*
flavor
;
GString
*
str
;
const
hb_codepoint_t
*
p
;
hb_test_add_fixture_flavor
(
ft_fixture
,
(
const
void
*
)
test_set
,
set_name
,
test_shape_complex
);
test_t
*
test
=
g_slice_new0
(
test_t
);
test
->
font_data
=
&
test_set
->
font_data
;
test
->
test_data
=
data
;
str
=
g_string_new
(
"<"
);
for
(
p
=
data
->
characters
;
*
p
;
p
++
)
g_string_append_printf
(
str
,
"%04X,"
,
*
p
);
str
->
str
[
str
->
len
-
1
]
=
'>'
;
flavor
=
g_strdup_printf
(
"%s/%s/%s"
,
set_name
,
test_set
->
font_data
.
font_file
,
str
->
str
);
g_string_free
(
str
,
TRUE
);
if
(
skip
)
hb_test_add_data_flavor
((
const
void
*
)
test
,
flavor
,
test_shape_complex_skipped
);
else
hb_test_add_fixture_flavor
(
ft_fixture
,
(
const
void
*
)
test
,
flavor
,
test_shape_complex
);
g_free
(
flavor
);
}
}
...
...
@@ -1080,19 +1128,19 @@ main (int argc, char **argv)
TEST_SET
(
greek
);
TEST_SET
(
devanagari
_
1
);
TEST_SET
(
devanagari
_
2
);
TEST_SET
(
bengali
_
1
);
TEST_SET
(
bengali
_
2
);
TEST_SET
(
bengali
_
3
);
TEST_SET
(
devanagari1
);
TEST_SET
(
devanagari2
);
TEST_SET
(
bengali1
);
TEST_SET
(
bengali2
);
TEST_SET
(
bengali3
);
TEST_SET
(
gurmukhi
);
TEST_SET
(
oriya
);
TEST_SET
(
tamil
);
TEST_SET
(
telugu
);
TEST_SET
(
kannada
_
1
);
TEST_SET
(
kannada
_
2
);
TEST_SET
(
malayalam
_
1
);
TEST_SET
(
malayalam
_
2
);
TEST_SET
(
kannada1
);
TEST_SET
(
kannada2
);
TEST_SET
(
malayalam1
);
TEST_SET
(
malayalam2
);
TEST_SET
(
sinhala
);
TEST_SET
(
khmer
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录