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

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

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