Rename ASSERT_FALSE to TEST_FAIL

Signed-off-by: Agathiyan Bragadeesh <agathiyan.bragadeesh2@arm.com>
This commit is contained in:
Agathiyan Bragadeesh 2023-07-18 11:45:28 +01:00
parent ebb40bc336
commit dc28a5a105
10 changed files with 17 additions and 17 deletions

View File

@ -65,7 +65,7 @@
*
* \param MESSAGE The message to be outputed on assertion
*/
#define ASSERT_FALSE(MESSAGE) \
#define TEST_FAIL(MESSAGE) \
do { \
mbedtls_test_fail(MESSAGE, __LINE__, __FILE__); \
goto exit; \

View File

@ -309,7 +309,7 @@ static int exercise_signature_key(mbedtls_svc_key_id_t key,
hash_alg = KNOWN_SUPPORTED_HASH_ALG;
alg ^= PSA_ALG_ANY_HASH ^ hash_alg;
#else
ASSERT_FALSE("No hash algorithm for hash-and-sign testing");
TEST_FAIL("No hash algorithm for hash-and-sign testing");
#endif
}
@ -438,7 +438,7 @@ int mbedtls_test_psa_setup_key_derivation_wrap(
PSA_KEY_DERIVATION_INPUT_LABEL,
input2, input2_length));
} else {
ASSERT_FALSE("Key derivation algorithm not supported");
TEST_FAIL("Key derivation algorithm not supported");
}
if (capacity != SIZE_MAX) {
@ -798,7 +798,7 @@ int mbedtls_test_psa_exported_key_sanity_check(
PSA_EXPORT_PUBLIC_KEY_MAX_SIZE);
} else {
(void) exported;
ASSERT_FALSE("Sanity check not implemented for this key type");
TEST_FAIL("Sanity check not implemented for this key type");
}
#if defined(MBEDTLS_DES_C)
@ -943,7 +943,7 @@ int mbedtls_test_psa_exercise_key(mbedtls_svc_key_id_t key,
} else if (PSA_ALG_IS_KEY_AGREEMENT(alg)) {
ok = exercise_key_agreement_key(key, usage, alg);
} else {
ASSERT_FALSE("No code to exercise this category of algorithm");
TEST_FAIL("No code to exercise this category of algorithm");
}
ok = ok && exercise_export_key(key, usage);

View File

@ -1753,7 +1753,7 @@ static int check_ssl_version(
break;
default:
ASSERT_FALSE(
TEST_FAIL(
"Version check not implemented for this protocol version");
}

View File

@ -121,7 +121,7 @@ void mbedtls_byteswap(char *input_str, int size, char *expected_str)
r = MBEDTLS_BSWAP64(input);
break;
default:
ASSERT_FALSE("size must be 16, 32 or 64");
TEST_FAIL("size must be 16, 32 or 64");
}
TEST_EQUAL(r, expected);

View File

@ -316,7 +316,7 @@ void mbedtls_asn1_write_algorithm_identifier(data_t *oid,
buf_complete[data_len + 2] = (unsigned char) (expected_params_len >> 8);
buf_complete[data_len + 3] = (unsigned char) (expected_params_len);
} else {
ASSERT_FALSE("Bad test data: invalid length of ASN.1 element");
TEST_FAIL("Bad test data: invalid length of ASN.1 element");
}
unsigned char *p = buf_complete;
TEST_EQUAL(mbedtls_asn1_get_alg(&p, end_complete,

View File

@ -8780,7 +8780,7 @@ void derive_output(int alg_arg,
}
break;
default:
ASSERT_FALSE("default case not supported");
TEST_FAIL("default case not supported");
break;
}
break;
@ -8830,7 +8830,7 @@ void derive_output(int alg_arg,
key_agreement_peer_key->len), statuses[i]);
break;
default:
ASSERT_FALSE("default case not supported");
TEST_FAIL("default case not supported");
break;
}
@ -9822,7 +9822,7 @@ void persistent_key_load_key_from_storage(data_t *data,
break;
default:
ASSERT_FALSE("generation_method not implemented in test");
TEST_FAIL("generation_method not implemented in test");
break;
}
psa_reset_key_attributes(&attributes);

View File

@ -465,7 +465,7 @@ static int sanity_check_rsa_encryption_result(
TEST_EQUAL(buf[0], 0x00);
/* The rest is too hard to check */
} else {
ASSERT_FALSE("Encryption result sanity check not implemented for RSA algorithm");
TEST_FAIL("Encryption result sanity check not implemented for RSA algorithm");
}
#endif /* MBEDTLS_BIGNUM_C */
@ -2754,7 +2754,7 @@ void asymmetric_encrypt(int alg_arg,
{
(void) modulus;
(void) private_exponent;
ASSERT_FALSE("Encryption sanity checks not implemented for this key type");
TEST_FAIL("Encryption sanity checks not implemented for this key type");
}
}
}

View File

@ -1328,7 +1328,7 @@ void sign_verify(int flow,
key_management.p_export_public = ram_export_public;
break;
default:
ASSERT_FALSE("unsupported flow (should be SIGN_IN_xxx)");
TEST_FAIL("unsupported flow (should be SIGN_IN_xxx)");
break;
}
asymmetric.p_verify = ram_verify;

View File

@ -775,7 +775,7 @@ void invalid_handle(int handle_construction,
mbedtls_svc_key_id_make(0, PSA_KEY_ID_VENDOR_MAX + 1);
break;
default:
ASSERT_FALSE("unknown handle construction");
TEST_FAIL("unknown handle construction");
}
/* Attempt to use the invalid handle. */

View File

@ -275,14 +275,14 @@ void sha3_reuse(data_t *input1, data_t *hash1,
case 32: type1 = MBEDTLS_SHA3_256; break;
case 48: type1 = MBEDTLS_SHA3_384; break;
case 64: type1 = MBEDTLS_SHA3_512; break;
default: ASSERT_FALSE("hash1->len validity"); break;
default: TEST_FAIL("hash1->len validity"); break;
}
switch (hash2->len) {
case 28: type2 = MBEDTLS_SHA3_224; break;
case 32: type2 = MBEDTLS_SHA3_256; break;
case 48: type2 = MBEDTLS_SHA3_384; break;
case 64: type2 = MBEDTLS_SHA3_512; break;
default: ASSERT_FALSE("hash2->len validity"); break;
default: TEST_FAIL("hash2->len validity"); break;
}
/* Round 1 */