Add testcase for psa_crypto_input_copy_free()

Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
David Horstmann 2023-11-07 17:30:25 +00:00
parent 4ac788573b
commit 4700144817
2 changed files with 27 additions and 0 deletions

View File

@ -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

View File

@ -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 */