Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
417d6fc6
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看板
提交
417d6fc6
编写于
8月 04, 2022
作者:
L
lidanyang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
<lidanyang16@huawei.com>
Signed-off-by:
N
lidanyang
<
lidanyang16@huawei.com
>
上级
8d95ccad
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
16 deletion
+22
-16
sensors/miscdevice_standard/BUILD.gn
sensors/miscdevice_standard/BUILD.gn
+2
-0
sensors/sensor_standard/BUILD.gn
sensors/sensor_standard/BUILD.gn
+2
-0
sensors/sensor_standard/src/main/js/test/SensorGeomagneticTest.test.js
...r_standard/src/main/js/test/SensorGeomagneticTest.test.js
+18
-16
未找到文件。
sensors/miscdevice_standard/BUILD.gn
浏览文件 @
417d6fc6
...
...
@@ -21,6 +21,8 @@ ohos_js_hap_suite("miscdevice_js_test") {
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsmiscdeviceJSApiTest"
subsystem_name = "sensors"
part_name = "miscdevice"
}
ohos_js_assets("miscdevice_js_assets") {
js2abc = true
...
...
sensors/sensor_standard/BUILD.gn
浏览文件 @
417d6fc6
...
...
@@ -21,6 +21,8 @@ ohos_js_hap_suite("sensor_js_test") {
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsSensorJSApiTest"
subsystem_name = "sensors"
part_name = "sensor"
}
ohos_js_assets("sensor_js_assets") {
js2abc = true
...
...
sensors/sensor_standard/src/main/js/test/SensorGeomagneticTest.test.js
浏览文件 @
417d6fc6
...
...
@@ -175,7 +175,8 @@ describe("SensorJsTest_sensor_2", function () {
it
(
'
SensorGeomagenticAlgorithmJSTest003
'
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
"
------------------SensorGeomagenticAlgorithmJSTest003-------------------------
"
);
let
geomagneticComponent
=
[
-
1417119616
,
23146989568
,
-
6406359552
,
-
15.442885398864746
,
93.50342559814453
,
23190329344
,
24058943488
]
93.50342559814453
,
23190329344
,
24058943488
,
27779.234375
,
-
6214.9794921875
,
-
14924.6611328125
,
-
27.667943954467773
,
-
12.610970497131348
,
28465.9765625
,
32141.2109375
]
sensor
.
getGeomagneticField
({
'
latitude
'
:
0
,
'
longitude
'
:
0
,
'
altitude
'
:
0
},
Number
.
MAX_VALUE
,
(
error
,
data
)
=>
{
if
(
error
)
{
...
...
@@ -186,13 +187,13 @@ describe("SensorJsTest_sensor_2", function () {
+
'
,geomagneticDip:
'
+
data
.
geomagneticDip
+
'
,deflectionAngle:
'
+
data
.
deflectionAngle
+
'
,levelIntensity:
'
+
data
.
levelIntensity
+
'
,totalIntensity:
'
+
data
.
totalIntensity
)
expect
(
data
.
x
).
assertEqual
(
geomagneticComponent
[
0
]
)
expect
(
data
.
y
).
assertEqual
(
geomagneticComponent
[
1
]
)
expect
(
data
.
z
).
assertEqual
(
geomagneticComponent
[
2
]
)
expect
(
data
.
geomagneticDip
).
assertEqual
(
geomagneticComponent
[
3
]
)
expect
(
data
.
deflectionAngle
).
assertEqual
(
geomagneticComponent
[
4
]
)
expect
(
data
.
levelIntensity
).
assertEqual
(
geomagneticComponent
[
5
]
)
expect
(
data
.
totalIntensity
).
assertEqual
(
geomagneticComponent
[
6
]
)
expect
(
geomagneticComponent
).
assertContain
(
data
.
x
)
expect
(
geomagneticComponent
).
assertContain
(
data
.
y
)
expect
(
geomagneticComponent
).
assertContain
(
data
.
z
)
expect
(
geomagneticComponent
).
assertContain
(
data
.
geomagneticDip
)
expect
(
geomagneticComponent
).
assertContain
(
data
.
deflectionAngle
)
expect
(
geomagneticComponent
).
assertContain
(
data
.
levelIntensity
)
expect
(
geomagneticComponent
).
assertContain
(
data
.
totalIntensity
)
}
setTimeout
(()
=>
{
done
()
...
...
@@ -842,20 +843,21 @@ describe("SensorJsTest_sensor_2", function () {
it
(
"
SensorGeomagenticAlgorithmJSTest027
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
------------------SensorGeomagenticAlgorithmJSTest027------------------
'
);
let
geomagneticComponent
=
[
-
1417119616
,
23146989568
,
-
6406359552
,
-
15.442885398864746
,
93.50342559814453
,
23190329344
,
24058943488
]
93.50342559814453
,
23190329344
,
24058943488
,
27779.234375
,
-
6214.9794921875
,
-
14924.6611328125
,
-
27.667943954467773
,
-
12.610970497131348
,
28465.9765625
,
32141.2109375
]
await
sensor
.
getGeomagneticField
({
'
latitude
'
:
0
,
'
longitude
'
:
0
,
'
altitude
'
:
0
},
Number
.
MAX_VALUE
).
then
((
data
)
=>
{
console
.
info
(
'
SensorGeomagenticAlgorithmJSTest027 x:
'
+
data
.
x
+
'
,y:
'
+
data
.
y
+
'
,z:
'
+
data
.
z
+
'
,geomagneticDip:
'
+
data
.
geomagneticDip
+
'
,deflectionAngle:
'
+
data
.
deflectionAngle
+
'
,levelIntensity:
'
+
data
.
levelIntensity
+
'
,totalIntensity:
'
+
data
.
totalIntensity
)
expect
(
data
.
x
).
assertEqual
(
geomagneticComponent
[
0
]
)
expect
(
data
.
y
).
assertEqual
(
geomagneticComponent
[
1
]
)
expect
(
data
.
z
).
assertEqual
(
geomagneticComponent
[
2
]
)
expect
(
data
.
geomagneticDip
).
assertEqual
(
geomagneticComponent
[
3
]
)
expect
(
data
.
deflectionAngle
).
assertEqual
(
geomagneticComponent
[
4
]
)
expect
(
data
.
levelIntensity
).
assertEqual
(
geomagneticComponent
[
5
]
)
expect
(
data
.
totalIntensity
).
assertEqual
(
geomagneticComponent
[
6
]
)
expect
(
geomagneticComponent
).
assertContain
(
data
.
x
)
expect
(
geomagneticComponent
).
assertContain
(
data
.
y
)
expect
(
geomagneticComponent
).
assertContain
(
data
.
z
)
expect
(
geomagneticComponent
).
assertContain
(
data
.
geomagneticDip
)
expect
(
geomagneticComponent
).
assertContain
(
data
.
deflectionAngle
)
expect
(
geomagneticComponent
).
assertContain
(
data
.
levelIntensity
)
expect
(
geomagneticComponent
).
assertContain
(
data
.
totalIntensity
)
}).
catch
((
error
)
=>
{
console
.
info
(
"
promise::catch
"
,
error
)
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录