diff --git a/test/unittest/src/crypto_cmac_test.cpp b/test/unittest/src/crypto_cmac_test.cpp index 4df5204bb1ab198b4dd3af3d3a1ccc307acd97d1..3dead5e9ab561df89050e25429816185201aded6 100644 --- a/test/unittest/src/crypto_cmac_test.cpp +++ b/test/unittest/src/crypto_cmac_test.cpp @@ -130,8 +130,8 @@ HWTEST_F(CryptoCmacTest, CryptoCmacTest005, TestSize.Level0) ASSERT_EQ(ret, HCF_SUCCESS); EXPECT_NE(macObj, nullptr); // test api functions - const char *cipherName = macObj->getAlgoName(macObj); - int32_t cmpRes = strcmp(cipherName, "AES128"); + const char *algoName = macObj->getAlgoName(macObj); + int32_t cmpRes = strcmp(algoName, params.base.algName); EXPECT_EQ(cmpRes, HCF_SUCCESS); HcfObjDestroy(macObj); } diff --git a/test/unittest/src/crypto_mac_test.cpp b/test/unittest/src/crypto_mac_test.cpp index 0f6c439c776d1e213f51d6c396cc66527c4ebfa1..fa036aeba22a14c93adfca4561fa685ffbee7024 100644 --- a/test/unittest/src/crypto_mac_test.cpp +++ b/test/unittest/src/crypto_mac_test.cpp @@ -139,7 +139,7 @@ HWTEST_F(CryptoMacTest, CryptoFrameworkHmacAlgoNameTest001, TestSize.Level0) EXPECT_NE(macObj, nullptr); // test api functions const char *algoName = macObj->getAlgoName(macObj); - int32_t cmpRes = strcmp(algoName, "SHA1"); + int32_t cmpRes = strcmp(algoName, params.base.algName); EXPECT_EQ(cmpRes, HCF_SUCCESS); HcfObjDestroy(macObj); } diff --git a/test/unittest/src/crypto_sm3_mac_test.cpp b/test/unittest/src/crypto_sm3_mac_test.cpp index 522be4349cedae31c44d5c5fdcdcdac8f78c3712..a98b376763288437f29ddcbbd9f93034c3d6a0eb 100644 --- a/test/unittest/src/crypto_sm3_mac_test.cpp +++ b/test/unittest/src/crypto_sm3_mac_test.cpp @@ -131,7 +131,7 @@ HWTEST_F(CryptoSM3MacTest, CryptoFrameworkHmacSM3AlgoNameTest001, TestSize.Level EXPECT_NE(macObj, nullptr); // test api functions const char *algoName = macObj->getAlgoName(macObj); - int32_t cmpRes = strcmp(algoName, "SM3"); + int32_t cmpRes = strcmp(algoName, params.base.algName); EXPECT_EQ(cmpRes, HCF_SUCCESS); HcfObjDestroy(macObj); }