From eb2eaa492b36806dfb5652aeb13d2fa9356741f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E4=BF=8A?= Date: Fri, 30 May 2025 14:43:50 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 邓俊 --- .../test/unittest/feature_stub_impl_test.cpp | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/services/distributeddataservice/app/test/unittest/feature_stub_impl_test.cpp b/services/distributeddataservice/app/test/unittest/feature_stub_impl_test.cpp index 909cd0fa5..c25ddd3fc 100644 --- a/services/distributeddataservice/app/test/unittest/feature_stub_impl_test.cpp +++ b/services/distributeddataservice/app/test/unittest/feature_stub_impl_test.cpp @@ -209,6 +209,46 @@ HWTEST_F(FeatureStubImplTest, OnAppExit002, TestSize.Level1) EXPECT_EQ(result, E_OK); } +/** +* @tc.name: OnFeatureExit001 +* @tc.desc: OnFeatureExit function test. +* @tc.type: FUNC +* @tc.require: +* @tc.author: SQL +*/ +HWTEST_F(FeatureStubImplTest, OnFeatureExit001, TestSize.Level1) +{ + std::shared_ptr feature = nullptr; + std::shared_ptr featureStubImpl = std::make_shared(feature); + pid_t uid = 0; + pid_t pid = 0; + uint32_t tokenId = 0; + std::string bundleName = "com.ohos.test"; + std::shared_ptr executor = std::make_shared(1, 0); + auto result = featureStubImpl->OnFeatureExit(uid, pid, tokenId, bundleName); + EXPECT_EQ(result, -1); +} + +/** +* @tc.name: OnFeatureExit001 +* @tc.desc: OnFeatureExit function test. +* @tc.type: FUNC +* @tc.require: +* @tc.author: SQL +*/ +HWTEST_F(FeatureStubImplTest, OnFeatureExit002, TestSize.Level1) +{ + std::shared_ptr feature = std::make_shared(); + std::shared_ptr featureStubImpl = std::make_shared(feature); + pid_t uid = 0; + pid_t pid = 0; + uint32_t tokenId = 0; + std::string bundleName = "com.ohos.test"; + std::shared_ptr executor = std::make_shared(1, 0); + auto result = featureStubImpl->OnFeatureExit(uid, pid, tokenId, bundleName); + EXPECT_EQ(result, E_OK); +} + /** * @tc.name: OnAppUninstall001 * @tc.desc: OnAppUninstall function test. -- Gitee From a40ca3afbbddccc06ed558cbf8857d8ed82153c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E4=BF=8A?= Date: Fri, 30 May 2025 17:22:45 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E6=A3=80=E8=A7=86?= =?UTF-8?q?=E6=84=8F=E8=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 邓俊 --- .../app/test/unittest/feature_stub_impl_test.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/services/distributeddataservice/app/test/unittest/feature_stub_impl_test.cpp b/services/distributeddataservice/app/test/unittest/feature_stub_impl_test.cpp index c25ddd3fc..7990046ab 100644 --- a/services/distributeddataservice/app/test/unittest/feature_stub_impl_test.cpp +++ b/services/distributeddataservice/app/test/unittest/feature_stub_impl_test.cpp @@ -184,7 +184,6 @@ HWTEST_F(FeatureStubImplTest, OnAppExit001, TestSize.Level1) pid_t pid = 0; uint32_t tokenId = 0; std::string bundleName = "com.ohos.test"; - std::shared_ptr executor = std::make_shared(1, 0); auto result = featureStubImpl->OnAppExit(uid, pid, tokenId, bundleName); EXPECT_EQ(result, -1); } @@ -204,7 +203,6 @@ HWTEST_F(FeatureStubImplTest, OnAppExit002, TestSize.Level1) pid_t pid = 0; uint32_t tokenId = 0; std::string bundleName = "com.ohos.test"; - std::shared_ptr executor = std::make_shared(1, 0); auto result = featureStubImpl->OnAppExit(uid, pid, tokenId, bundleName); EXPECT_EQ(result, E_OK); } @@ -214,7 +212,6 @@ HWTEST_F(FeatureStubImplTest, OnAppExit002, TestSize.Level1) * @tc.desc: OnFeatureExit function test. * @tc.type: FUNC * @tc.require: -* @tc.author: SQL */ HWTEST_F(FeatureStubImplTest, OnFeatureExit001, TestSize.Level1) { @@ -224,17 +221,15 @@ HWTEST_F(FeatureStubImplTest, OnFeatureExit001, TestSize.Level1) pid_t pid = 0; uint32_t tokenId = 0; std::string bundleName = "com.ohos.test"; - std::shared_ptr executor = std::make_shared(1, 0); auto result = featureStubImpl->OnFeatureExit(uid, pid, tokenId, bundleName); EXPECT_EQ(result, -1); } /** -* @tc.name: OnFeatureExit001 +* @tc.name: OnFeatureExit002 * @tc.desc: OnFeatureExit function test. * @tc.type: FUNC * @tc.require: -* @tc.author: SQL */ HWTEST_F(FeatureStubImplTest, OnFeatureExit002, TestSize.Level1) { @@ -244,7 +239,6 @@ HWTEST_F(FeatureStubImplTest, OnFeatureExit002, TestSize.Level1) pid_t pid = 0; uint32_t tokenId = 0; std::string bundleName = "com.ohos.test"; - std::shared_ptr executor = std::make_shared(1, 0); auto result = featureStubImpl->OnFeatureExit(uid, pid, tokenId, bundleName); EXPECT_EQ(result, E_OK); } -- Gitee