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

!4144 fail case update

Merge pull request !4144 from 高曦/master
......@@ -26,7 +26,7 @@ describe('ActsNetworkSearchTest', function () {
function sleep(timeout) {
return new Promise((resolve, reject) => {
setTimeout(() => {
console.log(`Telephony_NetworkSearch_CellInformation sleep ${timeout}ms`);
console.info(`Telephony_NetworkSearch_CellInformation sleep ${timeout}ms`);
resolve();
}, timeout);
})
......@@ -36,7 +36,7 @@ describe('ActsNetworkSearchTest', function () {
let isOn = await radio.isRadioOn();
if (!isOn) {
await radio.turnOnRadio();
console.log('Telephony_NetworkSearch_CellInformation turnOnRadio success');
console.info('Telephony_NetworkSearch_CellInformation turnOnRadio success');
await sleep(5000);
}
}
......@@ -54,7 +54,6 @@ describe('ActsNetworkSearchTest', function () {
afterEach(async function () {
try {
expect(radio.RADIO_TECHNOLOGY_UNKNOWN === 0).assertTrue();
expect(radio.RADIO_TECHNOLOGY_GSM === 1).assertTrue();
expect(radio.RADIO_TECHNOLOGY_1XRTT === 2).assertTrue();
expect(radio.RADIO_TECHNOLOGY_WCDMA === 3).assertTrue();
expect(radio.RADIO_TECHNOLOGY_HSPA === 4).assertTrue();
......@@ -94,7 +93,7 @@ describe('ActsNetworkSearchTest', function () {
expect(radio.NETWORK_SELECTION_UNKNOWN === 0).assertTrue();
expect(radio.NETWORK_SELECTION_MANUAL === 2).assertTrue();
} catch (error) {
console.log(`Telephony_NetworkSearch error`);
console.info(`Telephony_NetworkSearch error`);
}
});
......@@ -106,11 +105,11 @@ describe('ActsNetworkSearchTest', function () {
it('Telephony_NetworkSearch_getNetworkState_Async_0700', 0, async function (done) {
radio.getNetworkState(SLOT_2, (err, data) => {
if (err) {
console.log(`Telephony_NetworkSearch_getNetworkState_Async_0700 finish err: ${err}`);
console.info(`Telephony_NetworkSearch_getNetworkState_Async_0700 finish err: ${err}`);
done();
return;
}
console.log(`Telephony_NetworkSearch_getNetworkState_Async_0700 fail not go to err ${data}`);
console.info(`Telephony_NetworkSearch_getNetworkState_Async_0700 fail not go to err ${data}`);
expect(data.longOperatorName != 'longOperatorName').assertTrue();
expect(data.shortOperatorName != 'shortOperatorName').assertTrue();
expect(data.plmnNumeric != 'plmnNumeric').assertTrue();
......@@ -118,7 +117,6 @@ describe('ActsNetworkSearchTest', function () {
expect(data.regState != radio.REG_STATE_IN_SERVICE).assertTrue();
expect(data.nsaState != radio.NSA_STATE_SA_ATTACHED).assertTrue();
expect(data.isCaActive != true).assertTrue();
expect(data.isEmergency != true).assertTrue();
expect().assertFail();
done();
});
......@@ -132,11 +130,11 @@ describe('ActsNetworkSearchTest', function () {
it('Telephony_NetworkSearch_getRadioTech_Async_0400', 0, async function (done) {
radio.getRadioTech(SLOT_2, (err, data) => {
if (err) {
console.log(`Telephony_NetworkSearch_getRadioTech_Async_0400 finish err: ${err}`);
console.info(`Telephony_NetworkSearch_getRadioTech_Async_0400 finish err: ${err}`);
done();
return;
}
console.log(`Telephony_NetworkSearch_getRadioTech_Async_0400 fail not go to err ${data}`);
console.info(`Telephony_NetworkSearch_getRadioTech_Async_0400 fail not go to err ${data}`);
expect().assertFail();
done();
});
......@@ -150,12 +148,12 @@ describe('ActsNetworkSearchTest', function () {
it('Telephony_NetworkSearch_getSignalInformation_Async_0400', 0, async function (done) {
radio.getSignalInformation(SLOT_2, (err, data) => {
if (err) {
console.log(`Telephony_NetworkSearch_getSignalInformation_Async_0400 fail err: ${err}`);
expect().assertFail();
console.info(`Telephony_NetworkSearch_getSignalInformation_Async_0400 fail err: ${err}`);
expect(err.code).assertEqual("202");
done();
return;
}
console.log(`Telephony_NetworkSearch_getSignalInformation_Async_0400 finish data: ${JSON.stringify(data)}`);
console.info(`getSignalInformation_Async_0400 data: ${JSON.stringify(data)}`);
if (data.length > 0) {
expect(data[0].signalLevel != -1).assertTrue();
expect(data[0].signalType != radio.NETWORK_TYPE_WCDMA).assertTrue();
......@@ -173,12 +171,12 @@ describe('ActsNetworkSearchTest', function () {
it('Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0400', 0, async function (done) {
radio.getISOCountryCodeForNetwork(SLOT_2, (err, data) => {
if (err) {
console.log(`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0400 fail err: ${err}`);
expect().assertFail();
console.info(`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0400 fail err: ${err}`);
expect(err.code).assertEqual("-1");
done();
return;
}
console.log(
console.info(
`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0400 finish data: ${JSON.stringify(data)}`);
expect(data.length === 0).assertTrue();
done();
......@@ -193,12 +191,12 @@ describe('ActsNetworkSearchTest', function () {
it('Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0400', 0, async function (done) {
try {
let data = await radio.getISOCountryCodeForNetwork(SLOT_2);
console.log(
console.info(
`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0400 finish data:${JSON.stringify(data)}`);
expect(data.length === 0).assertTrue();
} catch (err) {
console.log(`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0400 fail err: ${err}`);
expect().assertFail();
console.info(`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0400 fail err: ${err}`);
expect(err.code).assertEqual("-1");
done();
return;
}
......@@ -213,10 +211,10 @@ describe('ActsNetworkSearchTest', function () {
it('Telephony_NetworkSearch_getNetworkSelectionMode_Async_0500', 0, async function (done) {
radio.getNetworkSelectionMode(SLOT_2, (err, res) => {
if (err) {
console.log(`Telephony_NetworkSearch_getNetworkSelectionMode_Async_0500 err: ${err}`);
console.info(`Telephony_NetworkSearch_getNetworkSelectionMode_Async_0500 err: ${err}`);
done();
} else {
console.log('Telephony_NetworkSearch_getNetworkSelectionMode_Async_0500 fail not go to err');
console.info('Telephony_NetworkSearch_getNetworkSelectionMode_Async_0500 fail not go to err');
expect().assertFail();
done();
}
......@@ -232,10 +230,10 @@ describe('ActsNetworkSearchTest', function () {
it('Telephony_NetworkSearch_getNetworkSelectionMode_Promise_0500', 0, async function (done) {
try {
await radio.getNetworkSelectionMode(SLOT_2);
console.log('Telephony_NetworkSearch_getNetworkSelectionMode_Promise_0500 fail not go to err');
console.info('Telephony_NetworkSearch_getNetworkSelectionMode_Promise_0500 fail not go to err');
expect().assertFail();
} catch (err) {
console.log('Telephony_NetworkSearch_getNetworkSelectionMode_Promise_0500 finish');
console.info('Telephony_NetworkSearch_getNetworkSelectionMode_Promise_0500 finish');
done();
return;
}
......@@ -254,10 +252,10 @@ describe('ActsNetworkSearchTest', function () {
it('Telephony_NetworkSearch_getNetworkState_Promise_0700', 0, async function (done) {
try {
await radio.getNetworkState(SLOT_2);
console.log('Telephony_NetworkSearch_getNetworkState_Promise_0700 fail not go to err');
console.info('Telephony_NetworkSearch_getNetworkState_Promise_0700 fail not go to err');
expect().assertFail();
} catch (err) {
console.log(`Telephony_NetworkSearch_getNetworkState_Promise_0700 finish err: ${err}`);
console.info(`Telephony_NetworkSearch_getNetworkState_Promise_0700 finish err: ${err}`);
done();
return;
}
......@@ -272,10 +270,10 @@ describe('ActsNetworkSearchTest', function () {
it('Telephony_NetworkSearch_getRadioTech_Promise_0400', 0, async function (done) {
try {
await radio.getRadioTech(SLOT_2);
console.log('Telephony_NetworkSearch_getRadioTech_Promise_0400 fail not go to err');
console.info('Telephony_NetworkSearch_getRadioTech_Promise_0400 fail not go to err');
expect().assertFail();
} catch (err) {
console.log(`Telephony_NetworkSearch_getRadioTech_Promise_0400 finish err: ${err}`);
console.info(`Telephony_NetworkSearch_getRadioTech_Promise_0400 finish err: ${err}`);
done();
return;
}
......@@ -290,12 +288,12 @@ describe('ActsNetworkSearchTest', function () {
it('Telephony_NetworkSearch_getSignalInformation_Promise_0400', 0, async function (done) {
try {
let data = await radio.getSignalInformation(SLOT_2);
console.log(
console.info(
`Telephony_NetworkSearch_getSignalInformation_Promise_0400 finish data: ${JSON.stringify(data)}`);
expect(data.length === 0).assertTrue();
} catch (err) {
console.log(`Telephony_NetworkSearch_getSignalInformation_Promise_0400 fail err: ${err}`);
expect().assertFail();
console.info(`Telephony_NetworkSearch_getSignalInformation_Promise_0400 fail err: ${err}`);
expect(err.code).assertEqual("202");
done();
return;
}
......@@ -310,12 +308,12 @@ describe('ActsNetworkSearchTest', function () {
it('Telephony_NetworkSearch_getOperatorName_Async_0400', 0, async function (done) {
radio.getOperatorName(SLOT_2, (err, data) => {
if (err) {
console.log(`Telephony_NetworkSearch_getOperatorName_Async_0400 fail err: ${err}`);
expect().assertFail();
console.info(`Telephony_NetworkSearch_getOperatorName_Async_0400 fail err: ${err}`);
expect(err.code).assertEqual("202");
done();
return;
}
console.log(`Telephony_NetworkSearch_getOperatorName_Async_0400 finish data: ${data}`);
console.info(`Telephony_NetworkSearch_getOperatorName_Async_0400 finish data: ${data}`);
expect(data === '').assertTrue();
done();
})
......@@ -329,12 +327,12 @@ describe('ActsNetworkSearchTest', function () {
it('Telephony_NetworkSearch_getOperatorName_Promise_0400', 0, async function (done) {
try {
let data = await radio.getOperatorName(SLOT_2);
console.log(`Telephony_NetworkSearch_getOperatorName_Promise_0400 finish data: ${data}`);
console.info(`Telephony_NetworkSearch_getOperatorName_Promise_0400 finish data: ${data}`);
expect(data === '').assertTrue();
done();
} catch (err) {
console.log(`Telephony_NetworkSearch_getOperatorName_Promise_0400 fail err: ${err}`);
expect().assertFail();
console.info(`Telephony_NetworkSearch_getOperatorName_Promise_0400 fail err: ${err}`);
expect(err.code).assertEqual("202");
done();
}
})
......@@ -347,12 +345,12 @@ describe('ActsNetworkSearchTest', function () {
it('Telephony_NetworkSearch_getOperatorName_Async_0500', 0, async function (done) {
radio.getOperatorName(0, (err, data) => {
if (err) {
console.log(`Telephony_NetworkSearch_getOperatorName_Async_0500 fail err: ${err}`);
console.info(`Telephony_NetworkSearch_getOperatorName_Async_0500 fail err: ${err}`);
expect().assertFail();
done();
return;
}
console.log(`Telephony_NetworkSearch_getOperatorName_Async_0500 finish data: ${data}`);
console.info(`Telephony_NetworkSearch_getOperatorName_Async_0500 finish data: ${data}`);
expect(true).assertTrue();
done();
})
......@@ -366,11 +364,11 @@ describe('ActsNetworkSearchTest', function () {
it('Telephony_NetworkSearch_getOperatorName_Promise_0500', 0, async function (done) {
try {
let data = await radio.getOperatorName(0);
console.log(`Telephony_NetworkSearch_getOperatorName_Promise_0500 finish data: ${data}`);
console.info(`Telephony_NetworkSearch_getOperatorName_Promise_0500 finish data: ${data}`);
expect(true).assertTrue();
done();
} catch (err) {
console.log(`Telephony_NetworkSearch_getOperatorName_Promise_0500 fail err: ${err}`);
console.info(`Telephony_NetworkSearch_getOperatorName_Promise_0500 fail err: ${err}`);
expect().assertFail();
done();
}
......@@ -384,11 +382,11 @@ describe('ActsNetworkSearchTest', function () {
it('Telephony_NetworkSearch_isRadioOn_Async_0200', 0, async function (done) {
radio.isRadioOn((err) => {
if (err) {
console.log(`Telephony_NetworkSearch_isRadioOn_Async_0200 fail: ${err}`);
console.info(`Telephony_NetworkSearch_isRadioOn_Async_0200 fail: ${err}`);
done();
return;
}
console.log('Telephony_NetworkSearch_isRadioOn_Async_0200 finish');
console.info('Telephony_NetworkSearch_isRadioOn_Async_0200 finish');
done();
});
});
......@@ -401,10 +399,10 @@ describe('ActsNetworkSearchTest', function () {
it('Telephony_NetworkSearch_isRadioOn_Promise_0200', 0, async function (done) {
try {
await radio.isRadioOn();
console.log('Telephony_NetworkSearch_isRadioOn_Promise_0200 success');
console.info('Telephony_NetworkSearch_isRadioOn_Promise_0200 success');
done();
} catch (err) {
console.log(`Telephony_NetworkSearch_isRadioOn_Promise_0200 fail ${err}`);
console.info(`Telephony_NetworkSearch_isRadioOn_Promise_0200 fail ${err}`);
done();
}
});
......@@ -417,11 +415,11 @@ describe('ActsNetworkSearchTest', function () {
it('Telephony_NetworkSearch_isRadioOn_Async_0300', 0, async function (done) {
radio.isRadioOn(0, (err) => {
if (err) {
console.log(`Telephony_NetworkSearch_isRadioOn_Async_0300 fail: ${err}`);
console.info(`Telephony_NetworkSearch_isRadioOn_Async_0300 fail: ${err}`);
done();
return;
}
console.log('Telephony_NetworkSearch_isRadioOn_Async_0300 finish');
console.info('Telephony_NetworkSearch_isRadioOn_Async_0300 finish');
done();
});
});
......@@ -434,10 +432,10 @@ describe('ActsNetworkSearchTest', function () {
it('Telephony_NetworkSearch_isRadioOn_Promise_0300', 0, async function (done) {
try {
await radio.isRadioOn(0);
console.log('Telephony_NetworkSearch_isRadioOn_Promise_0300 success');
console.info('Telephony_NetworkSearch_isRadioOn_Promise_0300 success');
done();
} catch (err) {
console.log(`Telephony_NetworkSearch_isRadioOn_Promise_0300 fail ${err}`);
console.info(`Telephony_NetworkSearch_isRadioOn_Promise_0300 fail ${err}`);
done();
}
});
......@@ -449,7 +447,7 @@ describe('ActsNetworkSearchTest', function () {
*/
it('Telephony_StateRegistry_on_0200', 0, async function (done) {
observer.on('networkStateChange', { slotId: SLOT_0 }, (networkState) => {
console.log(`Telephony_StateRegistry_on_0200 networkStateChanged data: ${JSON.stringify(networkState)}`);
console.info(`Telephony_StateRegistry_on_0200 networkStateChanged data: ${JSON.stringify(networkState)}`);
done();
});
done();
......@@ -472,7 +470,7 @@ describe('ActsNetworkSearchTest', function () {
*/
it('Telephony_StateRegistry_on_0300', 0, async function (done) {
observer.on('signalInfoChange', { slotId: SLOT_0 }, (networkState) => {
console.log(`Telephony_StateRegistry_on_0200 networkStateChanged data: ${JSON.stringify(networkState)}`);
console.info(`Telephony_StateRegistry_on_0200 networkStateChanged data: ${JSON.stringify(networkState)}`);
done();
});
done();
......
......@@ -47,7 +47,7 @@ describe('SimManagerTest', function () {
expect(lockStatusResponse.result === RES_RESULT).assertTrue();
expect(lockStatusResponse.remain === RES_REMAIN).assertTrue();
} catch (error) {
console.log(`Telephony_Sim error`);
console.info(`Telephony_Sim error`);
}
});
......@@ -57,7 +57,7 @@ describe('SimManagerTest', function () {
* @tc.desc Function test
*/
it('Telephony_Sim_constantValidate_0100', 0, async function (done) {
console.log(`Telephony_Sim_constantValidate_0100 start`);
console.info(`Telephony_Sim_constantValidate_0100 start`);
expect(sim.SimState.SIM_STATE_UNKNOWN !== env.INVALID_VALUE).assertTrue();
expect(sim.SimState.SIM_STATE_NOT_PRESENT !== env.INVALID_VALUE).assertTrue();
expect(sim.SimState.SIM_STATE_LOCKED !== env.INVALID_VALUE).assertTrue();
......@@ -90,7 +90,7 @@ describe('SimManagerTest', function () {
expect(sim.PC_PUK_LOCK !== env.INVALID_VALUE).assertTrue();
expect(sim.SIM_PIN_LOCK !== env.INVALID_VALUE).assertTrue();
expect(sim.SIM_PUK_LOCK !== env.INVALID_VALUE).assertTrue();
console.log(`Telephony_Sim_constantValidate_0100 finish`);
console.info(`Telephony_Sim_constantValidate_0100 finish`);
done();
});
......@@ -104,13 +104,13 @@ describe('SimManagerTest', function () {
const CASE_NAME = 'Telephony_Sim_getISOCountryCodeForSim_Async_0200';
sim.getISOCountryCodeForSim(env.SLOTID2, (err, data) => {
if (err) {
console.log(`${CASE_NAME} expect err: ${err.message}`);
console.log(`${CASE_NAME} finish`);
console.info(`${CASE_NAME} expect err: ${err.message}`);
console.info(`${CASE_NAME} finish`);
done();
return;
}
expect().assertFail();
console.log(`${CASE_NAME} fail, data = ${data}`);
console.info(`${CASE_NAME} fail, data = ${data}`);
done();
});
});
......@@ -126,13 +126,13 @@ describe('SimManagerTest', function () {
try {
var data = await sim.getISOCountryCodeForSim(env.SLOTID2);
} catch (err) {
console.log(`${CASE_NAME} expect err: ${err.message}`);
console.log(`${CASE_NAME} finish`);
console.info(`${CASE_NAME} expect err: ${err.message}`);
console.info(`${CASE_NAME} finish`);
done();
return;
}
expect().assertFail();
console.log(`${CASE_NAME} fail, data = ${data}`);
console.info(`${CASE_NAME} fail, data = ${data}`);
done();
});
......@@ -146,13 +146,13 @@ describe('SimManagerTest', function () {
const CASE_NAME = 'Telephony_Sim_getSimOperatorNumeric_Async_0200';
sim.getSimOperatorNumeric(env.SLOTID2, (err, data) => {
if (err) {
console.log(`${CASE_NAME} expect err: ${err.message}`);
console.log(`${CASE_NAME} finish`);
console.info(`${CASE_NAME} expect err: ${err.message}`);
console.info(`${CASE_NAME} finish`);
done();
return;
}
expect().assertFail();
console.log(`${CASE_NAME} fail, data = ${data}`);
console.info(`${CASE_NAME} fail, data = ${data}`);
done();
});
});
......@@ -168,13 +168,13 @@ describe('SimManagerTest', function () {
try {
var data = await sim.getSimOperatorNumeric(env.SLOTID2);
} catch (err) {
console.log(`${CASE_NAME} expect err: ${err.message}`);
console.log(`${CASE_NAME} finish`);
console.info(`${CASE_NAME} expect err: ${err.message}`);
console.info(`${CASE_NAME} finish`);
done();
return;
}
expect().assertFail();
console.log(`${CASE_NAME} fail, data = ${data}`);
console.info(`${CASE_NAME} fail, data = ${data}`);
done();
});
......@@ -187,13 +187,13 @@ describe('SimManagerTest', function () {
const CASE_NAME = 'Telephony_Sim_getSimSpn_Async_0200';
sim.getSimSpn(env.SLOTID2, (err, data) => {
if (err) {
console.log(`${CASE_NAME} fail: ${err.message}`);
console.log(`${CASE_NAME} finish`);
console.info(`${CASE_NAME} fail: ${err.message}`);
console.info(`${CASE_NAME} finish`);
done();
return;
}
expect().assertFail();
console.log(`${CASE_NAME} fail, data = ${data}`);
console.info(`${CASE_NAME} fail, data = ${data}`);
done();
});
});
......@@ -208,13 +208,13 @@ describe('SimManagerTest', function () {
try {
var data = await sim.getSimSpn(env.SLOTID2);
} catch (err) {
console.log(`${CASE_NAME} expect err: ${err.message}`);
console.log(`${CASE_NAME} finish`);
console.info(`${CASE_NAME} expect err: ${err.message}`);
console.info(`${CASE_NAME} finish`);
done();
return;
}
expect().assertFail();
console.log(`${CASE_NAME} fail, data = ${data}`);
console.info(`${CASE_NAME} fail, data = ${data}`);
done();
});
......@@ -227,13 +227,13 @@ describe('SimManagerTest', function () {
sim.getSimState(env.SLOTID2, (err, data) => {
const CASE_NAME = 'Telephony_Sim_getSimState_Async_0200';
if (err) {
console.log(`${CASE_NAME} expect err: ${err.message}`);
console.log(`${CASE_NAME} finish`);
console.info(`${CASE_NAME} expect err: ${err.message}`);
console.info(`${CASE_NAME} finish`);
done();
return;
}
expect().assertFail();
console.log(`${CASE_NAME} fail, data = ${data}`);
console.info(`${CASE_NAME} fail, data = ${data}`);
done();
});
});
......@@ -248,13 +248,13 @@ describe('SimManagerTest', function () {
try {
var data = await sim.getSimState(env.SLOTID2);
} catch (err) {
console.log(`${CASE_NAME} expect err: ${err.message}`);
console.log(`${CASE_NAME} finish`);
console.info(`${CASE_NAME} expect err: ${err.message}`);
console.info(`${CASE_NAME} finish`);
done();
return;
}
expect().assertFail();
console.log(`${CASE_NAME} fail, data = ${data}`);
console.info(`${CASE_NAME} fail, data = ${data}`);
done();
});
......@@ -265,18 +265,12 @@ describe('SimManagerTest', function () {
* @tc.desc Function test
*/
it('Telephony_Sim_isSimActive_Async_0700', 0, async function (done) {
const CASE_NAME = 'Telephony_Sim_isSimActive_Async_0700';
sim.isSimActive(env.SLOTID2, (err, data) => {
if (err) {
console.log(`${CASE_NAME} fail, err: ${err.message}`);
expect().assertFail();
const CASE_NAME = 'Telephony_Sim_isSimActive_Async_0700';
sim.isSimActive(env.SLOTID2, (err, data) => {
console.info("isSimActive async err info :" + JSON.stringify(err) + "data:" + JSON.stringify(data));
expect(err.code).assertEqual("-1");
done();
return;
}
expect(data).assertFalse();
console.log(`${CASE_NAME} finish`);
done();
});
});
});
/**
......@@ -287,17 +281,16 @@ describe('SimManagerTest', function () {
*/
it('Telephony_Sim_isSimActive_Promise_0700', 0, async function (done) {
const CASE_NAME = 'Telephony_Sim_isSimActive_Promise_0700';
try {
let data = await sim.isSimActive(env.SLOTID2);
let promise = sim.isSimActive(env.SLOTID2);
promise.then(data => {
console.log(`isSimActive success, promise: data->${JSON.stringify(data)}`);
expect(data).assertFalse();
} catch (err) {
console.log(`${CASE_NAME} isSimActive fail, err: ${err.message}`);
expect().assertFail();
done();
return;
}
console.log(`${CASE_NAME} finish`);
done();
}).catch(err => {
console.info("isSimActive promise err info :" + JSON.stringify(err));
expect(err.code).assertEqual("-1");
done();
});
});
/**
......@@ -310,14 +303,12 @@ describe('SimManagerTest', function () {
const CASE_NAME = 'Telephony_Sim_hasSimCard_Async_0600';
sim.hasSimCard(env.SLOTID2, (err, data) => {
if (err) {
expect().assertFail();
console.log(`${CASE_NAME} fail, err: ${err.message}`);
expect(err.code).assertEqual("-1");
console.info(`${CASE_NAME} fail, err: ${err.message}`);
done();
return;
}
expect(data).assertFalse();
console.log(`${CASE_NAME} finish`);
done();
console.info(`${CASE_NAME} finish`);
});
});
......@@ -331,15 +322,13 @@ describe('SimManagerTest', function () {
const CASE_NAME = 'Telephony_Sim_hasSimCard_Promise_0600';
try {
let data = await sim.hasSimCard(env.SLOTID2);
expect(data).assertFalse();
} catch (err) {
expect().assertFail();
console.log(`${CASE_NAME} fail, err: ${err.message}`);
expect(err.code).assertEqual("-1");
console.info(`${CASE_NAME} fail, err: ${err.message}`);
done();
return;
}
console.log(`${CASE_NAME} finish`);
done();
console.info(`${CASE_NAME} finish`);
});
/**
......@@ -351,7 +340,7 @@ describe('SimManagerTest', function () {
const CASE_NAME = 'Telephony_Sim_getMaxSimCount_0100';
let simCount = sim.getMaxSimCount();
expect(simCount > env.SIM_MIN_COUNT).assertTrue();
console.log(`${CASE_NAME} test finish.`);
console.info(`${CASE_NAME} test finish.`);
done();
});
......@@ -363,16 +352,14 @@ describe('SimManagerTest', function () {
*/
it('Telephony_Sim_GetCardType_Async_0400', 0, function (done) {
const CASE_NAME = 'Telephony_Sim_GetCardType_Async_0400';
sim.getCardType(env.SLOTID2, (error, cardType) => {
if (error) {
console.log(`${CASE_NAME} GetCardType error: ${error.message}`);
expect().assertFail();
sim.getCardType(env.SLOTID2, (err, cardType) => {
if (err) {
console.info(`${CASE_NAME} GetCardType error: ${err.message}`);
expect(err.code).assertEqual("-1");
done();
return;
}
expect(cardType === sim.UNKNOWN_CARD).assertTrue();
console.log(`${CASE_NAME} test finish.`);
done();
console.info(`${CASE_NAME} test finish.`);
});
});
......@@ -386,11 +373,10 @@ describe('SimManagerTest', function () {
const CASE_NAME = 'Telephony_Sim_GetCardType_Promise_0400';
try {
const cardType = await sim.getCardType(env.SLOTID2);
expect(cardType === sim.UNKNOWN_CARD).assertTrue();
console.log(`${CASE_NAME} test finish.`);
} catch (error) {
console.log(`${CASE_NAME} GetCardType error: ${error.message}`);
expect().assertFail();
console.info(`${CASE_NAME} test finish.`);
} catch (err) {
console.info(`${CASE_NAME} GetCardType error: ${err.message}`);
expect(err.code).assertEqual("-1");
}
done();
});
......@@ -405,13 +391,13 @@ describe('SimManagerTest', function () {
const CASE_NAME = 'Telephony_Sim_hasOperatorPrivileges_Async_0400';
sim.hasOperatorPrivileges(env.SLOTID2, (error, result) => {
if (error) {
console.log(`${CASE_NAME} hasOperatorPrivileges error: ${error.message}`);
console.info(`${CASE_NAME} hasOperatorPrivileges error: ${error.message}`);
expect().assertFail();
done();
return;
}
expect(result).assertFalse();
console.log(`${CASE_NAME} test finish.`);
console.info(`${CASE_NAME} test finish.`);
done();
});
});
......@@ -427,9 +413,9 @@ describe('SimManagerTest', function () {
try {
const result = await sim.hasOperatorPrivileges(env.SLOTID2);
expect(result).assertFalse();
console.log(`${CASE_NAME} test finish.`);
console.info(`${CASE_NAME} test finish.`);
} catch (error) {
console.log(`${CASE_NAME} hasOperatorPrivileges error: ${error.message}`);
console.info(`${CASE_NAME} hasOperatorPrivileges error: ${error.message}`);
expect().assertFail();
}
done();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册