Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
e7d8f65f
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看板
未验证
提交
e7d8f65f
编写于
3月 29, 2023
作者:
O
openharmony_ci
提交者:
Gitee
3月 29, 2023
浏览文件
操作
浏览文件
下载
差异文件
!8269 新增hilogjs测试用例
Merge pull request !8269 from chenxuihui/master
上级
2c98dc21
2d3fea20
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
415 addition
and
166 deletion
+415
-166
hiviewdfx/hilogtest/hilogjstest/src/main/js/test/HilogJsTest.js
...dfx/hilogtest/hilogjstest/src/main/js/test/HilogJsTest.js
+415
-166
未找到文件。
hiviewdfx/hilogtest/hilogjstest/src/main/js/test/HilogJsTest.js
浏览文件 @
e7d8f65f
/*
/*
* Copyright (C) 202
1
Huawei Device Co., Ltd.
* Copyright (C) 202
3
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
@@ -36,13 +36,13 @@ describe('HilogJsTest', function () {
...
@@ -36,13 +36,13 @@ describe('HilogJsTest', function () {
/**
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_0100
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_0100
* @tc.name hi
trace
interface test
* @tc.name hi
log
interface test
* @tc.desc hi
trace
begin interface test.
* @tc.desc hi
log
begin interface test.
*/
*/
it
(
'
testHilogJsApi01
'
,
2
,
function
()
{
it
(
'
testHilogJsApi01
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi01 start
'
);
console
.
info
(
'
testHilogJsApi01 start
'
);
try
{
try
{
hilog
.
debug
(
0x3200
,
"
HILOGTEST
"
,
"
%{public}s
"
,
[
'
hilogJs0100
'
]
)
hilog
.
debug
(
0x3200
,
"
HILOGTEST
"
,
"
%{public}s
"
,
'
hilogJs0100
'
)
}
catch
(
error
){
}
catch
(
error
){
console
.
log
(
`testHilogJsApi01 got an error:
${
JSON
.
stringify
(
error
)}
`
)
console
.
log
(
`testHilogJsApi01 got an error:
${
JSON
.
stringify
(
error
)}
`
)
expect
().
assertFail
()
expect
().
assertFail
()
...
@@ -52,66 +52,66 @@ describe('HilogJsTest', function () {
...
@@ -52,66 +52,66 @@ describe('HilogJsTest', function () {
/**
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_0200
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_0200
* @tc.name hi
trace
interface test
* @tc.name hi
log
interface test
* @tc.desc hi
trace
begin interface test.
* @tc.desc hi
log
begin interface test.
*/
*/
it
(
'
testHilogJsApi02
'
,
2
,
function
()
{
it
(
'
testHilogJsApi02
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi02 start
'
);
console
.
info
(
'
testHilogJsApi02 start
'
);
try
{
try
{
hilog
.
error
(
0x3200
,
"
HILOGTEST
"
,
"
%{public}s
"
,
[
'
hilogJs0200
'
]
)
hilog
.
error
(
0x3200
,
"
HILOGTEST
"
,
"
%{public}s
"
,
'
hilogJs0200
'
)
}
catch
(
error
){
}
catch
(
error
){
console
.
log
(
`testHilogJsApi02 got an error:
${
JSON
.
stringify
(
error
)}
`
)
console
.
log
(
`testHilogJsApi02 got an error:
${
JSON
.
stringify
(
error
)}
`
)
expect
().
assertFail
()
expect
().
assertFail
()
}
}
console
.
info
(
'
testHilogJsApi02 end
'
);
console
.
info
(
'
testHilogJsApi02 end
'
);
})
})
/**
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_0300
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_0300
* @tc.name hi
trace
interface test
* @tc.name hi
log
interface test
* @tc.desc hi
trace
begin interface test.
* @tc.desc hi
log
begin interface test.
*/
*/
it
(
'
testHilogJsApi03
'
,
2
,
function
()
{
it
(
'
testHilogJsApi03
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi03 start
'
);
console
.
info
(
'
testHilogJsApi03 start
'
);
try
{
try
{
hilog
.
fatal
(
0x3200
,
"
HILOGTEST
"
,
"
%{public}s
"
,
[
'
hilogJs0300
'
]
)
hilog
.
fatal
(
0x3200
,
"
HILOGTEST
"
,
"
%{public}s
"
,
'
hilogJs0300
'
)
}
catch
(
error
){
}
catch
(
error
){
console
.
log
(
`testHilogJsApi03 got an error:
${
JSON
.
stringify
(
error
)}
`
)
console
.
log
(
`testHilogJsApi03 got an error:
${
JSON
.
stringify
(
error
)}
`
)
expect
().
assertFail
()
expect
().
assertFail
()
}
}
console
.
info
(
'
testHilogJsApi03 end
'
);
console
.
info
(
'
testHilogJsApi03 end
'
);
})
})
/**
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_0400
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_0400
* @tc.name hi
trace
interface test
* @tc.name hi
log
interface test
* @tc.desc hi
trace
begin interface test.
* @tc.desc hi
log
begin interface test.
*/
*/
it
(
'
testHilogJsApi04
'
,
2
,
function
()
{
it
(
'
testHilogJsApi04
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi04 start
'
);
console
.
info
(
'
testHilogJsApi04 start
'
);
try
{
try
{
hilog
.
info
(
0x3200
,
"
HILOGTEST
"
,
"
%{public}s
"
,
[
'
hilogJs0400
'
]
)
hilog
.
info
(
0x3200
,
"
HILOGTEST
"
,
"
%{public}s
"
,
'
hilogJs0400
'
)
}
catch
(
error
){
}
catch
(
error
){
console
.
log
(
`testHilogJsApi04 got an error:
${
JSON
.
stringify
(
error
)}
`
)
console
.
log
(
`testHilogJsApi04 got an error:
${
JSON
.
stringify
(
error
)}
`
)
expect
().
assertFail
()
expect
().
assertFail
()
}
}
console
.
info
(
'
testHilogJsApi04 end
'
);
console
.
info
(
'
testHilogJsApi04 end
'
);
})
})
/**
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_0500
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_0500
* @tc.name hi
trace
interface test
* @tc.name hi
log
interface test
* @tc.desc hi
trace
begin interface test.
* @tc.desc hi
log
begin interface test.
*/
*/
it
(
'
testHilogJsApi05
'
,
2
,
function
()
{
it
(
'
testHilogJsApi05
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi04 start
'
);
console
.
info
(
'
testHilogJsApi04 start
'
);
try
{
try
{
hilog
.
warn
(
0x3200
,
"
HILOGTEST
"
,
"
%{public}s
"
,
[
'
hilogJs0500
'
]
)
hilog
.
warn
(
0x3200
,
"
HILOGTEST
"
,
"
%{public}s
"
,
'
hilogJs0500
'
)
}
catch
(
error
){
}
catch
(
error
){
console
.
log
(
`testHilogJsApi05 got an error:
${
JSON
.
stringify
(
error
)}
`
)
console
.
log
(
`testHilogJsApi05 got an error:
${
JSON
.
stringify
(
error
)}
`
)
expect
().
assertFail
()
expect
().
assertFail
()
}
}
console
.
info
(
'
testHilogJsApi05 end
'
);
console
.
info
(
'
testHilogJsApi05 end
'
);
})
})
/**
/**
...
@@ -244,201 +244,450 @@ describe('HilogJsTest', function () {
...
@@ -244,201 +244,450 @@ describe('HilogJsTest', function () {
* @tc.desc hitrace begin interface test.
* @tc.desc hitrace begin interface test.
*/
*/
it
(
'
testHilogJsApi16
'
,
2
,
function
()
{
it
(
'
testHilogJsApi16
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi16 start
'
);
console
.
info
(
'
testHilogJsApi16 start
'
);
try
{
try
{
hilog
.
debug
(
0x3200
,
"
HILOGTEST
"
,
"
%{public}s
"
,
[
'
hilogJs1800
'
]
)
hilog
.
debug
(
0x3200
,
"
HILOGTEST
"
,
"
%{public}s
"
,
'
hilogJs1800
'
)
}
catch
(
error
){
}
catch
(
error
){
console
.
log
(
`testHilogJsApi16 got an error:
${
JSON
.
stringify
(
error
)}
`
)
console
.
log
(
`testHilogJsApi16 got an error:
${
JSON
.
stringify
(
error
)}
`
)
expect
().
assertFail
();
expect
().
assertFail
();
}
}
console
.
info
(
'
testHilogJsApi16 end
'
);
console
.
info
(
'
testHilogJsApi16 end
'
);
})
})
/**
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_2100
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_2100
* @tc.name hi
trace
interface test
* @tc.name hi
log
interface test
* @tc.desc hi
trace
begin interface test.
* @tc.desc hi
log
begin interface test.
*/
*/
it
(
'
testHilogJsApi17
'
,
2
,
function
()
{
it
(
'
testHilogJsApi17
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi17 start
'
);
console
.
info
(
'
testHilogJsApi17 start
'
);
try
{
try
{
hilog
.
debug
(
0x3200
,
"
HILOGTEST
"
,
"
%{public}d
"
,
[
2.1
]
)
hilog
.
debug
(
0x3200
,
"
HILOGTEST
"
,
"
%{public}d
"
,
2.1
)
}
catch
(
error
){
}
catch
(
error
){
console
.
log
(
`testHilogJsApi17 got an error:
${
JSON
.
stringify
(
error
)}
`
)
console
.
log
(
`testHilogJsApi17 got an error:
${
JSON
.
stringify
(
error
)}
`
)
expect
().
assertFail
();
expect
().
assertFail
();
}
}
console
.
info
(
'
testHilogJsApi17 end
'
);
console
.
info
(
'
testHilogJsApi17 end
'
);
})
})
/**
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_2500
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_2500
* @tc.name hi
trace
interface test
* @tc.name hi
log
interface test
* @tc.desc hi
trace
begin interface test.
* @tc.desc hi
log
begin interface test.
*/
*/
it
(
'
testHilogJsApi18
'
,
2
,
function
()
{
it
(
'
testHilogJsApi18
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi18 start
'
);
console
.
info
(
'
testHilogJsApi18 start
'
);
try
{
try
{
hilog
.
debug
(
0x3200
,
"
HILOGTEST
"
,
"
%{public}d
"
,
[
65535
]
)
hilog
.
debug
(
0x3200
,
"
HILOGTEST
"
,
"
%{public}d
"
,
65535
)
}
catch
(
error
){
}
catch
(
error
){
console
.
log
(
`testHilogJsApi18 got an error:
${
JSON
.
stringify
(
error
)}
`
)
console
.
log
(
`testHilogJsApi18 got an error:
${
JSON
.
stringify
(
error
)}
`
)
expect
().
assertFail
();
expect
().
assertFail
();
}
}
console
.
info
(
'
testHilogJsApi18 end
'
);
console
.
info
(
'
testHilogJsApi18 end
'
);
})
})
/**
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_2600
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_2600
* @tc.name hi
trace
interface test
* @tc.name hi
log
interface test
* @tc.desc hi
trace
begin interface test.
* @tc.desc hi
log
begin interface test.
*/
*/
it
(
'
testHilogJsApi19
'
,
2
,
function
()
{
it
(
'
testHilogJsApi19
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi19 start
'
);
console
.
info
(
'
testHilogJsApi19 start
'
);
try
{
try
{
hilog
.
debug
(
0x3200
,
"
HILOGTEST
"
,
"
%{public}s
"
,
[
"
hilog info
"
]
)
hilog
.
debug
(
0x3200
,
"
HILOGTEST
"
,
"
%{public}s
"
,
"
hilog info
"
)
}
catch
(
error
){
}
catch
(
error
){
console
.
log
(
`testHilogJsApi19 got an error:
${
JSON
.
stringify
(
error
)}
`
)
console
.
log
(
`testHilogJsApi19 got an error:
${
JSON
.
stringify
(
error
)}
`
)
expect
().
assertFail
();
expect
().
assertFail
();
}
}
console
.
info
(
'
testHilogJsApi19 end
'
);
console
.
info
(
'
testHilogJsApi19 end
'
);
})
})
/**
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_2900
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_2900
* @tc.name hi
trace
interface test
* @tc.name hi
log
interface test
* @tc.desc hi
trace
begin interface test.
* @tc.desc hi
log
begin interface test.
*/
*/
it
(
'
testHilogJsApi20
'
,
2
,
function
()
{
it
(
'
testHilogJsApi20
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi20 start
'
);
console
.
info
(
'
testHilogJsApi20 start
'
);
try
{
try
{
hilog
.
debug
(
0x3200
,
"
HILOGTEST
"
,
"
%{public}d
"
,
[
2147483647
]
)
hilog
.
debug
(
0x3200
,
"
HILOGTEST
"
,
"
%{public}d
"
,
2147483647
)
}
catch
(
error
){
}
catch
(
error
){
console
.
log
(
`testHilogJsApi20 got an error:
${
JSON
.
stringify
(
error
)}
`
)
console
.
log
(
`testHilogJsApi20 got an error:
${
JSON
.
stringify
(
error
)}
`
)
expect
().
assertFail
();
expect
().
assertFail
();
}
}
console
.
info
(
'
testHilogJsApi20 end
'
);
console
.
info
(
'
testHilogJsApi20 end
'
);
})
})
/**
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_3000
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_3000
* @tc.name hi
trace
interface test
* @tc.name hi
log
interface test
* @tc.desc hi
trace
begin interface test.
* @tc.desc hi
log
begin interface test.
*/
*/
it
(
'
testHilogJsApi21
'
,
2
,
function
()
{
it
(
'
testHilogJsApi21
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi21 start
'
);
console
.
info
(
'
testHilogJsApi21 start
'
);
try
{
try
{
hilog
.
debug
(
0x3200
,
"
HILOGTEST
"
,
"
%{public}s
"
,
[
"
100%s%d%x%f
"
]
)
hilog
.
debug
(
0x3200
,
"
HILOGTEST
"
,
"
%{public}s
"
,
"
100%s%d%x%f
"
)
}
catch
(
error
){
}
catch
(
error
){
console
.
log
(
`testHilogJsApi21 got an error:
${
JSON
.
stringify
(
error
)}
`
)
console
.
log
(
`testHilogJsApi21 got an error:
${
JSON
.
stringify
(
error
)}
`
)
expect
().
assertFail
();
expect
().
assertFail
();
}
}
console
.
info
(
'
testHilogJsApi21 end
'
);
console
.
info
(
'
testHilogJsApi21 end
'
);
})
})
/**
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_3200
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_3200
* @tc.name hi
trace
interface test
* @tc.name hi
log
interface test
* @tc.desc hi
trace
begin interface test.
* @tc.desc hi
log
begin interface test.
*/
*/
it
(
'
testHilogJsApi22
'
,
2
,
function
()
{
it
(
'
testHilogJsApi22
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi22 start
'
);
console
.
info
(
'
testHilogJsApi22 start
'
);
try
{
try
{
hilog
.
debug
(
0x3200
,
"
HILOGTEST
"
,
"
%{public}s
"
,
[
"
65536
"
]
)
hilog
.
debug
(
0x3200
,
"
HILOGTEST
"
,
"
%{public}s
"
,
"
65536
"
)
}
catch
(
error
){
}
catch
(
error
){
console
.
log
(
`testHilogJsApi22 got an error:
${
JSON
.
stringify
(
error
)}
`
)
console
.
log
(
`testHilogJsApi22 got an error:
${
JSON
.
stringify
(
error
)}
`
)
expect
().
assertFail
();
expect
().
assertFail
();
}
}
console
.
info
(
'
testHilogJsApi22 end
'
);
console
.
info
(
'
testHilogJsApi22 end
'
);
})
})
/**
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_3300
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_3300
* @tc.name hi
trace
interface test
* @tc.name hi
log
interface test
* @tc.desc hi
trace
begin interface test.
* @tc.desc hi
log
begin interface test.
*/
*/
it
(
'
testHilogJsApi23
'
,
2
,
function
()
{
it
(
'
testHilogJsApi23
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi23 start
'
);
console
.
info
(
'
testHilogJsApi23 start
'
);
try
{
try
{
hilog
.
debug
(
0x3200
,
"
HILOGTEST
"
,
"
username:%{public}s, password:%{private}s.
"
,
[
"
username
"
,
"
password
"
]
)
hilog
.
debug
(
0x3200
,
"
HILOGTEST
"
,
"
username:%{public}s, password:%{private}s.
"
,
"
username
"
,
"
password
"
)
hilog
.
debug
(
0x3200
,
"
HILOGTEST
"
,
"
username:%{public}s, password:%s.
"
,
[
"
username123
"
,
"
password
"
]
)
hilog
.
debug
(
0x3200
,
"
HILOGTEST
"
,
"
username:%{public}s, password:%s.
"
,
"
username123
"
,
"
password
"
)
}
catch
(
error
){
}
catch
(
error
){
console
.
log
(
`testHilogJsApi23 got an error:
${
JSON
.
stringify
(
error
)}
`
)
console
.
log
(
`testHilogJsApi23 got an error:
${
JSON
.
stringify
(
error
)}
`
)
expect
().
assertFail
();
expect
().
assertFail
();
}
}
console
.
info
(
'
testHilogJsApi23 end
'
);
console
.
info
(
'
testHilogJsApi23 end
'
);
})
})
/**
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_3400
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_3400
* @tc.name hi
trace
interface test
* @tc.name hi
log
interface test
* @tc.desc hi
trace
begin interface test.
* @tc.desc hi
log
begin interface test.
*/
*/
it
(
'
testHilogJsApi24
'
,
2
,
function
()
{
it
(
'
testHilogJsApi24
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi24 start
'
);
console
.
info
(
'
testHilogJsApi24 start
'
);
try
{
try
{
hilog
.
debug
(
0x3200
,
"
HILOGTEST
"
,
"
%{public}s
"
,
[
"
hilog public
"
]
)
hilog
.
debug
(
0x3200
,
"
HILOGTEST
"
,
"
%{public}s
"
,
"
hilog public
"
)
}
catch
(
error
){
}
catch
(
error
){
console
.
log
(
`testHilogJsApi24 got an error:
${
JSON
.
stringify
(
error
)}
`
)
console
.
log
(
`testHilogJsApi24 got an error:
${
JSON
.
stringify
(
error
)}
`
)
expect
().
assertFail
();
expect
().
assertFail
();
}
}
console
.
info
(
'
testHilogJsApi24 end
'
);
console
.
info
(
'
testHilogJsApi24 end
'
);
})
})
/**
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_3500
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_3500
* @tc.name hi
trace
interface test
* @tc.name hi
log
interface test
* @tc.desc hi
trace
begin interface test.
* @tc.desc hi
log
begin interface test.
*/
*/
it
(
'
testHilogJsApi25
'
,
2
,
function
()
{
it
(
'
testHilogJsApi25
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi25 start
'
);
console
.
info
(
'
testHilogJsApi25 start
'
);
try
{
try
{
hilog
.
debug
(
0x3200
,
"
HILOGTEST
"
,
"
%{nopublic}s
"
,
[
"
Hilogtest
"
]
)
hilog
.
debug
(
0x3200
,
"
HILOGTEST
"
,
"
%{nopublic}s
"
,
"
Hilogtest
"
)
}
catch
(
error
){
}
catch
(
error
){
console
.
log
(
`testHilogJsApi25 got an error:
${
JSON
.
stringify
(
error
)}
`
)
console
.
log
(
`testHilogJsApi25 got an error:
${
JSON
.
stringify
(
error
)}
`
)
expect
().
assertFail
();
expect
().
assertFail
();
}
}
console
.
info
(
'
testHilogJsApi25 end
'
);
console
.
info
(
'
testHilogJsApi25 end
'
);
})
})
/**
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_3800
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_3800
* @tc.name hi
trace
interface test
* @tc.name hi
log
interface test
* @tc.desc hi
trace
begin interface test.
* @tc.desc hi
log
begin interface test.
*/
*/
it
(
'
testHilogJsApi26
'
,
2
,
function
()
{
it
(
'
testHilogJsApi26
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi26 start
'
);
console
.
info
(
'
testHilogJsApi26 start
'
);
try
{
try
{
hilog
.
info
(
0x3200
,
"
HILOGTEST
"
,
"
username:%{public}s, password:%{private}s.
"
,
[
"
username
"
,
"
password
"
]
)
hilog
.
info
(
0x3200
,
"
HILOGTEST
"
,
"
username:%{public}s, password:%{private}s.
"
,
"
username
"
,
"
password
"
)
hilog
.
info
(
0x3200
,
"
HILOGTEST
"
,
"
username:%{public}s, password:%s.
"
,
[
"
username123
"
,
"
password
"
]
)
hilog
.
info
(
0x3200
,
"
HILOGTEST
"
,
"
username:%{public}s, password:%s.
"
,
"
username123
"
,
"
password
"
)
}
catch
(
error
){
}
catch
(
error
){
console
.
log
(
`testHilogJsApi26 got an error:
${
JSON
.
stringify
(
error
)}
`
)
console
.
log
(
`testHilogJsApi26 got an error:
${
JSON
.
stringify
(
error
)}
`
)
expect
().
assertFail
();
expect
().
assertFail
();
}
}
console
.
info
(
'
testHilogJsApi26 end
'
);
console
.
info
(
'
testHilogJsApi26 end
'
);
})
})
/**
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_3900
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_3900
* @tc.name hi
trace
interface test
* @tc.name hi
log
interface test
* @tc.desc hi
trace
begin interface test.
* @tc.desc hi
log
begin interface test.
*/
*/
it
(
'
testHilogJsApi27
'
,
2
,
function
()
{
it
(
'
testHilogJsApi27
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi27 start
'
);
console
.
info
(
'
testHilogJsApi27 start
'
);
try
{
hilog
.
info
(
0xffff
,
"
HILOGTEST
"
,
"
username:%{public}s, password:%{public}s.
"
,
"
username
"
,
"
password
"
)
}
catch
(
error
){
console
.
log
(
`testHilogJsApi27 got an error:
${
JSON
.
stringify
(
error
)}
`
)
expect
().
assertFail
();
}
console
.
info
(
'
testHilogJsApi27 end
'
);
})
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_4000
* @tc.name hilog interface test
* @tc.desc hilog begin interface test.
*/
it
(
'
testHilogJsApi28
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi28 start
'
);
try
{
hilog
.
info
(
0xfffe
,
"
HILOGTEST
"
,
"
username:%{public}s, password:%{public}s.
"
,
"
username
"
,
"
password
"
)
}
catch
(
error
){
console
.
log
(
`testHilogJsApi28 got an error:
${
JSON
.
stringify
(
error
)}
`
)
expect
().
assertFail
();
}
console
.
info
(
'
testHilogJsApi28 end
'
);
})
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_4100
* @tc.name hilog interface test
* @tc.desc hilog begin interface test.
*/
it
(
'
testHilogJsApi29
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi29 start
'
);
try
{
hilog
.
info
(
0xfffff
,
"
HILOGTEST
"
,
"
username:%{public}s, password:%{public}s.
"
,
"
username
"
,
"
password
"
)
}
catch
(
error
){
console
.
log
(
`testHilogJsApi29 got an error:
${
JSON
.
stringify
(
error
)}
`
)
expect
().
assertFail
();
}
console
.
info
(
'
testHilogJsApi29 end
'
);
})
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_4200
* @tc.name hilog interface test
* @tc.desc hilog begin interface test.
*/
it
(
'
testHilogJsApi30
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi30 start
'
);
try
{
hilog
.
info
(
0xffffe
,
"
HILOGTEST
"
,
"
username:%{public}s, password:%{public}s.
"
,
"
username
"
,
"
password
"
)
}
catch
(
error
){
console
.
log
(
`testHilogJsApi30 got an error:
${
JSON
.
stringify
(
error
)}
`
)
expect
().
assertFail
();
}
console
.
info
(
'
testHilogJsApi30 end
'
);
})
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_4300
* @tc.name hilog interface test
* @tc.desc hilog begin interface test.
*/
it
(
'
testHilogJsApi31
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi31 start
'
);
try
{
// @ts-ignore
hilog
.
info
(
"
中文domainId
"
,
"
HILOGTEST
"
,
"
username:%{public}s, password:%{public}s.
"
,
"
username
"
,
"
password
"
)
}
catch
(
error
){
console
.
log
(
`testHilogJsApi31 got an error:
${
JSON
.
stringify
(
error
)}
`
)
expect
().
assertFail
();
}
console
.
info
(
'
testHilogJsApi31 end
'
);
})
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_4400
* @tc.name hilog interface test
* @tc.desc hilog begin interface test.
*/
it
(
'
testHilogJsApi32
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi32 start
'
);
try
{
hilog
.
info
(
100
,
"
HILOGTEST
"
,
"
username:%{public}s, password:%{public}s.
"
,
"
username
"
,
"
password
"
)
}
catch
(
error
){
console
.
log
(
`testHilogJsApi32 got an error:
${
JSON
.
stringify
(
error
)}
`
)
expect
().
assertFail
();
}
console
.
info
(
'
testHilogJsApi32 end
'
);
})
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_4500
* @tc.name hilog interface test
* @tc.desc hilog begin interface test.
*/
it
(
'
testHilogJsApi33
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi33 start
'
);
try
{
hilog
.
info
(
0x3200
,
"
HILOGTEST
"
,
"
username:%{public}s.
"
,
null
)
}
catch
(
error
){
console
.
log
(
`testHilogJsApi33 got an error:
${
JSON
.
stringify
(
error
)}
`
)
expect
().
assertFail
();
}
console
.
info
(
'
testHilogJsApi33 end
'
);
})
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_4600
* @tc.name hilog interface test
* @tc.desc hilog begin interface test.
*/
it
(
'
testHilogJsApi34
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi34 start
'
);
try
{
hilog
.
info
(
0x3200
,
"
HILOGTEST
"
,
"
username:%{public}s.
"
,
undefined
)
}
catch
(
error
){
console
.
log
(
`testHilogJsApi34 got an error:
${
JSON
.
stringify
(
error
)}
`
)
expect
().
assertFail
();
}
console
.
info
(
'
testHilogJsApi34 end
'
);
})
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_4700
* @tc.name hilog interface test
* @tc.desc hilog begin interface test.
*/
it
(
'
testHilogJsApi35
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi35 start
'
);
try
{
hilog
.
info
(
0x3200
,
"
HILOGTEST
"
,
"
MAX Number:%{public}d, MIN Number:%{public}d
"
,
Number
.
MAX_VALUE
,
Number
.
MIN_VALUE
)
}
catch
(
error
){
console
.
log
(
`testHilogJsApi35 got an error:
${
JSON
.
stringify
(
error
)}
`
)
expect
().
assertFail
();
}
console
.
info
(
'
testHilogJsApi35 end
'
);
})
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_4800
* @tc.name hilog interface test
* @tc.desc hilog begin interface test.
*/
it
(
'
testHilogJsApi36
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi36 start
'
);
try
{
hilog
.
info
(
0x3200
,
"
HILOGTEST
"
,
"
中文测试:%{public}s, 混合打印:%{public}s
"
,
"
中文打印测试
"
,
"
for中文test,.;:*_-=^(%)?#$/|
\\
"
)
}
catch
(
error
){
console
.
log
(
`testHilogJsApi36 got an error:
${
JSON
.
stringify
(
error
)}
`
)
expect
().
assertFail
();
}
console
.
info
(
'
testHilogJsApi36 end
'
);
})
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_4900
* @tc.name hilog interface test
* @tc.desc hilog begin interface test.
*/
it
(
'
testHilogJsApi37
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi37 start
'
);
try
{
hilog
.
info
(
0x3200
,
"
HILOGTEST
"
,
"
boolean1:%{public}s, boolean2:%{public}s
"
,
true
,
false
)
}
catch
(
error
){
console
.
log
(
`testHilogJsApi37 got an error:
${
JSON
.
stringify
(
error
)}
`
)
expect
().
assertFail
();
}
console
.
info
(
'
testHilogJsApi37 end
'
);
})
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_5100
* @tc.name hilog interface test
* @tc.desc hilog begin interface test.
*/
it
(
'
testHilogJsApi38
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi38 start
'
);
const
res
=
hilog
.
isLoggable
(
100
,
"
HILOGTEST
"
,
hilog
.
LogLevel
.
INFO
);
expect
(
res
).
assertEqual
(
true
);
console
.
info
(
'
testHilogJsApi38 end
'
);
})
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_5200
* @tc.name hilog interface test
* @tc.desc hilog begin interface test.
*/
it
(
'
testHilogJsApi39
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi39 start
'
);
const
res
=
hilog
.
isLoggable
(
0xfffff
,
"
HILOGTEST
"
,
hilog
.
LogLevel
.
INFO
);
expect
(
res
).
assertEqual
(
false
);
console
.
info
(
'
testHilogJsApi39 end
'
);
})
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_5400
* @tc.name hilog interface test
* @tc.desc hilog begin interface test.
*/
it
(
'
testHilogJsApi40
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi40 start
'
);
const
res
=
hilog
.
isLoggable
(
0xffff
,
"
HILOGTEST
"
,
hilog
.
LogLevel
.
INFO
);
expect
(
res
).
assertEqual
(
true
);
console
.
info
(
'
testHilogJsApi40 end
'
);
})
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_5500
* @tc.name hilog interface test
* @tc.desc hilog begin interface test.
*/
it
(
'
testHilogJsApi41
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi41 start
'
);
const
res
=
hilog
.
isLoggable
(
0xfffe
,
"
HILOGTEST
"
,
hilog
.
LogLevel
.
INFO
);
expect
(
res
).
assertEqual
(
true
);
console
.
info
(
'
testHilogJsApi41 end
'
);
})
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_5600
* @tc.name hilog interface test
* @tc.desc hilog begin interface test.
*/
it
(
'
testHilogJsApi42
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi42 start
'
);
const
res
=
hilog
.
isLoggable
(
0x123456789
,
"
HILOGTEST
"
,
hilog
.
LogLevel
.
INFO
);
expect
(
res
).
assertEqual
(
false
);
console
.
info
(
'
testHilogJsApi42 end
'
);
})
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_5700
* @tc.name hilog interface test
* @tc.desc hilog begin interface test.
*/
it
(
'
testHilogJsApi43
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi43 start
'
);
// @ts-ignore
const
res
=
hilog
.
isLoggable
(
"
中文测试
"
,
"
HILOGTEST
"
,
hilog
.
LogLevel
.
INFO
);
expect
(
res
).
assertEqual
(
undefined
);
console
.
info
(
'
testHilogJsApi43 end
'
);
})
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_5800
* @tc.name hilog interface test
* @tc.desc hilog begin interface test.
*/
it
(
'
testHilogJsApi44
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi44 start
'
);
const
res
=
hilogndk
.
ohIsLoggableTest
();
const
res
=
hilogndk
.
ohIsLoggableTest
();
expect
(
res
).
assertEqual
(
true
);
expect
(
res
).
assertEqual
(
true
);
console
.
info
(
'
testHilogJsApi
27
end
'
);
console
.
info
(
'
testHilogJsApi
44
end
'
);
})
})
/**
/**
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_
40
00
* @tc.number DFX_DFT_Hiview_Libhilog_Hilog_JS_
59
00
* @tc.name hi
trace
interface test
* @tc.name hi
log
interface test
* @tc.desc hi
trace
begin interface test.
* @tc.desc hi
log
begin interface test.
*/
*/
it
(
'
testHilogJsApi
28
'
,
2
,
function
()
{
it
(
'
testHilogJsApi
45
'
,
2
,
function
()
{
console
.
info
(
'
testHilogJsApi
28
start
'
);
console
.
info
(
'
testHilogJsApi
45
start
'
);
const
res
=
hilogndk
.
ohPrintTest
();
const
res
=
hilogndk
.
ohPrintTest
();
expect
(
res
).
assertEqual
(
true
);
expect
(
res
).
assertEqual
(
true
);
console
.
info
(
'
testHilogJsApi
28
end
'
);
console
.
info
(
'
testHilogJsApi
45
end
'
);
})
})
})
})
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录