mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-17 02:43:26 +00:00
Add testcase for psa_crypto_input_copy_free()
Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
parent
4ac788573b
commit
4700144817
@ -33,3 +33,9 @@ input_copy_alloc:200:PSA_SUCCESS
|
||||
|
||||
PSA crypto input copy alloc, NULL buffer
|
||||
input_copy_alloc:0:PSA_SUCCESS
|
||||
|
||||
PSA crypto input copy free
|
||||
input_copy_free:200
|
||||
|
||||
PSA crypto input copy free, NULL buffer
|
||||
input_copy_free:0
|
||||
|
@ -109,3 +109,24 @@ exit:
|
||||
mbedtls_free(input);
|
||||
}
|
||||
/* END_CASE */
|
||||
|
||||
/* BEGIN_CASE */
|
||||
void input_copy_free(int input_len)
|
||||
{
|
||||
psa_crypto_input_copy_t input_copy;
|
||||
|
||||
input_copy.buffer = NULL;
|
||||
input_copy.len = input_len;
|
||||
TEST_CALLOC(input_copy.buffer, input_copy.len);
|
||||
|
||||
psa_crypto_input_copy_free(&input_copy);
|
||||
|
||||
TEST_ASSERT(input_copy.buffer == NULL);
|
||||
TEST_EQUAL(input_copy.len, 0);
|
||||
|
||||
exit:
|
||||
mbedtls_free(input_copy.buffer);
|
||||
input_copy.buffer = NULL;
|
||||
input_copy.len = 0;
|
||||
}
|
||||
/* END_CASE */
|
||||
|
Loading…
x
Reference in New Issue
Block a user