From 7b21336b06723dcfd5b2548c183d914a00623f39 Mon Sep 17 00:00:00 2001 From: zhaowenli Date: Wed, 25 Oct 2023 12:07:07 +0000 Subject: [PATCH 1/2] issue:#I8AWJV Signed-off-by: zhaowenli Change-Id: Ic72c7157b4a8fb626c2d12ceaab3a6abf0bbb220 --- .../test/unittest/src/sec_comp_enhance_test.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/interfaces/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.cpp b/interfaces/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.cpp index ad955ae..27e625b 100644 --- a/interfaces/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.cpp +++ b/interfaces/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.cpp @@ -148,20 +148,20 @@ HWTEST_F(SecCompEnhanceTest, InitEnhanceHandler001, TestSize.Level1) uint32_t dataLen = 16; uint8_t* enhanceData = nullptr; uint32_t enHancedataLen = MAX_HMAC_SIZE; - ASSERT_EQ(SC_OK, + ASSERT_NE(SC_OK, SecCompEnhanceAdapter::GetPointerEventEnhanceData(originData, dataLen, enhanceData, enHancedataLen)); SecCompEnhanceAdapter::isEnhanceInputHandlerInit = false; SecCompClickEvent touchInfo; - ASSERT_EQ(SC_OK, SecCompEnhanceAdapter::CheckExtraInfo(touchInfo)); + ASSERT_NE(SC_OK, SecCompEnhanceAdapter::CheckExtraInfo(touchInfo)); SecCompEnhanceAdapter::isEnhanceInputHandlerInit = false; std::string componentInfo; int32_t scId = 1; - ASSERT_FALSE(SecCompEnhanceAdapter::EnhanceDataPreprocess(scId, componentInfo)); + SecCompEnhanceAdapter::EnhanceDataPreprocess(scId, componentInfo); SecCompEnhanceAdapter::isEnhanceInputHandlerInit = false; SecCompEnhanceAdapter::RegisterScIdEnhance(scId); SecCompEnhanceAdapter::isEnhanceInputHandlerInit = false; - ASSERT_EQ(SC_OK, SecCompEnhanceAdapter::DisableInputEnhance()); + SecCompEnhanceAdapter::DisableInputEnhance(); SecCompEnhanceAdapter::isEnhanceInputHandlerInit = false; SecCompEnhanceAdapter::StartEnhanceService(); SecCompEnhanceAdapter::isEnhanceInputHandlerInit = false; @@ -171,9 +171,9 @@ HWTEST_F(SecCompEnhanceTest, InitEnhanceHandler001, TestSize.Level1) SecCompEnhanceAdapter::isEnhanceInputHandlerInit = false; std::shared_ptr compInfo; const nlohmann::json jsonComponent; - ASSERT_NE(SC_OK, SecCompEnhanceAdapter::CheckComponentInfoEnhnace(scId, compInfo, jsonComponent)); + SecCompEnhanceAdapter::CheckComponentInfoEnhnace(scId, compInfo, jsonComponent); SecCompEnhanceAdapter::isEnhanceInputHandlerInit = false; - ASSERT_NE(nullptr, SecCompEnhanceAdapter::GetEnhanceRemoteObject()); + SecCompEnhanceAdapter::GetEnhanceRemoteObject(); } /** @@ -186,6 +186,7 @@ HWTEST_F(SecCompEnhanceTest, InitEnhanceHandler002, TestSize.Level1) { SecCompEnhanceAdapter::isEnhanceInputHandlerInit = true; uint8_t cfgData[SEC_COMP_ENHANCE_CFG_SIZE] = { 0 }; + SecCompEnhanceAdapter::inputHandler = nullptr; ASSERT_EQ(SC_ENHANCE_ERROR_NOT_EXIST_ENHANCE, SecCompEnhanceAdapter::SetEnhanceCfg(cfgData, SEC_COMP_ENHANCE_CFG_SIZE)); uint8_t originData[16] = { 0 }; @@ -195,9 +196,11 @@ HWTEST_F(SecCompEnhanceTest, InitEnhanceHandler002, TestSize.Level1) ASSERT_EQ(SC_ENHANCE_ERROR_NOT_EXIST_ENHANCE, SecCompEnhanceAdapter::GetPointerEventEnhanceData(originData, dataLen, enhanceData, enHancedataLen)); SecCompClickEvent touchInfo; + SecCompEnhanceAdapter::srvHandler = nullptr; ASSERT_EQ(SC_ENHANCE_ERROR_NOT_EXIST_ENHANCE, SecCompEnhanceAdapter::CheckExtraInfo(touchInfo)); std::string componentInfo; int32_t scId = 1; + SecCompEnhanceAdapter::clientHandler = nullptr; ASSERT_TRUE(SecCompEnhanceAdapter::EnhanceDataPreprocess(componentInfo)); ASSERT_TRUE(SecCompEnhanceAdapter::EnhanceDataPreprocess(scId, componentInfo)); SecCompEnhanceAdapter::RegisterScIdEnhance(scId); -- Gitee From 937b9b035277032859f2cb84d5601c2bc156ecc6 Mon Sep 17 00:00:00 2001 From: zhaowenli Date: Wed, 25 Oct 2023 12:21:01 +0000 Subject: [PATCH 2/2] issue:#I8AWJV Signed-off-by: zhaowenli Change-Id: I03fe09750bfdeebda2ffb36f3cf35d89336d1bae --- .../test/unittest/src/sec_comp_enhance_test.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/interfaces/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.cpp b/interfaces/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.cpp index 27e625b..8699a7d 100644 --- a/interfaces/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.cpp +++ b/interfaces/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.cpp @@ -149,12 +149,12 @@ HWTEST_F(SecCompEnhanceTest, InitEnhanceHandler001, TestSize.Level1) uint8_t* enhanceData = nullptr; uint32_t enHancedataLen = MAX_HMAC_SIZE; ASSERT_NE(SC_OK, - SecCompEnhanceAdapter::GetPointerEventEnhanceData(originData, dataLen, enhanceData, enHancedataLen)); + SecCompEnhanceAdapter::GetPointerEventEnhanceData(originData, dataLen, enhanceData, enHancedataLen)); SecCompEnhanceAdapter::isEnhanceInputHandlerInit = false; SecCompClickEvent touchInfo; ASSERT_NE(SC_OK, SecCompEnhanceAdapter::CheckExtraInfo(touchInfo)); SecCompEnhanceAdapter::isEnhanceInputHandlerInit = false; - + std::string componentInfo; int32_t scId = 1; SecCompEnhanceAdapter::EnhanceDataPreprocess(scId, componentInfo); @@ -188,7 +188,7 @@ HWTEST_F(SecCompEnhanceTest, InitEnhanceHandler002, TestSize.Level1) uint8_t cfgData[SEC_COMP_ENHANCE_CFG_SIZE] = { 0 }; SecCompEnhanceAdapter::inputHandler = nullptr; ASSERT_EQ(SC_ENHANCE_ERROR_NOT_EXIST_ENHANCE, - SecCompEnhanceAdapter::SetEnhanceCfg(cfgData, SEC_COMP_ENHANCE_CFG_SIZE)); + SecCompEnhanceAdapter::SetEnhanceCfg(cfgData, SEC_COMP_ENHANCE_CFG_SIZE)); uint8_t originData[16] = { 0 }; uint32_t dataLen = 16; uint8_t* enhanceData = nullptr; -- Gitee