提交 23974726 编写于 作者: O openharmony_ci 提交者: Gitee

!1285 【Distributeddatamgr】【Master】用例修改

Merge pull request !1285 from Maowen/master
...@@ -351,11 +351,13 @@ describe('storageTest', function () { ...@@ -351,11 +351,13 @@ describe('storageTest', function () {
* @tc.desc flush promise interface test * @tc.desc flush promise interface test
*/ */
it('testFlush00181', 0, async function (done) { it('testFlush00181', 0, async function (done) {
mPref.putSync(KEY_TEST_STRING_ELEMENT, "test"); mPref.clearSync();
const promise = mPref.flush(); mPref.putSync(KEY_TEST_STRING_ELEMENT, "abc");
const promise = mPref.put(KEY_TEST_STRING_ELEMENT, 'test');
promise.then((ret) => { promise.then((ret) => {
expect("test"). expect('test').assertEqual(mPref.getSync(KEY_TEST_STRING_ELEMENT, "defaultvalue"));
assertEqual(mPref.getSync(KEY_TEST_STRING_ELEMENT, "default")); mPref.flush();
expect('test').assertEqual(mPref.getSync(KEY_TEST_STRING_ELEMENT, "defaultvalue"));
}).catch((err) => { }).catch((err) => {
expect(null).assertFail(); expect(null).assertFail();
}); });
...@@ -368,8 +370,11 @@ describe('storageTest', function () { ...@@ -368,8 +370,11 @@ describe('storageTest', function () {
* @tc.number SUB_DDM_AppDataFWK_JSPreferences_Storage_0150 * @tc.number SUB_DDM_AppDataFWK_JSPreferences_Storage_0150
* @tc.desc const test * @tc.desc const test
*/ */
it('testConst001', 0, function () { it('testConst001', 0, function () {
expect("80").assertEqual(mPref.MAX_KEY_LENHTH); mPref = storage.getStorageSync(PATH);
expect("8192").assertEqual(mPref.MAX_VALUE_LENHTH); console.info("testConstKEY1 " + mPref.MAX_KEY_LENGTH)
console.info("testConstVALUE1 " + mPref.MAX_VALUE_LENGTH)
expect("80").assertEqual(mPref.MAX_KEY_LENGTH);
expect("8192").assertEqual(mPref.MAX_VALUE_LENGTH);
}) })
}) })
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册