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 () {
console
.
info
(
'
afterEach caled
'
)
})
let
PARAMETER_ERROR_CODE
=
401
let
PARAMETER_ERROR_MSG
=
'
The parameter invalid.
'
let
SENSOR_DATA_MATRIX
=
[
{
"
rotation
"
:
[
-
0.7980074882507324
,
0.5486301183700562
,
0.24937734007835388
,
-
0.17277367413043976
,
...
...
@@ -282,17 +285,24 @@ describe("SensorJsTest_sensor_1", function () {
* @tc.number:SUB_SensorsSystem_GeneralAlgorithm_JsTest_0100
*/
it
(
'
SensorJsTest_077
'
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
sensor
.
getDirection
([
1
,
2
,
3
,
1
,
2
,
3
,
1
,
2
,
3
,
0
]).
then
((
data
)
=>
{
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
console
.
info
(
"
SensorJsTest_077 failed
"
)
try
{
sensor
.
getDirection
([
1
,
2
,
3
,
1
,
2
,
3
,
1
,
2
,
3
,
0
]).
then
((
data
)
=>
{
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
console
.
info
(
"
SensorJsTest_077 failed
"
)
expect
(
false
).
assertTrue
();
}
done
()
},
(
error
)
=>
{
expect
(
false
).
assertTrue
();
}
done
()
},
(
error
)
=>
{
expect
(
true
).
assertTrue
();
console
.
info
(
"
SensorJsTest_077 success
"
)
console
.
info
(
"
SensorJsTest_077 success
"
)
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
=
[
...
...
@@ -652,15 +662,22 @@ describe("SensorJsTest_sensor_1", function () {
*/
it
(
'
SensorJsTest_092
'
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
SensorJsTest_092 start
'
)
sensor
.
createQuaternion
([
0.25
,
0.14
],
(
error
,
data
)
=>
{
if
(
error
)
{
console
.
info
(
'
SensorJsTest_092 failed
'
);
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
}
try
{
sensor
.
createQuaternion
([
0.25
,
0.14
],
(
error
,
data
)
=>
{
if
(
error
)
{
console
.
info
(
'
SensorJsTest_092 failed
'
);
expect
(
false
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
}
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
"
)
})
...
...
@@ -693,15 +710,22 @@ describe("SensorJsTest_sensor_1", function () {
*/
it
(
'
SensorJsTest_094
'
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
SensorJsTest_094 start
'
)
sensor
.
createQuaternion
([
0
,
0
]).
then
((
data
)
=>
{
console
.
info
(
'
SensorJsTest_094
'
);
expect
(
false
).
assertTrue
();
done
()
},
(
error
)
=>
{
expect
(
true
).
assertTrue
();
console
.
info
(
'
promise failed
'
)
try
{
sensor
.
createQuaternion
([
0
,
0
]).
then
((
data
)
=>
{
console
.
info
(
'
SensorJsTest_094
'
);
expect
(
false
).
assertTrue
();
done
()
},
(
error
)
=>
{
expect
(
false
).
assertTrue
();
console
.
info
(
'
promise failed
'
)
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
"
)
})
...
...
@@ -755,15 +779,22 @@ describe("SensorJsTest_sensor_1", function () {
*/
it
(
'
SensorJsTest_097
'
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
SensorJsTest_097 start
'
)
sensor
.
createQuaternion
([
0.25
,
0.14
]).
then
((
data
)
=>
{
console
.
info
(
'
SensorJsTest_097
'
);
expect
(
false
).
assertTrue
();
done
()
},
(
error
)
=>
{
expect
(
true
).
assertTrue
();
console
.
info
(
'
promise failed
'
)
try
{
sensor
.
createQuaternion
([
0.25
,
0.14
]).
then
((
data
)
=>
{
console
.
info
(
'
SensorJsTest_097
'
);
expect
(
false
).
assertTrue
();
done
()
},
(
error
)
=>
{
expect
(
false
).
assertTrue
();
console
.
info
(
'
promise failed
'
)
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
=
[
...
...
@@ -866,16 +897,23 @@ describe("SensorJsTest_sensor_1", function () {
*/
it
(
'
SensorJsTest_102
'
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
SensorJsTest_102 start
'
)
sensor
.
getGeomagneticDip
([
1
,
2
,
3
,
4
],
(
error
,
data
)
=>
{
if
(
error
)
{
console
.
info
(
'
SensorJsTest_102 success
'
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
"
SensorJsTest_102 failed
"
)
expect
(
false
).
assertTrue
();
}
try
{
sensor
.
getGeomagneticDip
([
1
,
2
,
3
,
4
],
(
error
,
data
)
=>
{
if
(
error
)
{
console
.
info
(
'
SensorJsTest_102 success
'
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
"
SensorJsTest_102 failed
"
)
expect
(
false
).
assertTrue
();
}
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
"
)
})
...
...
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test.js
浏览文件 @
b19968fa
...
...
@@ -37,10 +37,9 @@ describe('SystemParameterTest', function () {
})
let
testNullSensorId
=
-
1
;
let
errMessages
=
[
'
SubscribeSensor failed
'
];
let
errMessage
;
let
errCode
=
401
let
errMessage
=
'
The parameter invalid.
'
/**
* @tc.number SUB_SENSORS_Sensor_JSTest_0020
...
...
@@ -51,7 +50,7 @@ describe('SystemParameterTest', function () {
console
.
info
(
'
testRegisterSensortest001 start
'
);
function
onSensorCallback
(
data
)
{
console
.
info
(
'
testRegisterSensortest001
on error
'
);
console
.
info
(
'
testRegisterSensortest001
callback in
'
);
expect
(
false
).
assertTrue
();
done
();
}
...
...
@@ -59,9 +58,9 @@ describe('SystemParameterTest', function () {
try
{
sensor
.
on
(
testNullSensorId
,
onSensorCallback
);
}
catch
(
error
)
{
console
.
info
(
'
testRegisterSensortest001 error
'
+
error
);
e
rrMessage
=
error
.
toString
().
slice
(
12
,
34
);
expect
(
err
Message
).
assertEqual
(
errMessages
[
0
]);
console
.
info
(
'
testRegisterSensortest001 error
:
'
+
error
.
code
+
'
,msg:
'
+
error
.
message
);
e
xpect
(
error
.
code
).
assertEqual
(
errCode
)
expect
(
err
or
.
message
).
assertEqual
(
errMessage
)
done
();
}
console
.
info
(
'
testRegisterSensortest001 end
'
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录