diff --git a/services/sandbox_manager/test/unittest/media_path_mock_test.cpp b/services/sandbox_manager/test/unittest/media_path_mock_test.cpp index ac2dd028e612e0c71ae9a4c25cbf10170ef0bd8f..b635ed80a6ac8779ef1a87b06886efee4aa153d8 100644 --- a/services/sandbox_manager/test/unittest/media_path_mock_test.cpp +++ b/services/sandbox_manager/test/unittest/media_path_mock_test.cpp @@ -23,7 +23,6 @@ #include "accesstoken_kit.h" #include "generic_values.h" #include "hap_token_info.h" -#include "mac_adapter.h" #include "policy_field_const.h" #include "policy_info.h" #define private public @@ -69,7 +68,13 @@ void MediaPathMockTest::SetUp(void) } void MediaPathMockTest::TearDown(void) -{} +{ + if (PolicyInfoManager::GetInstance().macAdapter_.fd_ > 0) { + close(PolicyInfoManager::GetInstance().macAdapter_.fd_); + PolicyInfoManager::GetInstance().macAdapter_.fd_ = -1; + PolicyInfoManager::GetInstance().macAdapter_.isMacSupport_ = false; + } +} #ifdef DEC_ENABLED /** diff --git a/services/sandbox_manager/test/unittest/policy_info_manager_test.cpp b/services/sandbox_manager/test/unittest/policy_info_manager_test.cpp index 35c27a49cbd37b9116b669798accb0f4cedb932b..7eca626b76d12da517c41df3118e19228cb9134b 100644 --- a/services/sandbox_manager/test/unittest/policy_info_manager_test.cpp +++ b/services/sandbox_manager/test/unittest/policy_info_manager_test.cpp @@ -23,7 +23,6 @@ #include "accesstoken_kit.h" #include "generic_values.h" #include "hap_token_info.h" -#include "mac_adapter.h" #include "policy_field_const.h" #include "policy_info.h" #define private public @@ -73,7 +72,13 @@ void PolicyInfoManagerTest::SetUp(void) } void PolicyInfoManagerTest::TearDown(void) -{} +{ + if (PolicyInfoManager::GetInstance().macAdapter_.fd_ > 0) { + close(PolicyInfoManager::GetInstance().macAdapter_.fd_); + PolicyInfoManager::GetInstance().macAdapter_.fd_ = -1; + PolicyInfoManager::GetInstance().macAdapter_.isMacSupport_ = false; + } +} void PrintDbRecords() {