1a8e1175bSopenharmony_ci/* 2a8e1175bSopenharmony_ci * Helper functions for tests that use any PSA API. 3a8e1175bSopenharmony_ci */ 4a8e1175bSopenharmony_ci/* 5a8e1175bSopenharmony_ci * Copyright The Mbed TLS Contributors 6a8e1175bSopenharmony_ci * SPDX-License-Identifier: Apache-2.0 7a8e1175bSopenharmony_ci * 8a8e1175bSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); you may 9a8e1175bSopenharmony_ci * not use this file except in compliance with the License. 10a8e1175bSopenharmony_ci * You may obtain a copy of the License at 11a8e1175bSopenharmony_ci * 12a8e1175bSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 13a8e1175bSopenharmony_ci * 14a8e1175bSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 15a8e1175bSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 16a8e1175bSopenharmony_ci * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17a8e1175bSopenharmony_ci * See the License for the specific language governing permissions and 18a8e1175bSopenharmony_ci * limitations under the License. 19a8e1175bSopenharmony_ci */ 20a8e1175bSopenharmony_ci 21a8e1175bSopenharmony_ci#ifndef PSA_HELPERS_H 22a8e1175bSopenharmony_ci#define PSA_HELPERS_H 23a8e1175bSopenharmony_ci 24a8e1175bSopenharmony_ci#if defined(MBEDTLS_PSA_CRYPTO_SPM) 25a8e1175bSopenharmony_ci#include "spm/psa_defs.h" 26a8e1175bSopenharmony_ci#endif 27a8e1175bSopenharmony_ci 28a8e1175bSopenharmony_ci/** Evaluate an expression and fail the test case if it returns an error. 29a8e1175bSopenharmony_ci * 30a8e1175bSopenharmony_ci * \param expr The expression to evaluate. This is typically a call 31a8e1175bSopenharmony_ci * to a \c psa_xxx function that returns a value of type 32a8e1175bSopenharmony_ci * #psa_status_t. 33a8e1175bSopenharmony_ci */ 34a8e1175bSopenharmony_ci#define PSA_ASSERT(expr) TEST_EQUAL((expr), PSA_SUCCESS) 35a8e1175bSopenharmony_ci 36a8e1175bSopenharmony_ci#endif /* PSA_HELPERS_H */ 37