-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Conversation
* Now at 85% line coverage * 100% function coverage * Added unit tests for: * C_GetAttributeValue * PKCS11_PAL_DESTROY_OBJECT * C_Verify * C_GenerateKeyPair * C_GenerateRandom
pvPortMalloc_Stub( pvPkcs11MallocCb ); | ||
PKCS11_PAL_FindObject_IgnoreAndReturn( 2 ); | ||
PKCS11_PAL_GetObjectValue_IgnoreAndReturn( CKR_OK ); | ||
mbedtls_pk_parse_key_IgnoreAndReturn( 0 ); | ||
PKCS11_PAL_GetObjectValueCleanup_CMockIgnore(); | ||
pvPortMalloc_Stub( pvPkcs11MallocCb ); | ||
mbedtls_ecp_keypair_init_CMockIgnore(); | ||
mbedtls_ecp_group_init_CMockIgnore(); | ||
mbedtls_ecp_group_load_IgnoreAndReturn( 0 ); | ||
mbedtls_mpi_read_binary_IgnoreAndReturn( 0 ); | ||
pvPortMalloc_Stub( pvPkcs11MallocCb ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all the stubs are the same
pvPortMalloc_Stub( pvPkcs11MallocCb );
mbedtls_ecp_keypair_init_CMockIgnore(); | ||
mbedtls_ecp_group_init_CMockIgnore(); | ||
mbedtls_ecp_group_load_IgnoreAndReturn( 0 ); | ||
mbedtls_mpi_read_binary_IgnoreAndReturn( 0 ); | ||
pvPortMalloc_Stub( pvPkcs11MallocCb ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here too,
stubs can only be set at the beginning of the function , no need to redefine them before every function call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one should stay the same as I have different behavior in the malloc stub before this one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pvPortMalloc_IgnoreAndReturn( &xKeyContext ); Above this one injects a struct
TEST_ASSERT_EQUAL( CKR_OK, xResult ); | ||
|
||
xResult = prvOpenSession( &xSession ); | ||
TEST_ASSERT_EQUAL( CKR_OK, xResult ); | ||
|
||
mbedtls_pk_init_CMockIgnore(); | ||
pvPortMalloc_Stub( pvPkcs11MallocCb ); | ||
PKCS11_PAL_FindObject_IgnoreAndReturn( 1 ); | ||
PKCS11_PAL_GetObjectValue_IgnoreAndReturn( CKR_OK ); | ||
PKCS11_PAL_FindObject_IgnoreAndReturn( CK_INVALID_HANDLE ); | ||
mbedtls_pk_parse_public_key_IgnoreAndReturn( 0 ); | ||
PKCS11_PAL_GetObjectValueCleanup_CMockIgnore(); | ||
pvPortMalloc_Stub( pvPkcs11MallocCb ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just the multiple stubs within the same function
/bot run checks |
1 similar comment
/bot run checks |
Description
Checklist:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.