diff --git a/frameworks/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.cpp b/frameworks/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.cpp index e44993e4c27ce7cabe346658c05581a2c0d9b183..16135acf9bed2fea4552e5378906e0bd04e1654a 100644 --- a/frameworks/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.cpp +++ b/frameworks/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.cpp @@ -95,6 +95,7 @@ HWTEST_F(SecCompEnhanceTest, GetPoniterEventEnhanceData001, TestSize.Level0) uint8_t* enhanceData = nullptr; uint32_t enHancedataLen = MAX_HMAC_SIZE; + InitSecCompClientEnhance(); int32_t result = SecCompEnhanceKit::GetPointerEventEnhanceData(originData, dataLen, enhanceData, enHancedataLen); if (g_inputEnhanceExist) { EXPECT_EQ(result, SC_SERVICE_ERROR_SERVICE_NOT_EXIST); diff --git a/frameworks/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.h b/frameworks/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.h index deff0d4a99042f8654e3de4608a7f275ca6fe842..8f69a5ba334186601104102378c492a1dd6448bc 100644 --- a/frameworks/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.h +++ b/frameworks/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.h @@ -19,6 +19,8 @@ #include "sec_comp_enhance_adapter.h" #include "sec_comp_enhance_kit.h" +extern "C" __attribute__((visibility("default"))) void InitSecCompClientEnhance(); + namespace OHOS { namespace Security { namespace SecurityComponent { diff --git a/frameworks/inner_api/security_component/test/unittest/src/location_button_test.cpp b/frameworks/inner_api/security_component/test/unittest/src/location_button_test.cpp index ee2033ec7b591ca82024cbf2aa80a039bb91fa47..7c0dadf76b3addb7104b34a2fb3c6ee07d566076 100644 --- a/frameworks/inner_api/security_component/test/unittest/src/location_button_test.cpp +++ b/frameworks/inner_api/security_component/test/unittest/src/location_button_test.cpp @@ -780,3 +780,18 @@ HWTEST_F(LocationButtonTest, CompareLocationButton003, TestSize.Level1) EXPECT_TRUE(button1.FromJson(jsonComponent, message, isClicked)); EXPECT_FALSE(button1.CompareComponentBasicInfo(&button2, false)); } + +/** + * @tc.name: IsCorrespondenceType001 + * @tc.desc: Test IsCorrespondenceType + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(LocationButtonTest, IsCorrespondenceType001, TestSize.Level1) +{ + LocationButton button; + button.type_ = LOCATION_COMPONENT; + EXPECT_TRUE(button.IsCorrespondenceType()); + button.type_ = SAVE_COMPONENT; + EXPECT_FALSE(button.IsCorrespondenceType()); +} diff --git a/frameworks/inner_api/security_component/test/unittest/src/paste_button_test.cpp b/frameworks/inner_api/security_component/test/unittest/src/paste_button_test.cpp index 389d8faef79e09ccc16fc205bccff80f801675ee..217bf3e4b8416faa0aea1953bf6ffee1afaa3575 100644 --- a/frameworks/inner_api/security_component/test/unittest/src/paste_button_test.cpp +++ b/frameworks/inner_api/security_component/test/unittest/src/paste_button_test.cpp @@ -171,3 +171,18 @@ HWTEST_F(PasteButtonTest, ComparePasteButton003, TestSize.Level0) ASSERT_TRUE(button1.FromJson(jsonComponent, message, isClicked)); ASSERT_FALSE(button1.CompareComponentBasicInfo(&button2, true)); } + +/** + * @tc.name: IsCorrespondenceType001 + * @tc.desc: Test IsCorrespondenceType + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(PasteButtonTest, IsCorrespondenceType001, TestSize.Level1) +{ + PasteButton button; + button.type_ = PASTE_COMPONENT; + EXPECT_TRUE(button.IsCorrespondenceType()); + button.type_ = LOCATION_COMPONENT; + EXPECT_FALSE(button.IsCorrespondenceType()); +} diff --git a/frameworks/inner_api/security_component/test/unittest/src/save_button_test.cpp b/frameworks/inner_api/security_component/test/unittest/src/save_button_test.cpp index 29a38346b1137e2a538514e787db47fe05df9f8e..23edb3e8962e9e491cce94b7a092915448cd47a4 100644 --- a/frameworks/inner_api/security_component/test/unittest/src/save_button_test.cpp +++ b/frameworks/inner_api/security_component/test/unittest/src/save_button_test.cpp @@ -175,3 +175,18 @@ HWTEST_F(SaveButtonTest, CompareSaveButton003, TestSize.Level0) ASSERT_TRUE(button1.FromJson(jsonComponent, message, isClicked)); ASSERT_FALSE(button1.CompareComponentBasicInfo(&button2, true)); } + +/** + * @tc.name: IsCorrespondenceType001 + * @tc.desc: Test IsCorrespondenceType + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(SaveButtonTest, IsCorrespondenceType001, TestSize.Level1) +{ + SaveButton button; + button.type_ = SAVE_COMPONENT; + EXPECT_TRUE(button.IsCorrespondenceType()); + button.type_ = PASTE_COMPONENT; + EXPECT_FALSE(button.IsCorrespondenceType()); +} 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 ab248abce75d41143f704f427053dde73e454272..8f5f57fff518f0b26990336777ea825678edb56f 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 @@ -263,3 +263,26 @@ HWTEST_F(SecCompKitTest, HasCustomPermissionForSecComp001, TestSize.Level0) { EXPECT_EQ(false, SecCompKit::HasCustomPermissionForSecComp()); } + +/** + * @tc.name: PreRegisterSecCompProcess001 + * @tc.desc: Test PreRegisterSecCompProcess. + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(SecCompKitTest, PreRegisterSecCompProcess001, TestSize.Level0) +{ + EXPECT_NE(SC_OK, SecCompKit::PreRegisterSecCompProcess()); +} + +/** + * @tc.name: LoadService001 + * @tc.desc: Test LoadService. + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(SecCompKitTest, LoadService001, TestSize.Level0) +{ + EXPECT_EQ(true, SecCompKit::LoadService()); + EXPECT_EQ(true, SecCompKit::IsServiceExist()); +}