From 8a7b56c8209bb5aa92968c8956e446c2b4387774 Mon Sep 17 00:00:00 2001 From: wangchen Date: Fri, 20 Jun 2025 10:43:24 +0800 Subject: [PATCH] =?UTF-8?q?fdsan=E6=B6=88=E9=99=A4=20close=20#ICGISK=20Sig?= =?UTF-8?q?ned-off-by:=20wangchen=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test/unittest/media_path_mock_test.cpp | 9 +++++++-- .../test/unittest/policy_info_manager_test.cpp | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) 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 ac2dd02..b635ed8 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 35c27a4..7eca626 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() { -- Gitee