For tests, rename TEST_CALLOC_OR_FAIL() to just TEST_CALLOC()

Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
This commit is contained in:
Tom Cosgrove
2023-07-21 11:31:13 +01:00
parent 412a813ad4
commit 05b2a87ea0
40 changed files with 339 additions and 339 deletions

View File

@@ -506,7 +506,7 @@ psa_status_t mbedtls_test_psa_key_agreement_with_self(
key_bits = psa_get_key_bits(&attributes);
public_key_type = PSA_KEY_TYPE_PUBLIC_KEY_OF_KEY_PAIR(private_key_type);
public_key_length = PSA_EXPORT_PUBLIC_KEY_OUTPUT_SIZE(public_key_type, key_bits);
TEST_CALLOC_OR_FAIL(public_key, public_key_length);
TEST_CALLOC(public_key, public_key_length);
PSA_ASSERT(psa_export_public_key(key, public_key, public_key_length,
&public_key_length));
@@ -548,7 +548,7 @@ psa_status_t mbedtls_test_psa_raw_key_agreement_with_self(
key_bits = psa_get_key_bits(&attributes);
public_key_type = PSA_KEY_TYPE_PUBLIC_KEY_OF_KEY_PAIR(private_key_type);
public_key_length = PSA_EXPORT_PUBLIC_KEY_OUTPUT_SIZE(public_key_type, key_bits);
TEST_CALLOC_OR_FAIL(public_key, public_key_length);
TEST_CALLOC(public_key, public_key_length);
PSA_ASSERT(psa_export_public_key(key,
public_key, public_key_length,
&public_key_length));
@@ -838,7 +838,7 @@ static int exercise_export_key(mbedtls_svc_key_id_t key,
exported_size = PSA_EXPORT_KEY_OUTPUT_SIZE(
psa_get_key_type(&attributes),
psa_get_key_bits(&attributes));
TEST_CALLOC_OR_FAIL(exported, exported_size);
TEST_CALLOC(exported, exported_size);
if ((usage & PSA_KEY_USAGE_EXPORT) == 0 &&
!PSA_KEY_TYPE_IS_PUBLIC_KEY(psa_get_key_type(&attributes))) {
@@ -881,7 +881,7 @@ static int exercise_export_public_key(mbedtls_svc_key_id_t key)
exported_size = PSA_EXPORT_KEY_OUTPUT_SIZE(
psa_get_key_type(&attributes),
psa_get_key_bits(&attributes));
TEST_CALLOC_OR_FAIL(exported, exported_size);
TEST_CALLOC(exported, exported_size);
TEST_EQUAL(psa_export_public_key(key, exported,
exported_size, &exported_length),
@@ -894,7 +894,7 @@ static int exercise_export_public_key(mbedtls_svc_key_id_t key)
psa_get_key_type(&attributes));
exported_size = PSA_EXPORT_PUBLIC_KEY_OUTPUT_SIZE(public_type,
psa_get_key_bits(&attributes));
TEST_CALLOC_OR_FAIL(exported, exported_size);
TEST_CALLOC(exported, exported_size);
PSA_ASSERT(psa_export_public_key(key,
exported, exported_size,

View File

@@ -91,7 +91,7 @@ void mbedtls_test_init_handshake_options(
opts->resize_buffers = 1;
#if defined(MBEDTLS_SSL_CACHE_C)
opts->cache = NULL;
TEST_CALLOC_OR_FAIL(opts->cache, 1);
TEST_CALLOC(opts->cache, 1);
mbedtls_ssl_cache_init(opts->cache);
#if defined(MBEDTLS_HAVE_TIME)
TEST_EQUAL(mbedtls_ssl_cache_get_timeout(opts->cache),
@@ -627,9 +627,9 @@ int mbedtls_test_ssl_endpoint_certificate_init(mbedtls_test_ssl_endpoint *ep,
}
cert = &(ep->cert);
TEST_CALLOC_OR_FAIL(cert->ca_cert, 1);
TEST_CALLOC_OR_FAIL(cert->cert, 1);
TEST_CALLOC_OR_FAIL(cert->pkey, 1);
TEST_CALLOC(cert->ca_cert, 1);
TEST_CALLOC(cert->cert, 1);
TEST_CALLOC(cert->pkey, 1);
mbedtls_x509_crt_init(cert->ca_cert);
mbedtls_x509_crt_init(cert->cert);