提交 6b3724e5 编写于 作者: Z zhaiyanni

<zhangmaowen@huawei.com>

Signed-off-by: Nzhaiyanni <zhaiyanni@huawei.com>
上级 caefa1c6
......@@ -44,8 +44,8 @@ describe('storageTest', function () {
mPref.flushSync();
await mPref.clear(function (err, ret) {
expect("defaultvalue").assertEqual(mPref.getSync(KEY_TEST_STRING_ELEMENT, "defaultvalue"));
});
done();
});
})
/**
......@@ -57,9 +57,9 @@ describe('storageTest', function () {
mPref.putSync(KEY_TEST_STRING_ELEMENT, "test");
await mPref.has(KEY_TEST_STRING_ELEMENT, function (err, ret) {
expect(true).assertEqual(ret);
})
done();
})
})
/**
* @tc.name has int callback interface test
......@@ -70,9 +70,9 @@ describe('storageTest', function () {
mPref.putSync(KEY_TEST_INT_ELEMENT, 1);
await mPref.has(KEY_TEST_INT_ELEMENT, function (err, ret) {
expect(true).assertEqual(ret);
})
done();
})
})
/**
* @tc.name has float callback interface test
......@@ -83,9 +83,9 @@ describe('storageTest', function () {
mPref.putSync(KEY_TEST_FLOAT_ELEMENT, 1.1);
await mPref.has(KEY_TEST_FLOAT_ELEMENT, function (err, ret) {
expect(true).assertEqual(ret);
})
done();
})
})
/**
* @tc.name has long callback interface test
......@@ -96,9 +96,9 @@ describe('storageTest', function () {
mPref.putSync(KEY_TEST_LONG_ELEMENT, 0);
await mPref.has(KEY_TEST_LONG_ELEMENT, function (err, ret) {
expect(true).assertEqual(ret);
})
done();
})
})
/**
* @tc.name has boolean callback interface test
......@@ -109,9 +109,9 @@ describe('storageTest', function () {
mPref.putSync(KEY_TEST_BOOLEAN_ELEMENT, false);
await mPref.has(KEY_TEST_BOOLEAN_ELEMENT, function (err, ret) {
expect(true).assertEqual(ret);
})
done();
})
})
/**
* @tc.name get defaultValue callback interface test
......@@ -122,9 +122,9 @@ describe('storageTest', function () {
mPref.clearSync();
await mPref.get(KEY_TEST_STRING_ELEMENT, "defaultValue", function (err, ret) {
expect('defaultValue').assertEqual(ret);
})
done();
})
})
/**
* @tc.name get float callback interface test
......@@ -136,9 +136,9 @@ describe('storageTest', function () {
mPref.putSync(KEY_TEST_FLOAT_ELEMENT, 3.0);
await mPref.get(KEY_TEST_FLOAT_ELEMENT, 0.0, function (err, ret) {
expect(3.0).assertEqual(ret);
})
done();
})
})
/**
* @tc.name get int callback interface test
......@@ -150,9 +150,9 @@ describe('storageTest', function () {
mPref.putSync(KEY_TEST_INT_ELEMENT, 3);
await mPref.get(KEY_TEST_INT_ELEMENT, 0.0, function (err, ret) {
expect(3).assertEqual(ret);
})
done();
})
})
/**
* @tc.name get long callback interface test
......@@ -165,8 +165,8 @@ describe('storageTest', function () {
expect(3).assertEqual(mPref.getSync(KEY_TEST_LONG_ELEMENT, 0));
await mPref.get(KEY_TEST_LONG_ELEMENT, 0, function (err, ret) {
expect(3).assertEqual(ret);
});
done();
});
})
/**
......@@ -180,8 +180,8 @@ describe('storageTest', function () {
mPref.flushSync();
await mPref.get(KEY_TEST_STRING_ELEMENT, "defaultvalue", function (err, ret) {
expect('test').assertEqual(ret);
});
done();
});
})
/**
......@@ -195,8 +195,8 @@ describe('storageTest', function () {
expect(true).assertEqual(mPref.getSync(KEY_TEST_BOOLEAN_ELEMENT, false));
mPref.flushSync();
expect(true).assertEqual(mPref.getSync(KEY_TEST_BOOLEAN_ELEMENT, false));
});
done();
});
})
/**
......@@ -210,8 +210,8 @@ describe('storageTest', function () {
expect(4.0).assertEqual(mPref.getSync(KEY_TEST_FLOAT_ELEMENT, 0.0));
mPref.flushSync();
expect(4.0).assertEqual(mPref.getSync(KEY_TEST_FLOAT_ELEMENT, 0.0));
});
done();
});
})
/**
......@@ -225,8 +225,8 @@ describe('storageTest', function () {
expect(4).assertEqual(mPref.getSync(KEY_TEST_INT_ELEMENT, 0));
mPref.flushSync();
expect(4).assertEqual(mPref.getSync(KEY_TEST_INT_ELEMENT, 0));
});
done();
});
})
/**
......@@ -241,8 +241,8 @@ describe('storageTest', function () {
expect(4).assertEqual(mPref.getSync(KEY_TEST_LONG_ELEMENT, 0));
mPref.flushSync();
expect(4).assertEqual(mPref.getSync(KEY_TEST_LONG_ELEMENT, 0));
});
done();
});
})
/**
......@@ -252,14 +252,12 @@ describe('storageTest', function () {
*/
it('testPutString0162', 0, async function (done) {
mPref.clearSync();
await mPref.put(KEY_TEST_STRING_ELEMENT, "abc", function (err, ret) {
mPref.put(KEY_TEST_STRING_ELEMENT, '', function (err, ret) {
await mPref.put(KEY_TEST_STRING_ELEMENT, '', function (err, ret) {
expect('').assertEqual(mPref.getSync(KEY_TEST_STRING_ELEMENT, "defaultvalue"));
mPref.flushSync();
expect('').assertEqual(mPref.getSync(KEY_TEST_STRING_ELEMENT, "defaultvalue"));
});
});
done();
});
})
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册