Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_43355755
engine
提交
f9af6786
E
engine
项目概览
weixin_43355755
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f9af6786
编写于
1月 07, 2016
作者:
S
Seigo Nonaka
提交者:
Android (Google) Code Review
1月 07, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge "Fix lock assertion failures in unit test."
上级
97944f28
2342e531
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
11 addition
and
1 deletion
+11
-1
tests/FontCollectionItemizeTest.cpp
tests/FontCollectionItemizeTest.cpp
+4
-0
tests/FontFamilyTest.cpp
tests/FontFamilyTest.cpp
+2
-0
tests/FontLanguageListCacheTest.cpp
tests/FontLanguageListCacheTest.cpp
+5
-1
未找到文件。
tests/FontCollectionItemizeTest.cpp
浏览文件 @
f9af6786
...
@@ -20,12 +20,15 @@
...
@@ -20,12 +20,15 @@
#include "FontTestUtils.h"
#include "FontTestUtils.h"
#include "ICUTestBase.h"
#include "ICUTestBase.h"
#include "MinikinFontForTest.h"
#include "MinikinFontForTest.h"
#include "MinikinInternal.h"
#include "UnicodeUtils.h"
#include "UnicodeUtils.h"
using
android
::
AutoMutex
;
using
android
::
FontCollection
;
using
android
::
FontCollection
;
using
android
::
FontFamily
;
using
android
::
FontFamily
;
using
android
::
FontLanguage
;
using
android
::
FontLanguage
;
using
android
::
FontStyle
;
using
android
::
FontStyle
;
using
android
::
gMinikinLock
;
const
char
kItemizeFontXml
[]
=
kTestFontDir
"itemize.xml"
;
const
char
kItemizeFontXml
[]
=
kTestFontDir
"itemize.xml"
;
const
char
kEmojiFont
[]
=
kTestFontDir
"Emoji.ttf"
;
const
char
kEmojiFont
[]
=
kTestFontDir
"Emoji.ttf"
;
...
@@ -55,6 +58,7 @@ void itemize(FontCollection* collection, const char* str, FontStyle style,
...
@@ -55,6 +58,7 @@ void itemize(FontCollection* collection, const char* str, FontStyle style,
result
->
clear
();
result
->
clear
();
ParseUnicode
(
buf
,
BUF_SIZE
,
str
,
&
len
,
NULL
);
ParseUnicode
(
buf
,
BUF_SIZE
,
str
,
&
len
,
NULL
);
AutoMutex
_l
(
gMinikinLock
);
collection
->
itemize
(
buf
,
len
,
style
,
result
);
collection
->
itemize
(
buf
,
len
,
style
,
result
);
}
}
...
...
tests/FontFamilyTest.cpp
浏览文件 @
f9af6786
...
@@ -31,11 +31,13 @@ typedef ICUTestBase FontLanguagesTest;
...
@@ -31,11 +31,13 @@ typedef ICUTestBase FontLanguagesTest;
typedef
ICUTestBase
FontLanguageTest
;
typedef
ICUTestBase
FontLanguageTest
;
static
FontLanguages
createFontLanguages
(
const
std
::
string
&
input
)
{
static
FontLanguages
createFontLanguages
(
const
std
::
string
&
input
)
{
AutoMutex
_l
(
gMinikinLock
);
uint32_t
langId
=
FontLanguageListCache
::
getId
(
input
);
uint32_t
langId
=
FontLanguageListCache
::
getId
(
input
);
return
FontLanguageListCache
::
getById
(
langId
);
return
FontLanguageListCache
::
getById
(
langId
);
}
}
static
FontLanguage
createFontLanguage
(
const
std
::
string
&
input
)
{
static
FontLanguage
createFontLanguage
(
const
std
::
string
&
input
)
{
AutoMutex
_l
(
gMinikinLock
);
uint32_t
langId
=
FontLanguageListCache
::
getId
(
input
);
uint32_t
langId
=
FontLanguageListCache
::
getId
(
input
);
return
FontLanguageListCache
::
getById
(
langId
)[
0
];
return
FontLanguageListCache
::
getById
(
langId
)[
0
];
}
}
...
...
tests/FontLanguageListCacheTest.cpp
浏览文件 @
f9af6786
...
@@ -20,17 +20,20 @@
...
@@ -20,17 +20,20 @@
#include "FontLanguageListCache.h"
#include "FontLanguageListCache.h"
#include "ICUTestBase.h"
#include "ICUTestBase.h"
#include "MinikinInternal.h"
namespace
android
{
namespace
android
{
typedef
ICUTestBase
FontLanguageListCacheTest
;
typedef
ICUTestBase
FontLanguageListCacheTest
;
TEST_F
(
FontLanguageListCacheTest
,
getId
)
{
TEST_F
(
FontLanguageListCacheTest
,
getId
)
{
EXPECT_EQ
(
0UL
,
FontLanguageListCache
::
getId
(
""
));
EXPECT_NE
(
0UL
,
FontStyle
::
registerLanguageList
(
"en"
));
EXPECT_NE
(
0UL
,
FontStyle
::
registerLanguageList
(
"en"
));
EXPECT_NE
(
0UL
,
FontStyle
::
registerLanguageList
(
"jp"
));
EXPECT_NE
(
0UL
,
FontStyle
::
registerLanguageList
(
"jp"
));
EXPECT_NE
(
0UL
,
FontStyle
::
registerLanguageList
(
"en,zh-Hans"
));
EXPECT_NE
(
0UL
,
FontStyle
::
registerLanguageList
(
"en,zh-Hans"
));
AutoMutex
_l
(
gMinikinLock
);
EXPECT_EQ
(
0UL
,
FontLanguageListCache
::
getId
(
""
));
EXPECT_EQ
(
FontLanguageListCache
::
getId
(
"en"
),
FontLanguageListCache
::
getId
(
"en"
));
EXPECT_EQ
(
FontLanguageListCache
::
getId
(
"en"
),
FontLanguageListCache
::
getId
(
"en"
));
EXPECT_NE
(
FontLanguageListCache
::
getId
(
"en"
),
FontLanguageListCache
::
getId
(
"jp"
));
EXPECT_NE
(
FontLanguageListCache
::
getId
(
"en"
),
FontLanguageListCache
::
getId
(
"jp"
));
...
@@ -47,6 +50,7 @@ TEST_F(FontLanguageListCacheTest, getId) {
...
@@ -47,6 +50,7 @@ TEST_F(FontLanguageListCacheTest, getId) {
}
}
TEST_F
(
FontLanguageListCacheTest
,
getById
)
{
TEST_F
(
FontLanguageListCacheTest
,
getById
)
{
AutoMutex
_l
(
gMinikinLock
);
uint32_t
enLangId
=
FontLanguageListCache
::
getId
(
"en"
);
uint32_t
enLangId
=
FontLanguageListCache
::
getId
(
"en"
);
uint32_t
jpLangId
=
FontLanguageListCache
::
getId
(
"jp"
);
uint32_t
jpLangId
=
FontLanguageListCache
::
getId
(
"jp"
);
FontLanguage
english
=
FontLanguageListCache
::
getById
(
enLangId
)[
0
];
FontLanguage
english
=
FontLanguageListCache
::
getById
(
enLangId
)[
0
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录