提交 170075dd 编写于 作者: H hui1975

update

Signed-off-by: Nhui1975 <zhaominghui10@huawei.com>
Change-Id: I81ac3e259da6dfb695618d54366ebcedf19200bd
上级 e4ed451a
...@@ -298,14 +298,12 @@ describe("SensorJsTest_sensor_39", function () { ...@@ -298,14 +298,12 @@ describe("SensorJsTest_sensor_39", function () {
* @tc.desc:Verification results of the incorrect parameters of the test interface * @tc.desc:Verification results of the incorrect parameters of the test interface
*/ */
it("newAccelerometer_SensorJsTest025", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, function (done) { it("newAccelerometer_SensorJsTest025", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, function (done) {
try { console.info('---------newAccelerometer_SensorJsTest025--------------');
sensor.on(sensor.SensorId.ACCELEROMETER, callback);
setTimeout(()=>{
sensor.off(sensor.SensorId.ACCELEROMETER, 5); sensor.off(sensor.SensorId.ACCELEROMETER, 5);
} catch (error) {
console.info('newAccelerometer_SensorJsTest025 error:'+error);
expect(error.code).assertEqual(PARAMETER_ERROR_CODE)
expect(error.message).assertEqual(PARAMETER_ERROR_MSG)
done(); done();
} }, 1000);
}) })
/* /*
......
...@@ -370,13 +370,25 @@ describe("SensorJsTest_sensor_41", function () { ...@@ -370,13 +370,25 @@ describe("SensorJsTest_sensor_41", function () {
* @tc.name: newAmbient_Light_SensorJsTest025 * @tc.name: newAmbient_Light_SensorJsTest025
* @tc.desc:Verification results of the incorrect parameters of the test interface * @tc.desc:Verification results of the incorrect parameters of the test interface
*/ */
it("newAmbient_Light_SensorJsTest025", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, function (done) { it("newAmbient_Light_SensorJsTest025", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) {
try { console.info('---------newAmbient_Light_SensorJsTest025--------------');
sensor.off(sensor.SensorId.AMBIENT_LIGHT, 5); try{
} catch (error) { sensor.getSingleSensor(sensor.SensorId.AMBIENT_LIGHT,(error, data) => {
if (error) {
console.info('newAmbient_Light_SensorJsTest025 error');
} else {
expect(typeof(data)).assertEqual("object");
sensor.on(sensor.SensorId.AMBIENT_LIGHT, callback);
setTimeout(()=>{
sensor.off(sensor.SensorId.AMBIENT_LIGHT, 5);
done();
}, 500);
}
})
} catch (error) {
console.info('newAmbient_Light_SensorJsTest025 Device does not support! '); console.info('newAmbient_Light_SensorJsTest025 Device does not support! ');
expect(error.code).assertEqual(PARAMETER_ERROR_CODE) expect(error.code).assertEqual(PARAMETER_ERROR_CODE);
expect(error.message).assertEqual(PARAMETER_ERROR_MSG) expect(error.message).assertEqual(PARAMETER_ERROR_MSG);
done(); done();
} }
}) })
......
...@@ -371,13 +371,25 @@ describe("SensorJsTest_sensor_53", function () { ...@@ -371,13 +371,25 @@ describe("SensorJsTest_sensor_53", function () {
* @tc.name: newBarometer_SensorJsTest025 * @tc.name: newBarometer_SensorJsTest025
* @tc.desc:Verification results of the incorrect parameters of the test interface * @tc.desc:Verification results of the incorrect parameters of the test interface
*/ */
it("newBarometer_SensorJsTest025", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, function (done) { it("newBarometer_SensorJsTest025", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) {
try { console.info('---------newBarometer_SensorJsTest025--------------');
sensor.off(sensor.SensorId.BAROMETER, 5); try{
} catch (error) { sensor.getSingleSensor(sensor.SensorId.BAROMETER,(error, data) => {
if (error) {
console.info('newBarometer_SensorJsTest025 error');
} else {
expect(typeof(data)).assertEqual("object");
sensor.on(sensor.SensorId.BAROMETER, callback);
setTimeout(()=>{
sensor.off(sensor.SensorId.BAROMETER, 5);
done();
}, 500);
}
})
} catch (error) {
console.info('newBarometer_SensorJsTest025 Device does not support! '); console.info('newBarometer_SensorJsTest025 Device does not support! ');
expect(error.code).assertEqual(PARAMETER_ERROR_CODE) expect(error.code).assertEqual(PARAMETER_ERROR_CODE);
expect(error.message).assertEqual(PARAMETER_ERROR_MSG) expect(error.message).assertEqual(PARAMETER_ERROR_MSG);
done(); done();
} }
}) })
......
...@@ -100,33 +100,41 @@ describe("SensorJsTest_sensor_35", function () { ...@@ -100,33 +100,41 @@ describe("SensorJsTest_sensor_35", function () {
* @tc.name: getSensorLists_SensorJsTest003 * @tc.name: getSensorLists_SensorJsTest003
* @tc.desc: Verification results of the incorrect parameters of the test interface. * @tc.desc: Verification results of the incorrect parameters of the test interface.
*/ */
it("getSensorLists_SensorJsTest003", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { it("getSensorLists_SensorJsTest003", 0, async function (done) {
console.info("---------------------------getSensorLists_SensorJsTest003----------------------------------"); console.info("---------------------------getSensorLists_SensorJsTest003----------------------------------");
try { sensor.getSensorList(null).then(data => {
sensor.getSensorList(null) console.info("---------------------------getSensorLists_SensorJsTest003 callback in-----------" + data.length);
} catch (error) { for (let i = 0; i < data.length; i++) {
console.info('getSensorLists_SensorJsTest003 error:' + error); console.info("getSensorLists_SensorJsTest003 " + JSON.stringify(data[i]));
expect(error.code).assertEqual(PARAMETER_ERROR_CODE); }
expect(error.message).assertEqual(PARAMETER_ERROR_MSG); expect(true).assertTrue();
done(); done();
} }, (error) => {
}) console.info('getSensorLists_SensorJsTest003 failed');
expect(false).assertTrue();
done();
});
})
/** /**
* @tc.number:SUB_SensorsSystem_GetSensorLists_JSTest_0040 * @tc.number:SUB_SensorsSystem_GetSensorLists_JSTest_0040
* @tc.name: getSensorLists_SensorJsTest004 * @tc.name: getSensorLists_SensorJsTest004
* @tc.desc: Verification results of the incorrect parameters of the test interface. * @tc.desc: Verification results of the incorrect parameters of the test interface.
*/ */
it('getSensorLists_SensorJsTest004', TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { it("getSensorLists_SensorJsTest004", 0, async function (done) {
console.info("------------------getSensorLists_SensorJsTest004-------------------------"); console.info("---------------------------getSensorLists_SensorJsTest004----------------------------------");
try { sensor.getSensorList(errMessage).then(data => {
sensor.getSensorList(errMessage) console.info("---------------------------getSensorLists_SensorJsTest004 callback in-----------" + data.length);
} catch (error) { for (let i = 0; i < data.length; i++) {
console.info('getSensorLists_SensorJsTest004 error:' + error); console.info("getSensorLists_SensorJsTest004 " + JSON.stringify(data[i]));
expect(error.code).assertEqual(PARAMETER_ERROR_CODE); }
expect(error.message).assertEqual(PARAMETER_ERROR_MSG); expect(true).assertTrue();
done(); done();
} }, (error) => {
console.info('getSensorLists_SensorJsTest004 failed');
expect(false).assertTrue();
done();
});
}) })
/** /**
...@@ -134,16 +142,20 @@ describe("SensorJsTest_sensor_35", function () { ...@@ -134,16 +142,20 @@ describe("SensorJsTest_sensor_35", function () {
* @tc.name: getSensorLists_SensorJsTest005 * @tc.name: getSensorLists_SensorJsTest005
* @tc.desc: Verification results of the incorrect parameters of the test interface. * @tc.desc: Verification results of the incorrect parameters of the test interface.
*/ */
it('getSensorLists_SensorJsTest005', TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { it("getSensorLists_SensorJsTest005", 0, async function (done) {
console.info("------------------getSensorLists_SensorJsTest005-------------------------"); console.info("---------------------------getSensorLists_SensorJsTest005----------------------------------");
try { sensor.getSensorList('xxx').then(data => {
sensor.getSensorList('xxx') console.info("---------------------------getSensorLists_SensorJsTest005 callback in-----------" + data.length);
} catch (error) { for (let i = 0; i < data.length; i++) {
console.info('getSensorLists_SensorJsTest005 error:' + error); console.info("getSensorLists_SensorJsTest005 " + JSON.stringify(data[i]));
expect(error.code).assertEqual(PARAMETER_ERROR_CODE); }
expect(error.message).assertEqual(PARAMETER_ERROR_MSG); expect(true).assertTrue();
done(); done();
} }, (error) => {
console.info('getSensorLists_SensorJsTest005 failed');
expect(false).assertTrue();
done();
});
}) })
/** /**
...@@ -151,16 +163,20 @@ describe("SensorJsTest_sensor_35", function () { ...@@ -151,16 +163,20 @@ describe("SensorJsTest_sensor_35", function () {
* @tc.name: getSensorLists_SensorJsTest006 * @tc.name: getSensorLists_SensorJsTest006
* @tc.desc: Verification results of the incorrect parameters of the test interface. * @tc.desc: Verification results of the incorrect parameters of the test interface.
*/ */
it("getSensorLists_SensorJsTest006", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { it("getSensorLists_SensorJsTest006", 0, async function (done) {
console.info("---------------------------getSensorLists_SensorJsTest006----------------------------------"); console.info("---------------------------getSensorLists_SensorJsTest006----------------------------------");
try { sensor.getSensorList(invild).then(data => {
sensor.getSensorList(invild); console.info("---------------------------getSensorLists_SensorJsTest006 callback in-----------" + data.length);
} catch(error) { for (let i = 0; i < data.length; i++) {
console.info("getSensorLists_SensorJsTest006 error:" +error); console.info("getSensorLists_SensorJsTest006 " + JSON.stringify(data[i]));
expect(error.code).assertEqual(PARAMETER_ERROR_CODE); }
expect(error.message).assertEqual(PARAMETER_ERROR_MSG); expect(true).assertTrue();
done(); done();
} }, (error) => {
console.info('getSensorLists_SensorJsTest006 failed');
expect(false).assertTrue();
done();
});
}) })
/** /**
......
...@@ -405,13 +405,20 @@ describe("SensorJsTest_sensor_42", function () { ...@@ -405,13 +405,20 @@ describe("SensorJsTest_sensor_42", function () {
* @tc.name: newGravity_SensorJsTest025 * @tc.name: newGravity_SensorJsTest025
* @tc.desc:Verification results of the incorrect parameters of the test interface * @tc.desc:Verification results of the incorrect parameters of the test interface
*/ */
it("newGravity_SensorJsTest025", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, function (done) { it("newGravity_SensorJsTest025", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) {
try { console.info('---------newGravity_SensorJsTest025--------------');
sensor.off(sensor.SensorId.GRAVITY, 5); try{
} catch (error) { sensor.getSingleSensor(sensor.SensorId.GRAVITY,(error, data) => {
sensor.on(sensor.SensorId.GRAVITY, callback);
setTimeout(()=>{
sensor.off(sensor.SensorId.GRAVITY, 5);
done();
}, 500);
})
} catch (error) {
console.info('newGravity_SensorJsTest025 Device does not support! '); console.info('newGravity_SensorJsTest025 Device does not support! ');
expect(error.code).assertEqual(PARAMETER_ERROR_CODE) expect(error.code).assertEqual(PARAMETER_ERROR_CODE);
expect(error.message).assertEqual(PARAMETER_ERROR_MSG) expect(error.message).assertEqual(PARAMETER_ERROR_MSG);
done(); done();
} }
}) })
......
...@@ -382,13 +382,25 @@ describe("SensorJsTest_sensor_43", function () { ...@@ -382,13 +382,25 @@ describe("SensorJsTest_sensor_43", function () {
* @tc.name: newGyroScope_SensorJsTest025 * @tc.name: newGyroScope_SensorJsTest025
* @tc.desc:Verification results of the incorrect parameters of the test interface * @tc.desc:Verification results of the incorrect parameters of the test interface
*/ */
it("newGyroScope_SensorJsTest025", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, function (done) { it("newGyroScope_SensorJsTest025", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) {
try { console.info('---------newGyroScope_SensorJsTest025--------------');
sensor.off(sensor.SensorId.GYROSCOPE, 5); try{
} catch (error) { sensor.getSingleSensor(sensor.SensorId.GYROSCOPE,(error, data) => {
if (error) {
console.info('newGyroScope_SensorJsTest025 error');
} else {
expect(typeof(data)).assertEqual("object");
sensor.on(sensor.SensorId.GYROSCOPE, callback);
setTimeout(()=>{
sensor.off(sensor.SensorId.GYROSCOPE, 5);
done();
}, 500);
}
})
} catch (error) {
console.info('newGyroScope_SensorJsTest025 Device does not support! '); console.info('newGyroScope_SensorJsTest025 Device does not support! ');
expect(error.code).assertEqual(PARAMETER_ERROR_CODE) expect(error.code).assertEqual(PARAMETER_ERROR_CODE);
expect(error.message).assertEqual(PARAMETER_ERROR_MSG) expect(error.message).assertEqual(PARAMETER_ERROR_MSG);
done(); done();
} }
}) })
......
...@@ -370,13 +370,25 @@ describe("SensorJsTest_sensor_45", function () { ...@@ -370,13 +370,25 @@ describe("SensorJsTest_sensor_45", function () {
* @tc.name: newHall_SensorJsTest025 * @tc.name: newHall_SensorJsTest025
* @tc.desc:Verification results of the incorrect parameters of the test interface * @tc.desc:Verification results of the incorrect parameters of the test interface
*/ */
it("newHall_SensorJsTest025", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, function (done) { it("newHall_SensorJsTest025", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) {
try { console.info('---------newHall_SensorJsTest025--------------');
sensor.off(sensor.SensorId.HALL, 5); try{
} catch (error) { sensor.getSingleSensor(sensor.SensorId.HALL,(error, data) => {
if (error) {
console.info('newHall_SensorJsTest025 error');
} else {
expect(typeof(data)).assertEqual("object");
sensor.on(sensor.SensorId.HALL, callback);
setTimeout(()=>{
sensor.off(sensor.SensorId.HALL, 5);
done();
}, 500);
}
})
} catch (error) {
console.info('newHall_SensorJsTest025 Device does not support! '); console.info('newHall_SensorJsTest025 Device does not support! ');
expect(error.code).assertEqual(PARAMETER_ERROR_CODE) expect(error.code).assertEqual(PARAMETER_ERROR_CODE);
expect(error.message).assertEqual(PARAMETER_ERROR_MSG) expect(error.message).assertEqual(PARAMETER_ERROR_MSG);
done(); done();
} }
}) })
......
...@@ -405,13 +405,20 @@ describe("SensorJsTest_sensor_37", function () { ...@@ -405,13 +405,20 @@ describe("SensorJsTest_sensor_37", function () {
* @tc.name: newMagneticField_SensorJsTest025 * @tc.name: newMagneticField_SensorJsTest025
* @tc.desc:Verification results of the incorrect parameters of the test interface * @tc.desc:Verification results of the incorrect parameters of the test interface
*/ */
it("newMagneticField_SensorJsTest025", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, function (done) { it("newMagneticField_SensorJsTest025", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) {
try { console.info('---------newMagneticField_SensorJsTest025--------------');
sensor.off(sensor.SensorId.MAGNETIC_FIELD, 5); try{
} catch (error) { sensor.getSingleSensor(sensor.SensorId.MAGNETIC_FIELD,(error, data) => {
sensor.on(sensor.SensorId.MAGNETIC_FIELD, callback);
setTimeout(()=>{
sensor.off(sensor.SensorId.MAGNETIC_FIELD, 5);
done();
}, 500);
})
} catch (error) {
console.info('newMagneticField_SensorJsTest025 Device does not support! '); console.info('newMagneticField_SensorJsTest025 Device does not support! ');
expect(error.code).assertEqual(PARAMETER_ERROR_CODE) expect(error.code).assertEqual(PARAMETER_ERROR_CODE);
expect(error.message).assertEqual(PARAMETER_ERROR_MSG) expect(error.message).assertEqual(PARAMETER_ERROR_MSG);
done(); done();
} }
}) })
......
...@@ -382,13 +382,25 @@ describe("SensorJsTest_sensor_48", function () { ...@@ -382,13 +382,25 @@ describe("SensorJsTest_sensor_48", function () {
* @tc.name: newOrientating_SensorJsTest025 * @tc.name: newOrientating_SensorJsTest025
* @tc.desc:Verification results of the incorrect parameters of the test interface * @tc.desc:Verification results of the incorrect parameters of the test interface
*/ */
it("newOrientating_SensorJsTest025", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, function (done) { it("newOrientating_SensorJsTest025", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) {
try { console.info('---------newOrientating_SensorJsTest025--------------');
sensor.off(sensor.SensorId.ORIENTATION, 5); try{
} catch (error) { sensor.getSingleSensor(sensor.SensorId.ORIENTATION,(error, data) => {
if (error) {
console.info('newOrientating_SensorJsTest025 error');
} else {
expect(typeof(data)).assertEqual("object");
sensor.on(sensor.SensorId.ORIENTATION, callback);
setTimeout(()=>{
sensor.off(sensor.SensorId.ORIENTATION, 5);
done();
}, 500);
}
})
} catch (error) {
console.info('newOrientating_SensorJsTest025 Device does not support! '); console.info('newOrientating_SensorJsTest025 Device does not support! ');
expect(error.code).assertEqual(PARAMETER_ERROR_CODE) expect(error.code).assertEqual(PARAMETER_ERROR_CODE);
expect(error.message).assertEqual(PARAMETER_ERROR_MSG) expect(error.message).assertEqual(PARAMETER_ERROR_MSG);
done(); done();
} }
}) })
......
...@@ -387,13 +387,25 @@ describe("SensorJsTest_sensor_49", function () { ...@@ -387,13 +387,25 @@ describe("SensorJsTest_sensor_49", function () {
* @tc.name: newRotatingVector_SensorJsTest025 * @tc.name: newRotatingVector_SensorJsTest025
* @tc.desc:Verification results of the incorrect parameters of the test interface * @tc.desc:Verification results of the incorrect parameters of the test interface
*/ */
it("newRotatingVector_SensorJsTest025", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, function (done) { it("newRotatingVector_SensorJsTest025", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) {
try { console.info('---------newRotatingVector_SensorJsTest025--------------');
sensor.off(sensor.SensorId.ROTATION_VECTOR, 5); try{
} catch (error) { sensor.getSingleSensor(sensor.SensorId.ROTATION_VECTOR,(error, data) => {
if (error) {
console.info('newRotatingVector_SensorJsTest025 error');
} else {
expect(typeof(data)).assertEqual("object");
sensor.on(sensor.SensorId.ROTATION_VECTOR, callback);
setTimeout(()=>{
sensor.off(sensor.SensorId.ROTATION_VECTOR, 5);
done();
}, 500);
}
})
} catch (error) {
console.info('newRotatingVector_SensorJsTest025 Device does not support! '); console.info('newRotatingVector_SensorJsTest025 Device does not support! ');
expect(error.code).assertEqual(PARAMETER_ERROR_CODE) expect(error.code).assertEqual(PARAMETER_ERROR_CODE);
expect(error.message).assertEqual(PARAMETER_ERROR_MSG) expect(error.message).assertEqual(PARAMETER_ERROR_MSG);
done(); done();
} }
}) })
......
...@@ -1394,6 +1394,12 @@ describe("SensorJsTest_sensor_60", function () { ...@@ -1394,6 +1394,12 @@ describe("SensorJsTest_sensor_60", function () {
[30, 25, 41], [3, 2, 4], [-123, -456, -564], [3.40282e+38, 3.40282e+38, 3.40282e+38], [NaN, NaN, NaN] [30, 25, 41], [3, 2, 4], [-123, -456, -564], [3.40282e+38, 3.40282e+38, 3.40282e+38], [NaN, NaN, NaN]
] ]
let createRotationMatrixResult = [
[0.6724675297737122,-0.10471208393573761,0.7326819896697998,0.06531608104705811,0.9944750070571899,
0.08217836916446686,-0.7372390031814575,-0.007406365126371384,0.6755914688110352],
[1,0,0,0,1,0,0,0,1]
]
/* /*
* @tc.name:Sensor_CreateRotationMatrix_001 * @tc.name:Sensor_CreateRotationMatrix_001
* @tc.desc:Verification results of the incorrect parameters of the test interface. * @tc.desc:Verification results of the incorrect parameters of the test interface.
...@@ -1522,15 +1528,17 @@ describe("SensorJsTest_sensor_60", function () { ...@@ -1522,15 +1528,17 @@ describe("SensorJsTest_sensor_60", function () {
* @tc.desc:Verification results of the incorrect parameters of the test interface. * @tc.desc:Verification results of the incorrect parameters of the test interface.
* @tc.number:SUB_SensorsSystem_GeomagneticAlgorithm_JSTest_1160 * @tc.number:SUB_SensorsSystem_GeomagneticAlgorithm_JSTest_1160
*/ */
it('Sensor_CreateRotationMatrix_008', 0, async function (done) { it('Sensor_CreateRotationMatrix_008', 0, async function (done) {
try { sensor.getRotationMatrix([-0.0245, 0.402, 0.0465], -1).then((data) => {
sensor.getRotationMatrix(gravity[2], -1) for(let i = 0; i < data.length; i++) {
} catch (err) { console.info("Sensor_CreateRotationMatrix_008 [" + i + "] : " + data[i]);
console.info("Sensor_CreateRotationMatrix_008 catch error " + err); expect(data[i]).assertEqual(createRotationMatrixResult[0][i])
expect(err.code).assertEqual(PARAMETER_ERROR_CODE) }
expect(err.message).assertEqual(PARAMETER_ERROR_MSG)
done() done()
} }, (error) => {
expect(false).assertTrue();
done()
})
}) })
/* /*
...@@ -1582,28 +1590,18 @@ describe("SensorJsTest_sensor_60", function () { ...@@ -1582,28 +1590,18 @@ describe("SensorJsTest_sensor_60", function () {
* @tc.desc:Verification results of the incorrect parameters of the test interface. * @tc.desc:Verification results of the incorrect parameters of the test interface.
* @tc.number:SUB_SensorsSystem_GeomagneticAlgorithm_JSTest_1190 * @tc.number:SUB_SensorsSystem_GeomagneticAlgorithm_JSTest_1190
*/ */
it('Sensor_CreateRotationMatrix_011', 0, async function (done) { it('Sensor_CreateRotationMatrix_011', 0, async function (done) {
try { sensor.getRotationMatrix([-0.0245, 0.402, 0.0465], -1).then((data) => {
sensor.getRotationMatrix(gravity[2], -1).then((data) => { for(let i = 0; i < data.length; i++) {
expect(true).assertfalse() console.info("Sensor_CreateRotationMatrix_011 [" + i + "] : " + data[i]);
done() expect(data[i]).assertEqual(createRotationMatrixResult[0][i])
}, (error) =>{ }
expect(true).assertfalse()
done()
})
} catch (err) {
console.info("Sensor_CreateRotationMatrix_011 catch error " + err);
expect(err.code).assertEqual(PARAMETER_ERROR_CODE)
expect(err.message).assertEqual(PARAMETER_ERROR_MSG)
done() done()
} }, (error) => {
expect(false).assertTrue();
done()
})
}) })
let createRotationMatrixResult = [
[0.6724675297737122,-0.10471208393573761,0.7326819896697998,0.06531608104705811,0.9944750070571899,
0.08217836916446686,-0.7372390031814575,-0.007406365126371384,0.6755914688110352],
[1,0,0,0,1,0,0,0,1]
]
/* /*
* @tc.name:Sensor_CreateRotationMatrix_012 * @tc.name:Sensor_CreateRotationMatrix_012
...@@ -2518,17 +2516,21 @@ describe("SensorJsTest_sensor_60", function () { ...@@ -2518,17 +2516,21 @@ describe("SensorJsTest_sensor_60", function () {
* @tc.desc:Verification results of the incorrect parameters of the test interface. * @tc.desc:Verification results of the incorrect parameters of the test interface.
* @tc.number:SUB_SensorsSystem_GeomagneticAlgorithm_JSTest_1620 * @tc.number:SUB_SensorsSystem_GeomagneticAlgorithm_JSTest_1620
*/ */
it('Sensor_CreateQuaterniont_013', 0, async function (done) { it('Sensor_CreateQuaterniont_013', 0, async function (done) {
try { sensor.createQuaternion([0.52, -0.336, -0.251], -1).then((data) => {
sensor.createQuaternion([0.52, -0.336, -0.251], -1) console.info('Sensor_CreateQuaterniont_013');
} catch (error) { for (let i = 0; i < data.length; i++) {
console.info("Sensor_CreateQuaterniont_013 catch error:" + error); console.info("data[" + i + "]: " + data[i]);
expect(error.code).assertEqual(PARAMETER_ERROR_CODE) expect(data[i]).assertEqual(result[0][i])
expect(error.message).assertEqual(PARAMETER_ERROR_MSG) }
done() done()
} }, (error) => {
expect(false).assertTrue();
done()
})
}) })
/* /*
* @tc.name:Sensor_CreateQuaterniont_014 * @tc.name:Sensor_CreateQuaterniont_014
* @tc.desc:Verification results of the incorrect parameters of the test interface. * @tc.desc:Verification results of the incorrect parameters of the test interface.
...@@ -2578,21 +2580,18 @@ describe("SensorJsTest_sensor_60", function () { ...@@ -2578,21 +2580,18 @@ describe("SensorJsTest_sensor_60", function () {
* @tc.desc:Verification results of the incorrect parameters of the test interface. * @tc.desc:Verification results of the incorrect parameters of the test interface.
* @tc.number:SUB_SensorsSystem_GeomagneticAlgorithm_JSTest_1650 * @tc.number:SUB_SensorsSystem_GeomagneticAlgorithm_JSTest_1650
*/ */
it('Sensor_CreateQuaterniont_016', 0, async function (done) { it('Sensor_CreateQuaterniont_016', 0, async function (done) {
try { sensor.createQuaternion([0.52, -0.336, -0.251], -1).then((data) => {
sensor.createQuaternion([0.52, -0.336, -0.251], -1).then((data) => { console.info('Sensor_CreateQuaterniont_016');
expect(true).assertfalse() for (let i = 0; i < data.length; i++) {
done() console.info("data[" + i + "]: " + data[i]);
}, (error) =>{ expect(data[i]).assertEqual(result[0][i])
expect(false).assertfalse() }
done()
})
} catch (error) {
console.info("Sensor_CreateQuaterniont_016 catch error:" + error);
expect(error.code).assertEqual(PARAMETER_ERROR_CODE)
expect(error.message).assertEqual(PARAMETER_ERROR_MSG)
done() done()
} }, (error) => {
expect(false).assertTrue();
done()
})
}) })
var getGeomagneticDipResult = [ 0.8760581016540527, 0.862170, -Infinity, 44330] var getGeomagneticDipResult = [ 0.8760581016540527, 0.862170, -Infinity, 44330]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册