未验证 提交 bb69adb0 编写于 作者: O openharmony_ci 提交者: Gitee

!9012 【Openharmony4.0.8.1】【master分支】【sensor子系统】【ToC】【RK3568】【必现】新增计步器用例

Merge pull request !9012 from ldy/master
......@@ -21,6 +21,9 @@
"power-shell wakeup",
"uinput -T -m 594 2117 594 864 400",
"power-shell setmode 602"
],
"teardown-command":[
"power-shell setmode 600"
]
}
]
......
......@@ -21,6 +21,9 @@
"power-shell wakeup",
"uinput -T -m 594 2117 594 864 400",
"power-shell setmode 602"
],
"teardown-command":[
"power-shell setmode 600"
]
}
]
......
......@@ -16,6 +16,7 @@ import SystemParameterTest from './SensorOnOffTest.test.js'
import SensorJsTest_sensor_2 from './SensorGeomagneticTest.test.js'
import SensorJsTest_sensor_1 from './SensorGeneralalgorithm.test.js'
import SensorJsTest_sensor_60 from './SensorOnOffTest.test_newSensorGeomagnetic.test.js'
import SensorJsTest_sensor_38 from './SensorOnOffTest.test_newSensorGeomagneticOptions.test.js'
import SensorJsTest_sensor_35 from './SensorOnOffTest.test_newGetSensorList.test.js'
import SensorJsTest_sensor_36 from './SensorOnOffTest.test_newGetSingleSensor.test.js'
import SensorJsTest_sensor_3 from './SensorOnOffTest.test_oldAccelerometer.test.js'
......@@ -43,12 +44,15 @@ import SensorJsTest_sensor_8 from './SensorOnOffTest.test_oldBarometer.test.js'
import SensorJsTest_sensor_26 from './Subscribe_subscribeBarometer.test.js'
import SensorJsTest_sensor_57 from './SensorOnOffTest.test_newPedometer_Detection.test.js'
import SensorJsTest_sensor_17 from './SensorOnOffTest.test_oldPedometer_Detection.test.js'
import SensorJsTest_sensor_56 from './SensorOnOffTest.test_newPedometer.test.js'
import SensorJsTest_sensor_18 from './SensorOnOffTest.test_oldPedometer.test.js'
export default function testsuite() {
SystemParameterTest()
SensorJsTest_sensor_2()
SensorJsTest_sensor_1()
SensorJsTest_sensor_60()
SensorJsTest_sensor_38()
SensorJsTest_sensor_35()
SensorJsTest_sensor_36()
SensorJsTest_sensor_3()
......@@ -76,4 +80,6 @@ export default function testsuite() {
SensorJsTest_sensor_26()
SensorJsTest_sensor_57()
SensorJsTest_sensor_17()
SensorJsTest_sensor_56()
SensorJsTest_sensor_18()
}
......@@ -1096,10 +1096,146 @@ describe("SensorJsTest_sensor_1", function () {
});
})
/*
* @tc.name:SensorJsTest_111
* @tc.desc:Verification results of the incorrect parameters of the test interface.
* @tc.number:SUB_SensorsSystem_GeneralAlgorithm_JsTest_0440
*/
it("SensorJsTest_111", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info('SensorJsTest_111 start')
try {
sensor.getGeomagneticDip().then((data)=>{
console.info("SensorJsTest_111 data:" + data)
expect(false).assertfalse()
done()
}, (error)=>{
console.info("SensorJsTest_111 error:" + error)
expect(error.code).assertEqual(PARAMETER_ERROR_CODE);
expect(error.message).assertEqual(PARAMETER_ERROR_MSG);
done()
})
} catch(error) {
console.info("SensorJsTest_111 catch error:" + error);
expect(error.code).assertEqual(PARAMETER_ERROR_CODE);
expect(error.message).assertEqual(PARAMETER_ERROR_MSG);
done();
}
console.info("SensorJsTest_111 end")
})
})
/*
* @tc.name:SensorJsTest_112
* @tc.desc:Verification results of the incorrect parameters of the test interface.
* @tc.number:SUB_SensorsSystem_GeneralAlgorithm_JsTest_0450
*/
it("SensorJsTest_112", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info('SensorJsTest_112 start')
try {
sensor.getGeomagneticDip(-1).then((data)=>{
console.info("SensorJsTest_112 data:" + data)
expect(false).assertfalse()
done()
}, (error)=>{
console.info("SensorJsTest_112 error:" + error);
expect(error.code).assertEqual(PARAMETER_ERROR_CODE);
expect(error.message).assertEqual(PARAMETER_ERROR_MSG);
done()
})
} catch(error) {
console.info("SensorJsTest_112 catch error:" + error);
expect(error.code).assertEqual(PARAMETER_ERROR_CODE);
expect(error.message).assertEqual(PARAMETER_ERROR_MSG);
done();
}
console.info("SensorJsTest_112 end")
})
/*
* @tc.name:SensorJsTest_113
* @tc.desc:Verification results of the incorrect parameters of the test interface.
* @tc.number:SUB_SensorsSystem_GeneralAlgorithm_JsTest_0460
*/
it("SensorJsTest_113", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info('SensorJsTest_113 start')
try {
sensor.getGeomagneticDip([1, 0, 0, 0, 1, 0, 0, 0, 1]).then((data)=>{
console.info("SensorJsTest_113 data:" + data)
expect(data).assertEqual(0);
done()
}, (error)=>{
console.info("SensorJsTest_113 error:" + error);
expect(error.code).assertEqual(PARAMETER_ERROR_CODE);
expect(error.message).assertEqual(PARAMETER_ERROR_MSG);
done()
})
} catch(error) {
console.info("SensorJsTest_113 catch error:" + error);
expect(error.code).assertEqual(PARAMETER_ERROR_CODE);
expect(error.message).assertEqual(PARAMETER_ERROR_MSG);
done();
}
console.info("SensorJsTest_113 end")
})
/*
* @tc.name:SensorJsTest_114
* @tc.desc:Verification results of the incorrect parameters of the test interface.
* @tc.number:SUB_SensorsSystem_GeneralAlgorithm_JsTest_0470
*/
it("SensorJsTest_114", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info('SensorJsTest_114 start')
let inclinationMatrix = [
1, 0, 0, 1,
0, 1, 0, 0,
0, 0, 1, 0,
1, 0, 0, 0
]
try {
sensor.getGeomagneticDip(inclinationMatrix).then((data)=>{
console.info("SensorJsTest_114 data:" + data)
expect(data).assertEqual(0);
done()
}, (error)=>{
console.info("SensorJsTest_114 error:" + error);
expect(error.code).assertEqual(PARAMETER_ERROR_CODE);
expect(error.message).assertEqual(PARAMETER_ERROR_MSG);
done()
})
} catch(error) {
console.info("SensorJsTest_114 catch error:" + error);
expect(error.code).assertEqual(PARAMETER_ERROR_CODE);
expect(error.message).assertEqual(PARAMETER_ERROR_MSG);
done();
}
console.info("SensorJsTest_114 end")
})
}
/*
* @tc.name:SensorJsTest_115
* @tc.desc:Verification results of the incorrect parameters of the test interface.
* @tc.number:SUB_SensorsSystem_GeneralAlgorithm_JsTest_0460
*/
it("SensorJsTest_115", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info('SensorJsTest_115 start')
try {
sensor.getGeomagneticDip([1, 0, 0, 0, 1, 0, 0, 0, 1], (error, data) => {
if (error) {
console.info("SensorJsTest_115 error:" + error);
expect(error.code).assertEqual(PARAMETER_ERROR_CODE);
expect(error.message).assertEqual(PARAMETER_ERROR_MSG);
done()
} else {
console.info("SensorJsTest_115 data:" + data)
expect(data).assertEqual(0);
done()
}
})
} catch(error) {
console.info("SensorJsTest_115 catch error:" + error);
expect(error.code).assertEqual(PARAMETER_ERROR_CODE);
expect(error.message).assertEqual(PARAMETER_ERROR_MSG);
done();
}
console.info("SensorJsTest_115 end")
})
})}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册