Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
b19968fa
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看板
未验证
提交
b19968fa
编写于
10月 10, 2022
作者:
O
openharmony_ci
提交者:
Gitee
10月 10, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5839 modify case about xts
Merge pull request !5839 from 17349030869/master
上级
f2717f6d
3358b81a
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
86 addition
and
49 deletion
+86
-49
sensors/sensor_standard/src/main/js/test/SensorGeneralalgorithm.test.js
..._standard/src/main/js/test/SensorGeneralalgorithm.test.js
+80
-42
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test.js
.../sensor_standard/src/main/js/test/SensorOnOffTest.test.js
+6
-7
未找到文件。
sensors/sensor_standard/src/main/js/test/SensorGeneralalgorithm.test.js
浏览文件 @
b19968fa
...
@@ -50,6 +50,9 @@ describe("SensorJsTest_sensor_1", function () {
...
@@ -50,6 +50,9 @@ describe("SensorJsTest_sensor_1", function () {
console
.
info
(
'
afterEach caled
'
)
console
.
info
(
'
afterEach caled
'
)
})
})
let
PARAMETER_ERROR_CODE
=
401
let
PARAMETER_ERROR_MSG
=
'
The parameter invalid.
'
let
SENSOR_DATA_MATRIX
=
[
let
SENSOR_DATA_MATRIX
=
[
{
{
"
rotation
"
:
[
-
0.7980074882507324
,
0.5486301183700562
,
0.24937734007835388
,
-
0.17277367413043976
,
"
rotation
"
:
[
-
0.7980074882507324
,
0.5486301183700562
,
0.24937734007835388
,
-
0.17277367413043976
,
...
@@ -282,6 +285,7 @@ describe("SensorJsTest_sensor_1", function () {
...
@@ -282,6 +285,7 @@ describe("SensorJsTest_sensor_1", function () {
* @tc.number:SUB_SensorsSystem_GeneralAlgorithm_JsTest_0100
* @tc.number:SUB_SensorsSystem_GeneralAlgorithm_JsTest_0100
*/
*/
it
(
'
SensorJsTest_077
'
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
it
(
'
SensorJsTest_077
'
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
try
{
sensor
.
getDirection
([
1
,
2
,
3
,
1
,
2
,
3
,
1
,
2
,
3
,
0
]).
then
((
data
)
=>
{
sensor
.
getDirection
([
1
,
2
,
3
,
1
,
2
,
3
,
1
,
2
,
3
,
0
]).
then
((
data
)
=>
{
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
console
.
info
(
"
SensorJsTest_077 failed
"
)
console
.
info
(
"
SensorJsTest_077 failed
"
)
...
@@ -289,10 +293,16 @@ describe("SensorJsTest_sensor_1", function () {
...
@@ -289,10 +293,16 @@ describe("SensorJsTest_sensor_1", function () {
}
}
done
()
done
()
},
(
error
)
=>
{
},
(
error
)
=>
{
expect
(
tru
e
).
assertTrue
();
expect
(
fals
e
).
assertTrue
();
console
.
info
(
"
SensorJsTest_077 success
"
)
console
.
info
(
"
SensorJsTest_077 success
"
)
done
()
done
()
})
})
}
catch
(
err
)
{
console
.
info
(
'
exception
'
+
JSON
.
stringify
(
err
))
expect
(
err
.
code
).
assertEqual
(
PARAMETER_ERROR_CODE
)
expect
(
err
.
message
).
assertEqual
(
PARAMETER_ERROR_MSG
)
done
()
}
})
})
let
ANGLECHANGE_9_RESULT
=
[
let
ANGLECHANGE_9_RESULT
=
[
...
@@ -652,15 +662,22 @@ describe("SensorJsTest_sensor_1", function () {
...
@@ -652,15 +662,22 @@ describe("SensorJsTest_sensor_1", function () {
*/
*/
it
(
'
SensorJsTest_092
'
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
it
(
'
SensorJsTest_092
'
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
SensorJsTest_092 start
'
)
console
.
info
(
'
SensorJsTest_092 start
'
)
try
{
sensor
.
createQuaternion
([
0.25
,
0.14
],
(
error
,
data
)
=>
{
sensor
.
createQuaternion
([
0.25
,
0.14
],
(
error
,
data
)
=>
{
if
(
error
)
{
if
(
error
)
{
console
.
info
(
'
SensorJsTest_092 failed
'
);
console
.
info
(
'
SensorJsTest_092 failed
'
);
expect
(
tru
e
).
assertTrue
();
expect
(
fals
e
).
assertTrue
();
}
else
{
}
else
{
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
}
}
done
()
done
()
})
})
}
catch
(
err
)
{
console
.
info
(
'
exception
'
+
JSON
.
stringify
(
err
))
expect
(
err
.
code
).
assertEqual
(
PARAMETER_ERROR_CODE
)
expect
(
err
.
message
).
assertEqual
(
PARAMETER_ERROR_MSG
)
done
()
}
console
.
info
(
"
SensorJsTest_092 end
"
)
console
.
info
(
"
SensorJsTest_092 end
"
)
})
})
...
@@ -693,15 +710,22 @@ describe("SensorJsTest_sensor_1", function () {
...
@@ -693,15 +710,22 @@ describe("SensorJsTest_sensor_1", function () {
*/
*/
it
(
'
SensorJsTest_094
'
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
it
(
'
SensorJsTest_094
'
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
SensorJsTest_094 start
'
)
console
.
info
(
'
SensorJsTest_094 start
'
)
try
{
sensor
.
createQuaternion
([
0
,
0
]).
then
((
data
)
=>
{
sensor
.
createQuaternion
([
0
,
0
]).
then
((
data
)
=>
{
console
.
info
(
'
SensorJsTest_094
'
);
console
.
info
(
'
SensorJsTest_094
'
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
done
()
done
()
},
(
error
)
=>
{
},
(
error
)
=>
{
expect
(
tru
e
).
assertTrue
();
expect
(
fals
e
).
assertTrue
();
console
.
info
(
'
promise failed
'
)
console
.
info
(
'
promise failed
'
)
done
()
done
()
})
})
}
catch
(
err
)
{
console
.
info
(
'
exception
'
+
JSON
.
stringify
(
err
))
expect
(
err
.
code
).
assertEqual
(
PARAMETER_ERROR_CODE
)
expect
(
err
.
message
).
assertEqual
(
PARAMETER_ERROR_MSG
)
done
()
}
console
.
info
(
"
SensorJsTest_094 end
"
)
console
.
info
(
"
SensorJsTest_094 end
"
)
})
})
...
@@ -755,15 +779,22 @@ describe("SensorJsTest_sensor_1", function () {
...
@@ -755,15 +779,22 @@ describe("SensorJsTest_sensor_1", function () {
*/
*/
it
(
'
SensorJsTest_097
'
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
it
(
'
SensorJsTest_097
'
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
SensorJsTest_097 start
'
)
console
.
info
(
'
SensorJsTest_097 start
'
)
try
{
sensor
.
createQuaternion
([
0.25
,
0.14
]).
then
((
data
)
=>
{
sensor
.
createQuaternion
([
0.25
,
0.14
]).
then
((
data
)
=>
{
console
.
info
(
'
SensorJsTest_097
'
);
console
.
info
(
'
SensorJsTest_097
'
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
done
()
done
()
},
(
error
)
=>
{
},
(
error
)
=>
{
expect
(
tru
e
).
assertTrue
();
expect
(
fals
e
).
assertTrue
();
console
.
info
(
'
promise failed
'
)
console
.
info
(
'
promise failed
'
)
done
()
done
()
})
})
}
catch
(
err
)
{
console
.
info
(
'
exception
'
+
JSON
.
stringify
(
err
))
expect
(
err
.
code
).
assertEqual
(
PARAMETER_ERROR_CODE
)
expect
(
err
.
message
).
assertEqual
(
PARAMETER_ERROR_MSG
)
done
()
}
})
})
let
createRotationMatrixResult
=
[
let
createRotationMatrixResult
=
[
...
@@ -866,6 +897,7 @@ describe("SensorJsTest_sensor_1", function () {
...
@@ -866,6 +897,7 @@ describe("SensorJsTest_sensor_1", function () {
*/
*/
it
(
'
SensorJsTest_102
'
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
it
(
'
SensorJsTest_102
'
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
SensorJsTest_102 start
'
)
console
.
info
(
'
SensorJsTest_102 start
'
)
try
{
sensor
.
getGeomagneticDip
([
1
,
2
,
3
,
4
],
(
error
,
data
)
=>
{
sensor
.
getGeomagneticDip
([
1
,
2
,
3
,
4
],
(
error
,
data
)
=>
{
if
(
error
)
{
if
(
error
)
{
console
.
info
(
'
SensorJsTest_102 success
'
);
console
.
info
(
'
SensorJsTest_102 success
'
);
...
@@ -876,6 +908,12 @@ describe("SensorJsTest_sensor_1", function () {
...
@@ -876,6 +908,12 @@ describe("SensorJsTest_sensor_1", function () {
}
}
done
()
done
()
})
})
}
catch
(
err
)
{
console
.
info
(
'
exception
'
+
JSON
.
stringify
(
err
))
expect
(
err
.
code
).
assertEqual
(
PARAMETER_ERROR_CODE
)
expect
(
err
.
message
).
assertEqual
(
PARAMETER_ERROR_MSG
)
done
()
}
console
.
info
(
"
SensorJsTest_102 end
"
)
console
.
info
(
"
SensorJsTest_102 end
"
)
})
})
...
...
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test.js
浏览文件 @
b19968fa
...
@@ -38,9 +38,8 @@ describe('SystemParameterTest', function () {
...
@@ -38,9 +38,8 @@ describe('SystemParameterTest', function () {
let
testNullSensorId
=
-
1
;
let
testNullSensorId
=
-
1
;
let
errMessages
=
[
'
SubscribeSensor failed
'
];
let
errCode
=
401
let
errMessage
=
'
The parameter invalid.
'
let
errMessage
;
/**
/**
* @tc.number SUB_SENSORS_Sensor_JSTest_0020
* @tc.number SUB_SENSORS_Sensor_JSTest_0020
...
@@ -51,7 +50,7 @@ describe('SystemParameterTest', function () {
...
@@ -51,7 +50,7 @@ describe('SystemParameterTest', function () {
console
.
info
(
'
testRegisterSensortest001 start
'
);
console
.
info
(
'
testRegisterSensortest001 start
'
);
function
onSensorCallback
(
data
)
{
function
onSensorCallback
(
data
)
{
console
.
info
(
'
testRegisterSensortest001
on error
'
);
console
.
info
(
'
testRegisterSensortest001
callback in
'
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
done
();
done
();
}
}
...
@@ -59,9 +58,9 @@ describe('SystemParameterTest', function () {
...
@@ -59,9 +58,9 @@ describe('SystemParameterTest', function () {
try
{
try
{
sensor
.
on
(
testNullSensorId
,
onSensorCallback
);
sensor
.
on
(
testNullSensorId
,
onSensorCallback
);
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
info
(
'
testRegisterSensortest001 error
'
+
error
);
console
.
info
(
'
testRegisterSensortest001 error
:
'
+
error
.
code
+
'
,msg:
'
+
error
.
message
);
e
rrMessage
=
error
.
toString
().
slice
(
12
,
34
);
e
xpect
(
error
.
code
).
assertEqual
(
errCode
)
expect
(
err
Message
).
assertEqual
(
errMessages
[
0
]);
expect
(
err
or
.
message
).
assertEqual
(
errMessage
)
done
();
done
();
}
}
console
.
info
(
'
testRegisterSensortest001 end
'
);
console
.
info
(
'
testRegisterSensortest001 end
'
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录