From e4513c2df45951012c4f3416658d46e503bb1883 Mon Sep 17 00:00:00 2001 From: li-li-wang Date: Sun, 6 Apr 2025 19:30:48 +0800 Subject: [PATCH] =?UTF-8?q?TDD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-li-wang --- .../test/unittest/src/sec_comp_kit_test.cpp | 1 - .../sa/test/unittest/src/sec_comp_perm_manager_test.cpp | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/frameworks/inner_api/security_component/test/unittest/src/sec_comp_kit_test.cpp b/frameworks/inner_api/security_component/test/unittest/src/sec_comp_kit_test.cpp index ea81088..cad834b 100644 --- a/frameworks/inner_api/security_component/test/unittest/src/sec_comp_kit_test.cpp +++ b/frameworks/inner_api/security_component/test/unittest/src/sec_comp_kit_test.cpp @@ -121,7 +121,6 @@ HWTEST_F(SecCompKitTest, ExceptCall001, TestSize.Level1) int32_t scId = -1; std::string jsonStr = jsonRes.dump(); ASSERT_NE(SC_OK, SecCompKit::RegisterSecurityComponent(LOCATION_COMPONENT, jsonStr, scId)); - ASSERT_EQ(-1, scId); ASSERT_NE(SC_OK, SecCompKit::UpdateSecurityComponent(scId, jsonStr)); struct SecCompClickEvent touch = { diff --git a/services/security_component_service/sa/test/unittest/src/sec_comp_perm_manager_test.cpp b/services/security_component_service/sa/test/unittest/src/sec_comp_perm_manager_test.cpp index bf2a052..5efee23 100644 --- a/services/security_component_service/sa/test/unittest/src/sec_comp_perm_manager_test.cpp +++ b/services/security_component_service/sa/test/unittest/src/sec_comp_perm_manager_test.cpp @@ -100,7 +100,12 @@ HWTEST_F(SecCompPermManagerTest, RevokeTempSavePermissionCount001, TestSize.Leve permMgr.applySaveCountMap_[id] = 1; permMgr.RevokeTempSavePermissionCount(static_cast(0)); - ASSERT_EQ(permMgr.applySaveCountMap_[id], 1); + permMgr.saveTaskDequeMap_[id].push_back("test"); + permMgr.RevokeTempSavePermissionCount(static_cast(0)); + + permMgr.secHandler_ = std::make_shared(nullptr); + permMgr.RevokeTempSavePermissionCount(static_cast(0)); + ASSERT_EQ(permMgr.applySaveCountMap_[id], 0); } /** -- Gitee