Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 1 | /* |
Jamie Fox | b93da8b | 2018-12-13 18:27:30 +0000 | [diff] [blame^] | 2 | * Copyright (c) 2017-2019, Arm Limited. All rights reserved. |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
Jamie Fox | b93da8b | 2018-12-13 18:27:30 +0000 | [diff] [blame^] | 8 | #ifndef __TEST_FRAMEWORK_HELPERS_H__ |
| 9 | #define __TEST_FRAMEWORK_HELPERS_H__ |
| 10 | |
| 11 | #include <stdint.h> |
| 12 | #include "psa_protected_storage.h" |
| 13 | #include "test_framework.h" |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 14 | |
| 15 | #ifdef __cplusplus |
| 16 | extern "C" { |
| 17 | #endif |
| 18 | |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 19 | enum serial_color_t { |
| 20 | BLACK = 0, |
| 21 | RED = 1, |
| 22 | GREEN = 2, |
| 23 | YELLOW = 3, |
| 24 | BLUE = 4, |
| 25 | MAGENDA = 5, |
| 26 | CYAN = 6, |
| 27 | WHITE = 7, |
| 28 | }; |
| 29 | |
| 30 | /** |
Jamie Fox | b93da8b | 2018-12-13 18:27:30 +0000 | [diff] [blame^] | 31 | * \brief Translates psa_ps_status_t into a string. |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 32 | * |
Jamie Fox | b93da8b | 2018-12-13 18:27:30 +0000 | [diff] [blame^] | 33 | * \param[in] err psa_ps_status_t status value. |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 34 | * |
Jamie Fox | b93da8b | 2018-12-13 18:27:30 +0000 | [diff] [blame^] | 35 | * \return psa_ps_status_t as string. |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 36 | */ |
Jamie Fox | b93da8b | 2018-12-13 18:27:30 +0000 | [diff] [blame^] | 37 | const char *psa_ps_status_to_str(psa_ps_status_t status); |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 38 | |
| 39 | /** |
| 40 | * \brief Translates asset permissions into a string. |
| 41 | * |
| 42 | * \param[in] permissions Asset permissions value. |
| 43 | * |
| 44 | * \return asset permissions as string. |
| 45 | */ |
| 46 | const char *asset_perms_to_str(uint8_t permissions); |
| 47 | |
| 48 | /** |
| 49 | * \brief Sets the the text color in the serial port. |
| 50 | * |
| 51 | * \param[in] color_id Serial foreground color. |
| 52 | * |
| 53 | * \return 0 if the message is send successfully, 1 otherwise. |
| 54 | */ |
| 55 | void printf_set_color(enum serial_color_t color_id); |
| 56 | |
| 57 | #ifdef __cplusplus |
| 58 | } |
| 59 | #endif |
| 60 | |
Jamie Fox | b93da8b | 2018-12-13 18:27:30 +0000 | [diff] [blame^] | 61 | #endif /* __TEST_FRAMEWORK_HELPERS_H__ */ |