Merge pull request #7936 from AgathiyanB/assert-false-macro

Add TEST_FAIL macro for tests
This commit is contained in:
Tom Cosgrove 2023-08-10 15:01:34 +00:00 committed by GitHub
commit e7700a7d0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 33 additions and 23 deletions

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
TEST_ASSERT(!"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 {
TEST_ASSERT(!"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;
TEST_ASSERT(!"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 {
TEST_ASSERT(!"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

@ -1759,8 +1759,8 @@ static int check_ssl_version(
break;
default:
TEST_ASSERT(
!"Version check not implemented for this protocol version");
TEST_FAIL(
"Version check not implemented for this protocol version");
}
return 1;