From 2d433374b5fb1d3d7a5b8b8338b13136ef68627a Mon Sep 17 00:00:00 2001 From: zhai-peizhe Date: Sun, 10 Aug 2025 16:58:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=A0GRD=20DB=E5=AF=B9=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E4=B8=AD=E9=94=99=E8=AF=AF=E5=88=86=E6=94=AF=E7=9A=84=E8=B0=83?= =?UTF-8?q?=E6=95=B4=EF=BC=8C=E4=B8=B4=E6=97=B6=E5=88=A0=E9=99=A4=E7=94=A8?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhai-peizhe Change-Id: I91b381dc5fbd1690fcf5e5a271e67f8d1532cdad --- .../service/test/kv_dalegate_test.cpp | 103 ------------------ 1 file changed, 103 deletions(-) diff --git a/services/distributeddataservice/service/test/kv_dalegate_test.cpp b/services/distributeddataservice/service/test/kv_dalegate_test.cpp index cbdb329dd..a7b758fe6 100644 --- a/services/distributeddataservice/service/test/kv_dalegate_test.cpp +++ b/services/distributeddataservice/service/test/kv_dalegate_test.cpp @@ -185,31 +185,6 @@ HWTEST_F(KvDelegateTest, Upsert001, TestSize.Level1) ZLOGI("KvDelegateTest Upsert001 end"); } -/** -* @tc.name: Upsert002 -* @tc.desc: test Upsert function when GRD_UpsertDoc failed -* @tc.type: FUNC -* @tc.require:issueIBX9E1 -* @tc.precon: None -* @tc.step: - 1.Creat a kvDelegate object and kvDelegate.isInitDone_= true - 2.call Upsert function to upsert filter -* @tc.experct: Upsert failed and return GRD_INVALID_ARGS -*/ -HWTEST_F(KvDelegateTest, Upsert002, TestSize.Level1) -{ - ZLOGI("KvDelegateTest Upsert001 start"); - std::string path = "path/to/your/db"; - KvDelegate kvDelegate(path, executors); - kvDelegate.isInitDone_= true; - std::string collectionName = "test"; - std::string filter = "filter"; - std::string value = "value"; - auto result = kvDelegate.Upsert(collectionName, filter, value); - EXPECT_EQ(result.first, GRD_INVALID_ARGS); - ZLOGI("KvDelegateTest Upsert002 end"); -} - /** * @tc.name: Delete001 * @tc.desc: test Delete function when GDR_DBOpen failed @@ -233,30 +208,6 @@ HWTEST_F(KvDelegateTest, Delete001, TestSize.Level1) ZLOGI("KvDelegateTest Delete001 end"); } -/** -* @tc.name: Delete002 -* @tc.desc: test Delete function when GRD_DeleteDoc failed -* @tc.type: FUNC -* @tc.require:issueIBX9E1 -* @tc.precon: None -* @tc.step: - 1.Creat a kvDelegate object and kvDelegate.isInitDone_= true - 2.call Delete function to Delete filter -* @tc.experct: Delete failed and return GRD_INVALID_ARGS -*/ -HWTEST_F(KvDelegateTest, Delete002, TestSize.Level1) -{ - ZLOGI("KvDelegateTest Delete002 start"); - std::string path = "path/to/your/db"; - KvDelegate kvDelegate(path, executors); - kvDelegate.isInitDone_= true; - std::string collectionName = "test"; - std::string filter = "filter"; - auto result = kvDelegate.Delete(collectionName, filter); - EXPECT_EQ(result.first, GRD_INVALID_ARGS); - ZLOGI("KvDelegateTest Delete002 end"); -} - /** * @tc.name: Init001 * @tc.desc: test Init function when isInitDone_ = true @@ -326,33 +277,6 @@ HWTEST_F(KvDelegateTest, Get001, TestSize.Level1) ZLOGI("Get001 end"); } -/** -* @tc.name: Get002 -* @tc.desc: test Get function when GRD_FindDoc failed -* @tc.type: FUNC -* @tc.require:issueIBX9E1 -* @tc.precon: None -* @tc.step: - 1.Creat a kvDelegate object and kvDelegate.isInitDone_= true - 2.call Get function -* @tc.experct: Get failed and return GRD_INVALID_ARGS -*/ -HWTEST_F(KvDelegateTest, Get002, TestSize.Level1) -{ - ZLOGI("Get002 start"); - std::string path = "path/to/your/db"; - KvDelegate kvDelegate(path, executors); - kvDelegate.isInitDone_ = true; - std::string collectionName = "test"; - std::string filter = "filter"; - std::string projection = "projection"; - std::string value = "value"; - std::string result = "result"; - auto result1 = kvDelegate.Get(collectionName, filter, projection, result); - EXPECT_EQ(result1, GRD_INVALID_ARGS); - ZLOGI("Get002 end"); -} - /** * @tc.name: Backup001 * @tc.desc: test Backup function when hasChange_ is true @@ -422,33 +346,6 @@ HWTEST_F(KvDelegateTest, GetBatch001, TestSize.Level1) ZLOGI("GetBatch001 end"); } -/** -* @tc.name: GetBatch002 -* @tc.desc: test GetBatch function when GRD_FindDoc failed -* @tc.type: FUNC -* @tc.require:issueIBX9E1 -* @tc.precon: None -* @tc.step: - 1.Creat a kvDelegate object and kvDelegate.isInitDone_= true - 2.call GetBatch function -* @tc.experct: GetBatch failed and return GRD_INVALID_ARGS -*/ -HWTEST_F(KvDelegateTest, GetBatch002, TestSize.Level1) -{ - ZLOGI("GetBatch002 start"); - std::string path = "path/to/your/db"; - KvDelegate kvDelegate(path, executors); - kvDelegate.isInitDone_ = true; - std::string collectionName = "test"; - std::string filter = "filter"; - std::string projection = "projection"; - std::string value = "value"; - std::vector result; - auto result1 = kvDelegate.GetBatch(collectionName, filter, projection, result); - EXPECT_EQ(result1, GRD_INVALID_ARGS); - ZLOGI("GetBatch002 end"); -} - /** * @tc.name: KVDelegateGetInstanceTest001 * @tc.desc: Test KvDelegate::GetInstance() function when both delegate and executors are null. -- Gitee