Move the PSA_ASSERT macro to the common helpers file

It's potentially useful in all PSA test suites, of which there are now
several.
This commit is contained in:
Gilles Peskine 2018-12-17 23:26:01 +01:00
parent f055ad7512
commit 0174be2c17
2 changed files with 8 additions and 2 deletions

View file

@ -90,6 +90,14 @@ typedef struct data_tag
} \
} while( 0 )
/** Evaluate an expression and fail the test case if it returns an error.
*
* \param expr The expression to evaluate. This is typically a call
* to a \c psa_xxx function that returns a value of type
* #psa_status_t.
*/
#define PSA_ASSERT( expr ) TEST_ASSERT( ( expr ) == PSA_SUCCESS )
/** Allocate memory dynamically and fail the test case if this fails.
*
* You must set \p pointer to \c NULL before calling this macro and

View file

@ -8,8 +8,6 @@
#include "psa_crypto_storage.h"
#define PSA_ASSERT( expr ) TEST_ASSERT( ( expr ) == PSA_SUCCESS )
typedef enum
{
CLOSE_BY_CLOSE,