diff --git a/tests/suites/helpers.function b/tests/suites/helpers.function index 316c06e31..da843b2b3 100644 --- a/tests/suites/helpers.function +++ b/tests/suites/helpers.function @@ -90,13 +90,23 @@ typedef struct data_tag } \ } while( 0 ) +/** Evaluate two expressions and fail the test case if they have different + * values. + * + * \param expr1 An expression to evaluate. + * \param expr2 The expected value of \p expr1. This can be any + * expression, but it is typically a constant. + */ +#define TEST_EQUAL( expr1, expr2 ) \ + TEST_ASSERT( ( expr1 ) == ( expr2 ) ) + /** 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 ) +#define PSA_ASSERT( expr ) TEST_EQUAL( ( expr ), PSA_SUCCESS ) /** Allocate memory dynamically and fail the test case if this fails. *