From c5c6499420e647308d0dc338da73f2d17142d31e Mon Sep 17 00:00:00 2001 From: hhhFun Date: Sat, 14 Sep 2024 16:40:29 +0800 Subject: [PATCH] fix tdd error Signed-off-by: hhhFun --- .../src/crypto_dsa_asy_key_generator_by_spec_test.cpp | 2 +- test/unittest/src/crypto_signature_exception_test.cpp | 6 ++++-- test/unittest/src/crypto_sm4_cfb_cipher_test.cpp | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/unittest/src/crypto_dsa_asy_key_generator_by_spec_test.cpp b/test/unittest/src/crypto_dsa_asy_key_generator_by_spec_test.cpp index a85af2f..59b725f 100644 --- a/test/unittest/src/crypto_dsa_asy_key_generator_by_spec_test.cpp +++ b/test/unittest/src/crypto_dsa_asy_key_generator_by_spec_test.cpp @@ -308,7 +308,7 @@ HWTEST_F(CryptoDsaAsyKeyGeneratorBySpecTest, CryptoDsaAsyKeyGeneratorBySpecTest1 const char *className = generator->base.getClass(); HcfObjDestroy(generator); - ASSERT_EQ(&className, &g_asyKeyGeneratorBySpecClass); + ASSERT_EQ(strcmp(className, g_asyKeyGeneratorBySpecClass), 0); } HWTEST_F(CryptoDsaAsyKeyGeneratorBySpecTest, CryptoDsaAsyKeyGeneratorBySpecTest102, TestSize.Level0) diff --git a/test/unittest/src/crypto_signature_exception_test.cpp b/test/unittest/src/crypto_signature_exception_test.cpp index 81325a0..43a108d 100644 --- a/test/unittest/src/crypto_signature_exception_test.cpp +++ b/test/unittest/src/crypto_signature_exception_test.cpp @@ -252,7 +252,8 @@ HWTEST_F(CryptoSignatureExceptionTest, CryptoSignatureExceptionTest013, TestSize ASSERT_EQ(ret, HCF_INVALID_PARAMS); HcfSignSpi *returnObj = nullptr; - ret = HcfSignSpiRsaCreate((HcfSignatureParams *)&g_obj, &returnObj); + HcfSignatureParams obj = {}; + ret = HcfSignSpiRsaCreate((HcfSignatureParams *)&obj, &returnObj); ASSERT_EQ(ret, HCF_INVALID_PARAMS); } @@ -265,7 +266,8 @@ HWTEST_F(CryptoSignatureExceptionTest, CryptoSignatureExceptionTest014, TestSize ASSERT_EQ(ret, HCF_INVALID_PARAMS); HcfVerifySpi *returnObj = nullptr; - ret = HcfVerifySpiRsaCreate((HcfSignatureParams *)&g_obj, &returnObj); + HcfSignatureParams obj = {}; + ret = HcfVerifySpiRsaCreate((HcfSignatureParams *)&obj, &returnObj); ASSERT_EQ(ret, HCF_INVALID_PARAMS); } } \ No newline at end of file diff --git a/test/unittest/src/crypto_sm4_cfb_cipher_test.cpp b/test/unittest/src/crypto_sm4_cfb_cipher_test.cpp index d674789..342de19 100644 --- a/test/unittest/src/crypto_sm4_cfb_cipher_test.cpp +++ b/test/unittest/src/crypto_sm4_cfb_cipher_test.cpp @@ -718,7 +718,7 @@ HWTEST_F(CryptoSM4CfbCipherTest, CryptoAesCipherTest050, TestSize.Level0) int ret = 0; uint8_t aad[8] = {0}; uint8_t tag[12] = {0}; - uint8_t iv[7] = {0}; + uint8_t iv[16] = {0}; uint8_t cipherText[128] = {0}; int cipherTextLen = 128; -- Gitee