提交 e751847a 编写于 作者: L liangzhenyu123

liangzhenyu6@huawei.com

Signed-off-by: Nliangzhenyu123 <liangzhenyu6@huawei.com>
上级 d0ac528a
...@@ -1801,16 +1801,14 @@ describe('deviceKvStoreCallbackTest', function () { ...@@ -1801,16 +1801,14 @@ describe('deviceKvStoreCallbackTest', function () {
await kvStore.removeDeviceData('', function (err,data) { await kvStore.removeDeviceData('', function (err,data) {
if (err == undefined) { if (err == undefined) {
console.info('testDeviceKvStoreRemoveDeviceData103 removeDeviceData success'); console.info('testDeviceKvStoreRemoveDeviceData103 removeDeviceData success');
expect(err == undefined).assertTrue();
} else {
console.info('testDeviceKvStoreRemoveDeviceData103 removeDeviceData fail ' + err);
expect(null).assertFail(); expect(null).assertFail();
} else {
console.info('testDeviceKvStoreRemoveDeviceData103 removeDeviceData fail');
} }
done(); done();
}); });
}catch(e) { }catch(e) {
console.info('testDeviceKvStoreRemoveDeviceData103 e ' + e); console.info('testDeviceKvStoreRemoveDeviceData103 e ' + e);
expect(null).assertFail();
done(); done();
} }
}) })
......
...@@ -1987,14 +1987,14 @@ describe('deviceKvStorePromiseTest', function () { ...@@ -1987,14 +1987,14 @@ describe('deviceKvStorePromiseTest', function () {
* @tc.name [JS-API8]DeviceKvStore.RemoveDeviceData() * @tc.name [JS-API8]DeviceKvStore.RemoveDeviceData()
* @tc.desc Test Js Api DeviceKvStore.RemoveDeviceData() testcase 003 * @tc.desc Test Js Api DeviceKvStore.RemoveDeviceData() testcase 003
*/ */
it('testDeviceKvStoreRemoveDeviceData003', 0, async function (done) { it('testDeviceKvStoreRemoveDeviceData003', 0, async function (done) {
console.info('testDeviceKvStoreRemoveDeviceData003'); console.info('testDeviceKvStoreRemoveDeviceData003');
try { try {
await kvStore.removeDeviceData('').then(() => { await kvStore.removeDeviceData('').then((data) => {
console.info('testDeviceKvStoreRemoveDeviceData003 removeDeviceData success'); console.info('testDeviceKvStoreRemoveDeviceData003 removeDeviceData success');
expect(null).assertFail();
}).catch((err) => { }).catch((err) => {
console.info('testDeviceKvStoreRemoveDeviceData003 removeDeviceData fail ' + err); console.info('testDeviceKvStoreRemoveDeviceData003 removeDeviceData fail ' + err);
expect(null).assertFail();
}); });
}catch(e) { }catch(e) {
console.info('testDeviceKvStoreRemoveDeviceData003 e ' + e); console.info('testDeviceKvStoreRemoveDeviceData003 e ' + e);
...@@ -2010,7 +2010,7 @@ describe('deviceKvStorePromiseTest', function () { ...@@ -2010,7 +2010,7 @@ describe('deviceKvStorePromiseTest', function () {
it('testDeviceKvStoreRemoveDeviceData004', 0, async function (done) { it('testDeviceKvStoreRemoveDeviceData004', 0, async function (done) {
console.info('testDeviceKvStoreRemoveDeviceData004'); console.info('testDeviceKvStoreRemoveDeviceData004');
try { try {
await kvStore.removeDeviceData(null).then((err) => { await kvStore.removeDeviceData(null).then((data) => {
console.info('testDeviceKvStoreRemoveDeviceData004 removeDeviceData success'); console.info('testDeviceKvStoreRemoveDeviceData004 removeDeviceData success');
expect(null).assertFail(); expect(null).assertFail();
}).catch((err) => { }).catch((err) => {
......
...@@ -1760,16 +1760,14 @@ describe('singleKvStoreCallbackTest', function () { ...@@ -1760,16 +1760,14 @@ describe('singleKvStoreCallbackTest', function () {
await kvStore.removeDeviceData('', function (err,data) { await kvStore.removeDeviceData('', function (err,data) {
if (err == undefined) { if (err == undefined) {
console.info('testSingleKvStoreRemoveDeviceData103 removeDeviceData success'); console.info('testSingleKvStoreRemoveDeviceData103 removeDeviceData success');
expect(err == undefined).assertTrue();
} else {
console.info('testSingleKvStoreRemoveDeviceData103 removeDeviceData fail: ' + err);
expect(null).assertFail(); expect(null).assertFail();
} else {
console.info('testSingleKvStoreRemoveDeviceData103 removeDeviceData fail');
} }
done(); done();
}); });
}catch(e) { }catch(e) {
console.info('testSingleKvStoreRemoveDeviceData103 e ' + e); console.info('testSingleKvStoreRemoveDeviceData103 e ' + e);
expect(null).assertFail();
done(); done();
} }
}) })
......
...@@ -1956,14 +1956,14 @@ describe('singleKvStorePromiseTest', function () { ...@@ -1956,14 +1956,14 @@ describe('singleKvStorePromiseTest', function () {
* @tc.name [JS-API8]SingleKvStoreRemoveDeviceData. * @tc.name [JS-API8]SingleKvStoreRemoveDeviceData.
* @tc.desc Test Js Api SingleKvStoreRemoveDeviceData testcase 003 * @tc.desc Test Js Api SingleKvStoreRemoveDeviceData testcase 003
*/ */
it('testSingleKvStoreRemoveDeviceData003', 0, async function (done) { it('testSingleKvStoreRemoveDeviceData003', 0, async function (done) {
console.info('testSingleKvStoreRemoveDeviceData003'); console.info('testSingleKvStoreRemoveDeviceData003');
try { try {
await kvStore.removeDeviceData('').then(() => { await kvStore.removeDeviceData('').then((data) => {
console.info('testSingleKvStoreRemoveDeviceData003 removeDeviceData success'); console.info('testSingleKvStoreRemoveDeviceData003 removeDeviceData success');
expect(null).assertFail();
}).catch((err) => { }).catch((err) => {
console.info('testSingleKvStoreRemoveDeviceData003 removeDeviceData fail ' + err); console.info('testSingleKvStoreRemoveDeviceData003 removeDeviceData fail ' + err);
expect(null).assertFail();
}); });
}catch(e) { }catch(e) {
console.info('testSingleKvStoreRemoveDeviceData003 e ' + e); console.info('testSingleKvStoreRemoveDeviceData003 e ' + e);
...@@ -1971,6 +1971,7 @@ describe('singleKvStorePromiseTest', function () { ...@@ -1971,6 +1971,7 @@ describe('singleKvStorePromiseTest', function () {
done(); done();
}) })
/** /**
* @tc.number SUB_DISTRIBUTEDDATAMGR_SINGLEKVSTORE_REMOVEDEVICEDATA_0400 * @tc.number SUB_DISTRIBUTEDDATAMGR_SINGLEKVSTORE_REMOVEDEVICEDATA_0400
* @tc.name [JS-API8]SingleKvStoreRemoveDeviceData. * @tc.name [JS-API8]SingleKvStoreRemoveDeviceData.
......
...@@ -1832,66 +1832,6 @@ describe('rdbResultSetTest', function () { ...@@ -1832,66 +1832,6 @@ describe('rdbResultSetTest', function () {
console.log(TAG + "************* testBigData0001 end *************"); console.log(TAG + "************* testBigData0001 end *************");
} }
}) })
/**
* @tc.name big resultSet data test
* @tc.number SUB_DDM_AppDataFWK_JSRDB_ResultSet_0251
* @tc.desc big resultSet data test
*/
it('testBigData0002', 0, async function (done) {
console.log(TAG + "************* testBigData0002 start *************");
{
await createBigData(500);
let resultSet = await rdbStore.querySql("SELECT * FROM test");
let count = resultSet.rowCount;
expect(500).assertEqual(count);
resultSet.goToLastRow();
let i = resultSet.rowCount;
while (i >= 1) {
expect("test" + --i).assertEqual(resultSet.getString(1))
resultSet.goToPreviousRow();
}
resultSet.close()
expect(true).assertEqual(resultSet.isClosed)
resultSet = null;
done();
console.log(TAG + "************* testBigData0002 end *************");
}
})
/**
* @tc.name big resultSet data test
* @tc.number SUB_DDM_AppDataFWK_JSRDB_ResultSet_0252
* @tc.desc big resultSet data test
*/
it('testBigData0003', 0, async function (done) {
console.log(TAG + "************* testBigData0003 start *************");
{
await createBigData(1);
let resultSet = await rdbStore.querySql("SELECT * FROM test");
let count = resultSet.rowCount;
expect(1).assertEqual(count);
resultSet.goToFirstRow();
expect(true).assertEqual(resultSet.isStarted);
expect("test0").assertEqual(resultSet.getString(1))
let rows = [1, 2, -1, -2];
for (const i of rows) {
resultSet.goToRow(i);
expect(true).assertEqual(resultSet.isStarted);
expect("").assertEqual(resultSet.getString(1))
}
resultSet.close()
expect(true).assertEqual(resultSet.isClosed)
resultSet = null;
done();
console.log(TAG + "************* testBigData0003 end *************");
}
})
console.info(TAG + '*************Unit Test End*************'); console.info(TAG + '*************Unit Test End*************');
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册