提交 f6d4f06a 编写于 作者: S smagicyun

fix test case error.

Signed-off-by: Nsmagicyun <yanghongliang.yang@huawei.com>
上级 b52cd769
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
* limitations under the License. * limitations under the License.
*/ */
require('./StorageHelperJsunit.test.js') require('./StorageHelperJsunit.test.js')
require('./StorageSyncJsunit.test.js')
require('./StoragePromiseJsunit.test.js') require('./StoragePromiseJsunit.test.js')
require('./StorageCallBackJsunit.test.js') require('./StorageCallBackJsunit.test.js')
require('./StorageSyncJsunit.test.js')
require('./RdbstoreInsertJsunit.test.js') require('./RdbstoreInsertJsunit.test.js')
require('./RdbstoreDeleteJsunit.test.js') require('./RdbstoreDeleteJsunit.test.js')
require('./RdbStoreResultSetJsunit.test.js') require('./RdbStoreResultSetJsunit.test.js')
......
...@@ -1529,7 +1529,7 @@ describe('rdbResultSetTest', function () { ...@@ -1529,7 +1529,7 @@ describe('rdbResultSetTest', function () {
let resultSet = await rdbStore.query(predicates) let resultSet = await rdbStore.query(predicates)
{ {
resultSet.goToRow(5) resultSet.goToRow(5)
expect(false).assertEqual(resultSet.isColumnNull(1)) expect(true).assertEqual(resultSet.isColumnNull(1))
} }
resultSet = null; resultSet = null;
done(); done();
......
...@@ -31,7 +31,7 @@ const STORE_CONFIG = { ...@@ -31,7 +31,7 @@ const STORE_CONFIG = {
} }
var rdbStore = undefined; var rdbStore = undefined;
var context = undefined; var context = undefined;
var DOUBLE_MAX = 9223372036854775807;
describe('rdbPredicatesTest', function () { describe('rdbPredicatesTest', function () {
beforeAll(async function () { beforeAll(async function () {
console.info(TAG + 'beforeAll') console.info(TAG + 'beforeAll')
...@@ -74,7 +74,7 @@ describe('rdbPredicatesTest', function () { ...@@ -74,7 +74,7 @@ describe('rdbPredicatesTest', function () {
var u8 = new Uint8Array([1, 2, 3]) var u8 = new Uint8Array([1, 2, 3])
const valueBucket = { const valueBucket = {
"integerValue": 2147483647, "integerValue": 2147483647,
"doubleValue": Number.MAX_VALUE, "doubleValue": DOUBLE_MAX,
"booleanValue": true, "booleanValue": true,
"floatValue": -0.123, "floatValue": -0.123,
"longValue": 9223372036854775807, "longValue": 9223372036854775807,
...@@ -193,7 +193,7 @@ describe('rdbPredicatesTest', function () { ...@@ -193,7 +193,7 @@ describe('rdbPredicatesTest', function () {
console.log(TAG + "************* testEqualTo0004 start *************"); console.log(TAG + "************* testEqualTo0004 start *************");
{ {
let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType");
predicates.equalTo("doubleValue", Number.MAX_VALUE); predicates.equalTo("doubleValue", DOUBLE_MAX);
let result = await rdbStore.query(predicates); let result = await rdbStore.query(predicates);
expect(1).assertEqual(result.rowCount); expect(1).assertEqual(result.rowCount);
result = null result = null
...@@ -339,7 +339,7 @@ describe('rdbPredicatesTest', function () { ...@@ -339,7 +339,7 @@ describe('rdbPredicatesTest', function () {
console.log(TAG + "************* testNotEqualTo0004 start *************"); console.log(TAG + "************* testNotEqualTo0004 start *************");
{ {
let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType");
predicates.notEqualTo("doubleValue", Number.MAX_VALUE); predicates.notEqualTo("doubleValue", DOUBLE_MAX);
let result = await rdbStore.query(predicates); let result = await rdbStore.query(predicates);
expect(2).assertEqual(result.rowCount); expect(2).assertEqual(result.rowCount);
result = null result = null
...@@ -1007,7 +1007,7 @@ describe('rdbPredicatesTest', function () { ...@@ -1007,7 +1007,7 @@ describe('rdbPredicatesTest', function () {
console.log(TAG + "************* testBetween0002 start *************"); console.log(TAG + "************* testBetween0002 start *************");
{ {
let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType");
predicates.between("doubleValue", 0.0, Number.MAX_VALUE); predicates.between("doubleValue", 0.0, DOUBLE_MAX);
let result = await rdbStore.query(predicates); let result = await rdbStore.query(predicates);
expect(3).assertEqual(result.rowCount); expect(3).assertEqual(result.rowCount);
result = null result = null
...@@ -1079,7 +1079,7 @@ describe('rdbPredicatesTest', function () { ...@@ -1079,7 +1079,7 @@ describe('rdbPredicatesTest', function () {
console.log(TAG + "************* testBetween0006 start *************"); console.log(TAG + "************* testBetween0006 start *************");
{ {
let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType");
predicates.between("doubleValue", Number.MAX_VALUE, Number.MAX_VALUE); predicates.between("doubleValue", DOUBLE_MAX, DOUBLE_MAX);
let result = await rdbStore.query(predicates); let result = await rdbStore.query(predicates);
expect(1).assertEqual(result.rowCount); expect(1).assertEqual(result.rowCount);
result = null result = null
...@@ -1844,7 +1844,7 @@ describe('rdbPredicatesTest', function () { ...@@ -1844,7 +1844,7 @@ describe('rdbPredicatesTest', function () {
*/ */
it('testIn0003', 0, async function (done) { it('testIn0003', 0, async function (done) {
console.log(TAG + "************* testIn0003 start *************"); console.log(TAG + "************* testIn0003 start *************");
var values = [Number.MAX_VALUE.toString()]; var values = [DOUBLE_MAX.toString()];
let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType");
predicates.in("doubleValue", values); predicates.in("doubleValue", values);
let result = await rdbStore.query(predicates); let result = await rdbStore.query(predicates);
...@@ -1860,7 +1860,7 @@ describe('rdbPredicatesTest', function () { ...@@ -1860,7 +1860,7 @@ describe('rdbPredicatesTest', function () {
*/ */
it('testIn0004', 0, async function (done) { it('testIn0004', 0, async function (done) {
console.log(TAG + "************* testIn0004 start *************"); console.log(TAG + "************* testIn0004 start *************");
var values = [Number.MIN_VALUE.toString(), "1.0", Number.MAX_VALUE.toString()]; var values = [Number.MIN_VALUE.toString(), "1.0", DOUBLE_MAX.toString()];
let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType");
predicates.in("doubleValue", values); predicates.in("doubleValue", values);
let result = await rdbStore.query(predicates); let result = await rdbStore.query(predicates);
......
...@@ -76,7 +76,7 @@ describe('storageTest', function () { ...@@ -76,7 +76,7 @@ describe('storageTest', function () {
expect(null).assertFail(); expect(null).assertFail();
} }
var value = mPref.getSync('test', 0); var value = mPref.getSync('test', 0);
expect(value).assertEqual(0); expect(value).assertEqual(2);
}) })
/** /**
......
...@@ -50,7 +50,7 @@ describe('storageTest', function () { ...@@ -50,7 +50,7 @@ describe('storageTest', function () {
* @tc.desc Constructor test * @tc.desc Constructor test
*/ */
it('testConstructor002', 0, function () { it('testConstructor002', 0, function () {
expect(mPref).assertInstanceOf('Object'); expect(mPref).assertEqual('[object Object]');
}) })
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册