提交 1a2b81e1 编写于 作者: W wuxiaodan

add NUMBER test

Signed-off-by: Nwuxiaodan <wuxiaodan5@huawei.com>
上级 c7e85cab
......@@ -331,12 +331,13 @@ describe('SingleKvStorePromiseTest', function () {
it('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0300', 0, async function (done) {
console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0300');
try {
var intValue = Number.MAX_VALUE;
let intValue = Number.MAX_VALUE;
console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0300 intValue ' + intValue);
await kvStore.put(KEY_TEST_INT_ELEMENT, intValue).then(async (data) => {
console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0300 put success');
expect(data == undefined).assertTrue();
await kvStore.get(KEY_TEST_INT_ELEMENT).then((data) => {
console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0300 get success');
console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0300 get success, data ' + data);
expect(intValue == data).assertTrue();
}).catch((err) => {
console.error('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0300 get fail ' + `, error code is ${err.code}, message is ${err.message}`);
......@@ -362,12 +363,13 @@ describe('SingleKvStorePromiseTest', function () {
it('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0400', 0, async function (done) {
console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0400');
try {
var intValue = Number.MIN_VALUE;
let intValue = Number.MIN_VALUE;
console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0400 intValue ' + intValue);
await kvStore.put(KEY_TEST_INT_ELEMENT, intValue).then(async (data) => {
console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0400 put success');
expect(data == undefined).assertTrue();
await kvStore.get(KEY_TEST_INT_ELEMENT).then((data) => {
console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0400 get success');
console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0400 get success, data ' + data);
expect(intValue == data).assertTrue();
}).catch((err) => {
console.error('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0400 get fail ' + `, error code is ${err.code}, message is ${err.message}`);
......@@ -384,6 +386,102 @@ describe('SingleKvStorePromiseTest', function () {
done();
})
/**
* @tc.number SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0500
* @tc.desc Test Js Api SingleKvStore.Put(Int) testcase 005
* @tc.type: FUNC
* @tc.name Test Js Api SingleKvStore.Put(Int) testcase 005
*/
it('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0500', 0, async function (done) {
console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0500');
try {
let intValue = Number.NaN;
console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0500 intValue ' + intValue);
await kvStore.put(KEY_TEST_INT_ELEMENT, intValue).then(async (data) => {
console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0500 put success');
expect(data == undefined).assertTrue();
await kvStore.get(KEY_TEST_INT_ELEMENT).then((data) => {
console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0500 get success, data ' + data);
expect(Number.isNaN(data)).assertTrue();
}).catch((err) => {
console.error('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0500 get fail ' + `, error code is ${err.code}, message is ${err.message}`);
expect(null).assertFail();
});
}).catch((err) => {
console.error('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0500 put fail ' + `, error code is ${err.code}, message is ${err.message}`);
expect(null).assertFail();
});
} catch (e) {
console.error('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0500 put e ' + `, error code is ${e.code}, message is ${e.message}`);
expect(null).assertFail();
}
done();
})
/**
* @tc.number SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0600
* @tc.desc Test Js Api SingleKvStore.Put(Int) testcase 006
* @tc.type: FUNC
* @tc.name Test Js Api SingleKvStore.Put(Int) testcase 006
*/
it('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0600', 0, async function (done) {
console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0600');
try {
let intValue = Number.NEGATIVE_INFINITY;
console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0600 intValue ' + intValue);
await kvStore.put(KEY_TEST_INT_ELEMENT, intValue).then(async (data) => {
console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0600 put success');
expect(data == undefined).assertTrue();
await kvStore.get(KEY_TEST_INT_ELEMENT).then((data) => {
console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0600 get success, data ' + data);
expect(intValue == data).assertTrue();
}).catch((err) => {
console.error('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0600 get fail ' + `, error code is ${err.code}, message is ${err.message}`);
expect(null).assertFail();
});
}).catch((err) => {
console.error('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0600 put fail ' + `, error code is ${err.code}, message is ${err.message}`);
expect(null).assertFail();
});
} catch (e) {
console.error('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0600 put e ' + `, error code is ${e.code}, message is ${e.message}`);
expect(null).assertFail();
}
done();
})
/**
* @tc.number SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0700
* @tc.desc Test Js Api SingleKvStore.Put(Int) testcase 007
* @tc.type: FUNC
* @tc.name Test Js Api SingleKvStore.Put(Int) testcase 007
*/
it('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0700', 0, async function (done) {
console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0700');
try {
let intValue = Number.POSITIVE_INFINITY;
console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0700 intValue ' + intValue);
await kvStore.put(KEY_TEST_INT_ELEMENT, intValue).then(async (data) => {
console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0700 put success');
expect(data == undefined).assertTrue();
await kvStore.get(KEY_TEST_INT_ELEMENT).then((data) => {
console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0700 get success, data ' + data);
expect(intValue == data).assertTrue();
}).catch((err) => {
console.error('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0700 get fail ' + `, error code is ${err.code}, message is ${err.message}`);
expect(null).assertFail();
});
}).catch((err) => {
console.error('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0700 put fail ' + `, error code is ${err.code}, message is ${err.message}`);
expect(null).assertFail();
});
} catch (e) {
console.error('SUB_DDM_DKV_SINGLEKVSTORE_PUTINT_PROMISE_0700 put e ' + `, error code is ${e.code}, message is ${e.message}`);
expect(null).assertFail();
}
done();
})
/**
* @tc.number SUB_DDM_DKV_SINGLEKVSTORE_GETINT_PROMISE_0100
* @tc.desc Test Js Api SingleKvStoreGetInt testcase 001
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册