From 46322242d4996a93b83dff90a4582e020f7d80a5 Mon Sep 17 00:00:00 2001 From: fundavid Date: Tue, 27 Aug 2024 10:54:37 +0800 Subject: [PATCH] make CheckEfuseStatus static Signed-off-by: fundavid --- services/key_enable/utils/include/key_utils.h | 1 - .../key_enable/utils/src/devices_security.cpp | 2 +- test/unittest/key_enable_utils_test.cpp | 30 ------------------- 3 files changed, 1 insertion(+), 32 deletions(-) diff --git a/services/key_enable/utils/include/key_utils.h b/services/key_enable/utils/include/key_utils.h index 7044124..7ba018c 100644 --- a/services/key_enable/utils/include/key_utils.h +++ b/services/key_enable/utils/include/key_utils.h @@ -41,7 +41,6 @@ KeySerial KeyctlRestrictKeyring( const char *restriction); bool IsRdDevice(); -int32_t CheckEfuseStatus(char *buf, ssize_t bunLen); #ifdef __cplusplus } #endif diff --git a/services/key_enable/utils/src/devices_security.cpp b/services/key_enable/utils/src/devices_security.cpp index a1cd19e..3ccca6e 100644 --- a/services/key_enable/utils/src/devices_security.cpp +++ b/services/key_enable/utils/src/devices_security.cpp @@ -48,7 +48,7 @@ static bool CheckDeviceMode(char *buf, ssize_t bunLen) return false; } -int32_t CheckEfuseStatus(char *buf, ssize_t bunLen) +static int32_t CheckEfuseStatus(char *buf, ssize_t bunLen) { if (strstr(buf, "efuse_status=1")) { LOG_DEBUG(LABEL, "device is not efused"); diff --git a/test/unittest/key_enable_utils_test.cpp b/test/unittest/key_enable_utils_test.cpp index e10f744..656863e 100644 --- a/test/unittest/key_enable_utils_test.cpp +++ b/test/unittest/key_enable_utils_test.cpp @@ -46,36 +46,6 @@ HWTEST_F(KeyEnableUtilsTest, KeyEnableUtilsTest_0001, TestSize.Level0) { EXPECT_EQ(IsRdDevice(), true); } - -/** - * @tc.name: KeyEnableUtilsTest_0002 - * @tc.desc: check efuse status - * @tc.type: Func - * @tc.require: issueI8FCGF - */ -HWTEST_F(KeyEnableUtilsTest, KeyEnableUtilsTest_0002, TestSize.Level0) -{ - std::string str = "efuse_status=0"; - char *buf = const_cast(str.c_str()); - ssize_t bunLen = 0; - int32_t ret = CheckEfuseStatus(buf, bunLen); - EXPECT_EQ(ret, false); -} - -/** - * @tc.name: KeyEnableUtilsTest_0003 - * @tc.desc: check efuse status - * @tc.type: Func - * @tc.require: issueI8FCGF - */ -HWTEST_F(KeyEnableUtilsTest, KeyEnableUtilsTest_0003, TestSize.Level0) -{ - std::string str = "efuse_status=1"; - char *buf = const_cast(str.c_str()); - ssize_t bunLen = 0; - int32_t ret = CheckEfuseStatus(buf, bunLen); - EXPECT_EQ(ret, true); -} } // namespace CodeSign } // namespace Security } // namespace OHOS -- Gitee