diff --git a/tests/suites/test_suite_psa_crypto.function b/tests/suites/test_suite_psa_crypto.function index c194a074e..f8c9c7492 100644 --- a/tests/suites/test_suite_psa_crypto.function +++ b/tests/suites/test_suite_psa_crypto.function @@ -407,7 +407,6 @@ static psa_status_t key_agreement_with_self( psa_crypto_generator_t *generator, public_key_type = PSA_KEY_TYPE_PUBLIC_KEY_OF_KEYPAIR( private_key_type ); public_key_length = PSA_KEY_EXPORT_MAX_SIZE( public_key_type, key_bits ); ASSERT_ALLOC( public_key, public_key_length ); - TEST_ASSERT( public_key != NULL ); PSA_ASSERT( psa_export_public_key( handle, public_key, public_key_length, &public_key_length ) ); diff --git a/tests/suites/test_suite_psa_crypto_storage_file.function b/tests/suites/test_suite_psa_crypto_storage_file.function index bf86ebb4d..e596be1d7 100644 --- a/tests/suites/test_suite_psa_crypto_storage_file.function +++ b/tests/suites/test_suite_psa_crypto_storage_file.function @@ -36,8 +36,7 @@ void load_data_from_file( int id_to_load_arg, } /* Read from the file with psa_crypto_storage_load. */ - loaded_data = mbedtls_calloc( 1, capacity ); - TEST_ASSERT( loaded_data != NULL ); + ASSERT_ALLOC( loaded_data, capacity ); status = psa_crypto_storage_load( id_to_load, loaded_data, file_size ); /* Check we get the expected status. */ @@ -82,8 +81,7 @@ void write_data_to_file( data_t *data, int expected_status ) TEST_EQUAL( file_size, data->len ); /* Check that the file contents are what we expect */ - loaded_data = mbedtls_calloc( 1, data->len ); - TEST_ASSERT( loaded_data != NULL ); + ASSERT_ALLOC( loaded_data, data->len ); num_read = fread( loaded_data, 1, file_size, file ); TEST_EQUAL( num_read, file_size );