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

!5409 【Distributeddatamgr】【master】用例优化

Merge pull request !5409 from 梁梁/master
......@@ -1910,11 +1910,7 @@ describe('dataAbilityPredicatesTest', function () {
let dataAbilityPredicates = await new dataAbility.DataAbilityPredicates();
var dataAbilityPredicatesInit = dataAbilityPredicates
dataAbilityPredicates.equalTo("stringValue", "ABCDEFGHIJKLMN").or().and().equalTo("integerValue", 1);
if(dataAbilityPredicatesInit == dataAbilityPredicates){
expect(true).assertTrue();
}else{
expect(null).assertFail();
}
expect(dataAbilityPredicates == dataAbilityPredicatesInit).assertTrue();
let predicates = dataAbility.createRdbPredicates("AllDataType", dataAbilityPredicates);
console.info(TAG + "you should not start a request" + " with \"and\" or use or() before this function");
......@@ -1935,11 +1931,7 @@ describe('dataAbilityPredicatesTest', function () {
var dataAbilityPredicatesInit = dataAbilityPredicates
dataAbilityPredicates.equalTo("stringValue", "ABCDEFGHIJKLMN").or().or().equalTo("integerValue", 1);
let predicates = dataAbility.createRdbPredicates("AllDataType", dataAbilityPredicates);
if(dataAbilityPredicatesInit == dataAbilityPredicates){
expect(true).assertTrue();
}else{
expect(null).assertFail();
}
expect(dataAbilityPredicates == dataAbilityPredicatesInit).assertTrue();
console.info(TAG + "you are starting a sql request with predicate or or,"
+ "using function or() immediately after another or(). that is ridiculous.");
}
......
......@@ -605,7 +605,7 @@ describe('rdbstoreInsertTest', function () {
})
}catch(err){
console.info(TAG + "Batch insert data error: " + err)
expect(err == null).assertTrue();
expect(null).assertFail();;
}
done()
console.info(TAG + "************* testRdbStorebatchInsertPromise0006 end *************");
......@@ -628,7 +628,7 @@ describe('rdbstoreInsertTest', function () {
})
}catch(err){
console.info(TAG + "Batch insert data error: " + err)
expect(err == null).assertTrue();
expect(null).assertFail();
}
done()
console.info(TAG + "************* testRdbStorebatchInsertPromise0007 end *************");
......@@ -1045,14 +1045,14 @@ describe('rdbstoreInsertTest', function () {
rdbStore.batchInsert("testCallback6", "valueBuckets", (err, data) => {
console.info(TAG + "Affect row is " + data)
if(err != null){
expect(err == null).assertTrue()
expect(null).assertFail();
}else{
expect(data).assertEqual(-1)
}
})
}catch(err){
console.info(TAG + "Batch insert data error: " + err)
expect(err == null).assertTrue();
expect(null).assertFail();
}
})
......@@ -1073,7 +1073,7 @@ describe('rdbstoreInsertTest', function () {
await rdbStore.batchInsert("testCallback7", (err,data) => {
console.info(TAG + "Affect row is " + data)
if(err != null){
expect(err == null).assertTrue();
expect(null).assertFail();
}else{
expect(data).assertEqual(-1)
}
......@@ -1081,12 +1081,12 @@ describe('rdbstoreInsertTest', function () {
console.info(TAG + "Batch insert fail ,affect row number is: " + data)
expect(data).assertEqual(-1)
})
}).then((err) => {
expect(err == null).assertTrue();
}).catch((err) => {
expect(null).assertFail();
})
}catch(err){
console.info(TAG + "Batch insert data error: " + err)
expect(err == null).assertTrue();
expect(null).assertFail();
}
done()
console.info(TAG + "************* testRdbStorebatchInsertCallback0007 end *************");
......
......@@ -1727,11 +1727,7 @@ describe('rdbPredicatesTest', function () {
let predicates = await new dataRdb.RdbPredicates("AllDataType");
var predicatesInit = predicates
predicates.equalTo("stringValue", "ABCDEFGHIJKLMN").or().and().equalTo("integerValue", 1);
if(predicates == predicatesInit){
expect(true).assertTrue();
}else{
expect(null).assertFail();
}
expect(predicates == predicatesInit).assertTrue();
console.info(TAG + "you should not start a request" + " with \"and\" or use or() before this function");
}
done();
......@@ -1749,11 +1745,7 @@ describe('rdbPredicatesTest', function () {
let predicates = await new dataRdb.RdbPredicates("AllDataType");
var predicatesInit = predicates
predicates.equalTo("stringValue", "ABCDEFGHIJKLMN").or().or().equalTo("integerValue", 1);
if(predicates == predicatesInit){
expect(true).assertTrue();
}else{
expect(null).assertFail();
}
expect(predicates == predicatesInit).assertTrue();
console.info(TAG + "you are starting a sql request with predicate or or,"
+ "using function or() immediately after another or(). that is ridiculous.");
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册