Gilles Peskine | 3cff768 | 2019-06-20 12:54:43 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Helper functions for tests that use any PSA API. |
| 3 | */ |
Bence Szépkúti | 8697465 | 2020-06-15 11:59:37 +0200 | [diff] [blame] | 4 | /* |
Bence Szépkúti | 1e14827 | 2020-08-07 13:07:28 +0200 | [diff] [blame] | 5 | * Copyright The Mbed TLS Contributors |
Dave Rodgman | 16799db | 2023-11-02 19:47:20 +0000 | [diff] [blame] | 6 | * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later |
Gilles Peskine | 3cff768 | 2019-06-20 12:54:43 +0200 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #ifndef PSA_HELPERS_H |
| 10 | #define PSA_HELPERS_H |
| 11 | |
| 12 | #if defined(MBEDTLS_PSA_CRYPTO_SPM) |
| 13 | #include "spm/psa_defs.h" |
| 14 | #endif |
| 15 | |
| 16 | /** Evaluate an expression and fail the test case if it returns an error. |
| 17 | * |
| 18 | * \param expr The expression to evaluate. This is typically a call |
| 19 | * to a \c psa_xxx function that returns a value of type |
| 20 | * #psa_status_t. |
| 21 | */ |
Gilles Peskine | 449bd83 | 2023-01-11 14:50:10 +0100 | [diff] [blame] | 22 | #define PSA_ASSERT(expr) TEST_EQUAL((expr), PSA_SUCCESS) |
Gilles Peskine | 3cff768 | 2019-06-20 12:54:43 +0200 | [diff] [blame] | 23 | |
| 24 | #endif /* PSA_HELPERS_H */ |