From 5cd5cbb8092f2ae33a7bcc0737df720fbfe9f7dd Mon Sep 17 00:00:00 2001 From: gaohongliang410 Date: Sat, 18 Nov 2023 06:26:34 +0000 Subject: [PATCH 1/3] modify log Signed-off-by: gaohongliang410 --- frameworks/datatransmitmgr/dev_slinfo_adpt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frameworks/datatransmitmgr/dev_slinfo_adpt.c b/frameworks/datatransmitmgr/dev_slinfo_adpt.c index a7b4182..3106e8b 100644 --- a/frameworks/datatransmitmgr/dev_slinfo_adpt.c +++ b/frameworks/datatransmitmgr/dev_slinfo_adpt.c @@ -44,7 +44,7 @@ static int32_t DlopenSDK(void) { g_deviceSecLevelHandle = dlopen("libdslm_sdk.z.so", RTLD_LAZY | RTLD_NODELETE); if (g_deviceSecLevelHandle == NULL) { - DATA_SEC_LOG_ERROR("failed to load libdevicesecmgrsdktmp: %s", dlerror()); + DATA_SEC_LOG_ERROR("Failed to load libdevicesecmgrsdktmp: %s", dlerror()); return DEVSL_ERROR; } @@ -66,7 +66,7 @@ static int32_t InitDeviceSecEnv(void) if (requestDeviceSecurityInfo == NULL) { dlclose(g_deviceSecLevelHandle); g_deviceSecLevelHandle = NULL; - DATA_SEC_LOG_ERROR("failed to find symbol: %s", dlerror()); + DATA_SEC_LOG_ERROR("Failed to find symbol: %s", dlerror()); return DEVSL_ERROR; } FreeDeviceSecurityInfoFunction freeDeviceSecurityInfo = (FreeDeviceSecurityInfoFunction)dlsym( @@ -74,7 +74,7 @@ static int32_t InitDeviceSecEnv(void) if (freeDeviceSecurityInfo == NULL) { dlclose(g_deviceSecLevelHandle); g_deviceSecLevelHandle = NULL; - DATA_SEC_LOG_ERROR("failed to find symbol: %s", dlerror()); + DATA_SEC_LOG_ERROR("Failed to find symbol: %s", dlerror()); return DEVSL_ERROR; } GetDeviceSecurityLevelValueFunction getDeviceSecurityLevelValue = (GetDeviceSecurityLevelValueFunction)dlsym( @@ -82,7 +82,7 @@ static int32_t InitDeviceSecEnv(void) if (getDeviceSecurityLevelValue == NULL) { dlclose(g_deviceSecLevelHandle); g_deviceSecLevelHandle = NULL; - DATA_SEC_LOG_ERROR("failed to find symbol: %s", dlerror()); + DATA_SEC_LOG_ERROR("Failed to find symbol: %s", dlerror()); return DEVSL_ERROR; } RequestDeviceSecurityInfoAsyncFunction requestDeviceSecurityInfoAsync = @@ -90,7 +90,7 @@ static int32_t InitDeviceSecEnv(void) if (requestDeviceSecurityInfoAsync == NULL) { dlclose(g_deviceSecLevelHandle); g_deviceSecLevelHandle = NULL; - DATA_SEC_LOG_ERROR("failed to find symbol: %s", dlerror()); + DATA_SEC_LOG_ERROR("Failed to find symbol: %s", dlerror()); return DEVSL_ERROR; } (void)memset_s(&g_deviceSecEnv, sizeof(g_deviceSecEnv), 0, sizeof(g_deviceSecEnv)); -- Gitee From 04b573a9cc9aefc7f52f622bf4d060e5804fd9ce Mon Sep 17 00:00:00 2001 From: gaohongliang410 Date: Sat, 18 Nov 2023 06:49:57 +0000 Subject: [PATCH 2/3] modify tdd test Signed-off-by: gaohongliang410 --- test/unittest/datatransmitmgr/DevSLMgrTest.cpp | 14 -------------- test/unittest/datatransmitmgr/DevSLMgrTest.h | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/test/unittest/datatransmitmgr/DevSLMgrTest.cpp b/test/unittest/datatransmitmgr/DevSLMgrTest.cpp index 2e5fd64..9577001 100644 --- a/test/unittest/datatransmitmgr/DevSLMgrTest.cpp +++ b/test/unittest/datatransmitmgr/DevSLMgrTest.cpp @@ -17,7 +17,6 @@ #include #include #include -#include "gtest/gtest.h" #include "file_ex.h" #include "securec.h" #include "softbus_bus_center.h" @@ -28,19 +27,6 @@ #include "token_setproc.h" #include "accesstoken_kit.h" -using namespace testing::ext; -class DevSLMgrTest : public testing::Test { -public: - DevSLMgrTest(); - ~DevSLMgrTest(); - static void SetUpTestCase(); - static void TearDownTestCase(); - void SetUp() override; - void TearDown() override; -private: - static bool isEnforcing_; -}; - static const int32_t DEV_SEC_LEVEL_ERR = 100; static const int32_t LIST_LENGTH = 128; diff --git a/test/unittest/datatransmitmgr/DevSLMgrTest.h b/test/unittest/datatransmitmgr/DevSLMgrTest.h index 472e5d2..91c91d1 100644 --- a/test/unittest/datatransmitmgr/DevSLMgrTest.h +++ b/test/unittest/datatransmitmgr/DevSLMgrTest.h @@ -16,4 +16,21 @@ #ifndef DATASECURITYLEVEL_TEST_H #define DATASECURITYLEVEL_TEST_H +#include + +namespace OHOS { +namespace Security { +namespace DevSLMgrTest { +using namespace testing::ext; +class DevSLMgrTest : public testing::Test { +public: + static void SetUpTestCase(); + static void TearDownTestCase(); + void SetUp() override; + void TearDown() override; +}; +} // namespace DevSLMgrTest +} // namespace Security +} // namespace OHOS + #endif \ No newline at end of file -- Gitee From d83fe72376aa3400eff0e32706a80b5ff7ba9ac7 Mon Sep 17 00:00:00 2001 From: gaohongliang410 Date: Sat, 18 Nov 2023 06:51:33 +0000 Subject: [PATCH 3/3] modify tdd test Signed-off-by: gaohongliang410 --- test/unittest/datatransmitmgr/DevSLMgrTest.cpp | 14 ++++++++++++++ test/unittest/datatransmitmgr/DevSLMgrTest.h | 17 ----------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/test/unittest/datatransmitmgr/DevSLMgrTest.cpp b/test/unittest/datatransmitmgr/DevSLMgrTest.cpp index 9577001..2e5fd64 100644 --- a/test/unittest/datatransmitmgr/DevSLMgrTest.cpp +++ b/test/unittest/datatransmitmgr/DevSLMgrTest.cpp @@ -17,6 +17,7 @@ #include #include #include +#include "gtest/gtest.h" #include "file_ex.h" #include "securec.h" #include "softbus_bus_center.h" @@ -27,6 +28,19 @@ #include "token_setproc.h" #include "accesstoken_kit.h" +using namespace testing::ext; +class DevSLMgrTest : public testing::Test { +public: + DevSLMgrTest(); + ~DevSLMgrTest(); + static void SetUpTestCase(); + static void TearDownTestCase(); + void SetUp() override; + void TearDown() override; +private: + static bool isEnforcing_; +}; + static const int32_t DEV_SEC_LEVEL_ERR = 100; static const int32_t LIST_LENGTH = 128; diff --git a/test/unittest/datatransmitmgr/DevSLMgrTest.h b/test/unittest/datatransmitmgr/DevSLMgrTest.h index 91c91d1..472e5d2 100644 --- a/test/unittest/datatransmitmgr/DevSLMgrTest.h +++ b/test/unittest/datatransmitmgr/DevSLMgrTest.h @@ -16,21 +16,4 @@ #ifndef DATASECURITYLEVEL_TEST_H #define DATASECURITYLEVEL_TEST_H -#include - -namespace OHOS { -namespace Security { -namespace DevSLMgrTest { -using namespace testing::ext; -class DevSLMgrTest : public testing::Test { -public: - static void SetUpTestCase(); - static void TearDownTestCase(); - void SetUp() override; - void TearDown() override; -}; -} // namespace DevSLMgrTest -} // namespace Security -} // namespace OHOS - #endif \ No newline at end of file -- Gitee