blob: b61718939e768027223e19599bdf4c5ca0598d29 [file] [log] [blame]
Gilles Peskine3cff7682019-06-20 12:54:43 +02001/*
2 * Helper functions for tests that use any PSA API.
3 */
Bence Szépkúti86974652020-06-15 11:59:37 +02004/*
Bence Szépkúti1e148272020-08-07 13:07:28 +02005 * Copyright The Mbed TLS Contributors
Dave Rodgman16799db2023-11-02 19:47:20 +00006 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
Gilles Peskine3cff7682019-06-20 12:54:43 +02007 */
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 Peskine449bd832023-01-11 14:50:10 +010022#define PSA_ASSERT(expr) TEST_EQUAL((expr), PSA_SUCCESS)
Gilles Peskine3cff7682019-06-20 12:54:43 +020023
24#endif /* PSA_HELPERS_H */