From ed7e3fe4f8336aabc98965811575b6bc653c6b4f Mon Sep 17 00:00:00 2001 From: xsterling Date: Thu, 6 Jan 2022 23:22:11 +0800 Subject: [PATCH] testcase update. Signed-off-by: xsterling --- .../main/js/default/test/KvStoreResultSetJsunit.test.js | 3 ++- .../hap/src/main/js/default/test/SchemaJsunit.test.js | 8 ++++---- .../js/default/test/SingleKvStoreCallbackJsunit.test.js | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/distributeddatamgr/distributeddatamgrjstest/hap/src/main/js/default/test/KvStoreResultSetJsunit.test.js b/distributeddatamgr/distributeddatamgrjstest/hap/src/main/js/default/test/KvStoreResultSetJsunit.test.js index b7b863c25..38e887c31 100644 --- a/distributeddatamgr/distributeddatamgrjstest/hap/src/main/js/default/test/KvStoreResultSetJsunit.test.js +++ b/distributeddatamgr/distributeddatamgrjstest/hap/src/main/js/default/test/KvStoreResultSetJsunit.test.js @@ -13,7 +13,7 @@ * limitations under the License. */ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' -import factory from '@ohos.data.distributedData' +import factory from '@ohos.data.distributedData'; const TEST_BUNDLE_NAME = 'ohos.acts.distributeddatamgr'; const TEST_STORE_ID = 'storeId'; @@ -35,6 +35,7 @@ describe('KvStoreResultSetTest', function() { encrypt : false, backup : false, autoSync : true, + kvStoreType : factory.KVStoreType.SINGLE_VERSION, schema : '', securityLevel : factory.SecurityLevel.S2, diff --git a/distributeddatamgr/distributeddatamgrjstest/hap/src/main/js/default/test/SchemaJsunit.test.js b/distributeddatamgr/distributeddatamgrjstest/hap/src/main/js/default/test/SchemaJsunit.test.js index af901a6f1..39e46f65c 100644 --- a/distributeddatamgr/distributeddatamgrjstest/hap/src/main/js/default/test/SchemaJsunit.test.js +++ b/distributeddatamgr/distributeddatamgrjstest/hap/src/main/js/default/test/SchemaJsunit.test.js @@ -275,11 +275,11 @@ describe('SchemaTest', function() { let schema = new ddm.Schema(); schema.root.appendChild(english); - schema.indexes = []; // indexex set to empty array. - console.log("schema: " + schema.toJsonString()); - } catch (e) { - console.log("schema fail on exception: " + e); + console.log("schema without indexes: " + schema.toJsonString()); + schema.indexes = []; // indexex set to empty array -> invalid indexes. expect(null).assertFail(); + } catch (e) { + console.log("schema exception is ok: " + e); } done(); }) diff --git a/distributeddatamgr/distributeddatamgrjstest/hap/src/main/js/default/test/SingleKvStoreCallbackJsunit.test.js b/distributeddatamgr/distributeddatamgrjstest/hap/src/main/js/default/test/SingleKvStoreCallbackJsunit.test.js index 9f428a3df..cd9550b0f 100755 --- a/distributeddatamgr/distributeddatamgrjstest/hap/src/main/js/default/test/SingleKvStoreCallbackJsunit.test.js +++ b/distributeddatamgr/distributeddatamgrjstest/hap/src/main/js/default/test/SingleKvStoreCallbackJsunit.test.js @@ -832,8 +832,8 @@ describe('SingleKvStoreCallbackTest', function () { }catch(e) { console.log('testSingleKvStoreOnSyncComplete101 e' + e); expect(null).assertFail(); - done(); } + done(); }) /** -- GitLab