Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
918fac39
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
大约 1 年 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
918fac39
编写于
5月 08, 2023
作者:
Y
y00314596
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add by yangqing3@huawei.com
Signed-off-by:
N
y00314596
<
yangqing3@huawei.com
>
上级
df247916
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
1364 addition
and
30 deletion
+1364
-30
global/global_napi_test/entry/src/main/cpp/napi/global_napi_test.cpp
...al_napi_test/entry/src/main/cpp/napi/global_napi_test.cpp
+2
-2
global/i18n_standard/intljs/src/main/js/test/I18n.test.js
global/i18n_standard/intljs/src/main/js/test/I18n.test.js
+1160
-28
global/perf/perfjs/src/main/js/test/Perf.test.js
global/perf/perfjs/src/main/js/test/Perf.test.js
+202
-0
未找到文件。
global/global_napi_test/entry/src/main/cpp/napi/global_napi_test.cpp
浏览文件 @
918fac39
...
...
@@ -40,8 +40,8 @@ static napi_value GetFileList(napi_env env, napi_callback_info info)
int
count
=
OH_ResourceManager_GetRawFileCount
(
rawDir
);
std
::
vector
<
std
::
string
>
tempArray
;
for
(
int
i
=
0
;
i
<
count
;
i
++
)
{
std
::
string
filename
=
OH_ResourceManager_GetRawFileName
(
rawDir
,
i
);
tempArray
.
emplace_back
(
filename
);
std
::
string
raw
filename
=
OH_ResourceManager_GetRawFileName
(
rawDir
,
i
);
tempArray
.
emplace_back
(
raw
filename
);
}
napi_value
fileList
;
...
...
global/i18n_standard/intljs/src/main/js/test/I18n.test.js
浏览文件 @
918fac39
此差异已折叠。
点击以展开。
global/perf/perfjs/src/main/js/test/Perf.test.js
浏览文件 @
918fac39
...
...
@@ -1762,6 +1762,31 @@ describe('PerfTest', function () {
}
})
/* *
* @tc.number SUB_GLOBAL_PERF_JS_5920
* @tc.name test the performance of Locale
* @tc.desc check the performance of Locale
*/
it
(
'
perf_test_5920
'
,
0
,
function
()
{
console
.
log
(
'
perf_test_5920
'
+
'
start
'
);
let
locale
=
null
;
let
startTime
=
new
Date
().
getTime
();
for
(
let
i
=
0
;
i
<
EXETIME
;
i
++
){
locale
=
new
Intl
.
Locale
();
}
let
exeTime
=
new
Date
().
getTime
()
-
startTime
;
let
avgTime
=
exeTime
/
EXETIME
;
console
.
log
(
'
perf_test_5920--
'
+
'
exeTime:
'
+
exeTime
+
'
avgTime:
'
+
avgTime
);
if
(
avgTime
<
10
){
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
}
})
/* *
* @tc.number SUB_GLOBAL_PERF_JS_6000
* @tc.name test the performance of toString
...
...
@@ -1870,6 +1895,31 @@ describe('PerfTest', function () {
}
})
/* *
* @tc.number SUB_GLOBAL_PERF_JS_6320
* @tc.name test the performance of DateTimeFormat
* @tc.desc check the performance of DateTimeFormat
*/
it
(
'
perf_test_6320
'
,
0
,
function
()
{
console
.
log
(
'
perf_test_6320
'
+
'
start
'
);
let
datefmt
=
null
;
let
startTime
=
new
Date
().
getTime
();
for
(
let
i
=
0
;
i
<
EXETIME
;
i
++
){
datefmt
=
new
Intl
.
DateTimeFormat
();
}
let
exeTime
=
new
Date
().
getTime
()
-
startTime
;
let
avgTime
=
exeTime
/
EXETIME
;
console
.
log
(
'
perf_test_6320--
'
+
'
exeTime:
'
+
exeTime
+
'
avgTime:
'
+
avgTime
);
if
(
avgTime
<
10
){
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
}
})
/* *
* @tc.number SUB_GLOBAL_PERF_JS_6400
* @tc.name test the performance of DateTimeFormat.format
...
...
@@ -1979,6 +2029,31 @@ describe('PerfTest', function () {
}
})
/* *
* @tc.number SUB_GLOBAL_PERF_JS_6720
* @tc.name test the performance of NumberFormat
* @tc.desc check the performance of NumberFormat
*/
it
(
'
perf_test_6720
'
,
0
,
function
()
{
console
.
log
(
'
perf_test_6720
'
+
'
start
'
);
let
numfmt
=
null
;
let
startTime
=
new
Date
().
getTime
();
for
(
let
i
=
0
;
i
<
EXETIME
;
i
++
){
numfmt
=
new
Intl
.
NumberFormat
();
}
let
exeTime
=
new
Date
().
getTime
()
-
startTime
;
let
avgTime
=
exeTime
/
EXETIME
;
console
.
log
(
'
perf_test_6720--
'
+
'
exeTime:
'
+
exeTime
+
'
avgTime:
'
+
avgTime
);
if
(
avgTime
<
10
){
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
}
})
/* *
* @tc.number SUB_GLOBAL_PERF_JS_6800
* @tc.name test the performance of NumberFormat.format
...
...
@@ -2062,6 +2137,31 @@ describe('PerfTest', function () {
}
})
/* *
* @tc.number SUB_GLOBAL_PERF_JS_7020
* @tc.name test the performance of PluralRules
* @tc.desc check the performance of PluralRules
*/
it
(
'
perf_test_7020
'
,
0
,
function
()
{
console
.
log
(
'
perf_test_7020
'
+
'
start
'
);
let
pl
=
null
;
let
startTime
=
new
Date
().
getTime
();
for
(
let
i
=
0
;
i
<
EXETIME
;
i
++
){
pl
=
new
Intl
.
PluralRules
();
}
let
exeTime
=
new
Date
().
getTime
()
-
startTime
;
let
avgTime
=
exeTime
/
EXETIME
;
console
.
log
(
'
perf_test_7020--
'
+
'
exeTime:
'
+
exeTime
+
'
avgTime:
'
+
avgTime
);
if
(
avgTime
<
10
){
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
}
})
/* *
* @tc.number SUB_GLOBAL_PERF_JS_7100
* @tc.name test the performance of PluralRules.select
...
...
@@ -2114,6 +2214,31 @@ describe('PerfTest', function () {
}
})
/* *
* @tc.number SUB_GLOBAL_PERF_JS_7220
* @tc.name test the performance of Collator
* @tc.desc check the performance of Collator
*/
it
(
'
perf_test_7220
'
,
0
,
function
()
{
console
.
log
(
'
perf_test_7220
'
+
'
start
'
);
let
coll
=
null
;
let
startTime
=
new
Date
().
getTime
();
for
(
let
i
=
0
;
i
<
EXETIME
;
i
++
){
coll
=
new
Intl
.
Collator
();
}
let
exeTime
=
new
Date
().
getTime
()
-
startTime
;
let
avgTime
=
exeTime
/
EXETIME
;
console
.
log
(
'
perf_test_7220--
'
+
'
exeTime:
'
+
exeTime
+
'
avgTime:
'
+
avgTime
);
if
(
avgTime
<
10
){
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
}
})
/* *
* @tc.number SUB_GLOBAL_PERF_JS_7300
* @tc.name test the performance of Collator.compare with same param
...
...
@@ -2218,6 +2343,31 @@ describe('PerfTest', function () {
}
})
/* *
* @tc.number SUB_GLOBAL_PERF_JS_7620
* @tc.name test the performance of RelativeTimeFormat
* @tc.desc check the performance of RelativeTimeFormat
*/
it
(
'
perf_test_7620
'
,
0
,
function
()
{
console
.
log
(
'
perf_test_7620
'
+
'
start
'
);
let
relativetimefmt
=
null
;
let
startTime
=
new
Date
().
getTime
();
for
(
let
i
=
0
;
i
<
EXETIME
;
i
++
){
relativetimefmt
=
new
Intl
.
RelativeTimeFormat
();
}
let
exeTime
=
new
Date
().
getTime
()
-
startTime
;
let
avgTime
=
exeTime
/
EXETIME
;
console
.
log
(
'
perf_test_7620--
'
+
'
exeTime:
'
+
exeTime
+
'
avgTime:
'
+
avgTime
);
if
(
avgTime
<
10
){
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
}
})
/* *
* @tc.number SUB_GLOBAL_PERF_JS_7700
* @tc.name test the performance of RelativeTimeFormat.format
...
...
@@ -2666,5 +2816,57 @@ describe('PerfTest', function () {
}
})
/* *
* @tc.number SUB_GLOBAL_PERF_JS_9600
* @tc.name test the performance of Normalizer.getInstance
* @tc.desc check the performance of Normalizer.getInstance
*/
it
(
'
perf_test_9600
'
,
0
,
function
()
{
console
.
log
(
'
perf_test_9600
'
+
'
start
'
);
let
startTime
=
new
Date
().
getTime
();
for
(
let
i
=
0
;
i
<
EXETIME
;
i
++
){
let
normal
=
I18n
.
Normalizer
.
getInstance
(
I18n
.
NormalizerMode
.
NFC
);
}
let
exeTime
=
new
Date
().
getTime
()
-
startTime
;
let
avgTime
=
exeTime
/
EXETIME
;
console
.
log
(
'
perf_test_9600--
'
+
'
exeTime:
'
+
exeTime
+
'
avgTime:
'
+
avgTime
);
if
(
avgTime
<
10
){
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
}
})
/* *
* @tc.number SUB_GLOBAL_PERF_JS_9700
* @tc.name test the performance of Normalizer.normalize
* @tc.desc check the performance of Normalizer.normalize
*/
it
(
'
perf_test_9700
'
,
0
,
function
()
{
console
.
log
(
'
perf_test_9700
'
+
'
start
'
);
let
str
=
'
\
u1e9b
\
u0323
'
;
let
value
=
'
test
'
;
let
normal
=
I18n
.
Normalizer
.
getInstance
(
I18n
.
NormalizerMode
.
NFC
);
let
startTime
=
new
Date
().
getTime
();
for
(
let
i
=
0
;
i
<
EXETIME
;
i
++
){
value
=
normal
.
normalize
(
str
);
}
let
exeTime
=
new
Date
().
getTime
()
-
startTime
;
let
avgTime
=
exeTime
/
EXETIME
;
console
.
log
(
'
perf_test_9700--
'
+
'
value:
'
+
value
+
'
exeTime:
'
+
exeTime
+
'
avgTime:
'
+
avgTime
);
if
(
avgTime
<
10
){
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
}
})
console
.
log
(
'
*************end PerfTest*************
'
);
})}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录