![]() |
TF-M Reference Manual
1.2.0
TrustedFirmware-M
|
#include "test_framework.h"
Go to the source code of this file.
Macros | |
#define | CONCAT_(x, y) x ## y |
#define | CONCAT(x, y) CONCAT_(x, y) |
#define | BUFFER_SIZE 24 |
#define | PADDING_SIZE 8 |
#define | HALF_PADDING_SIZE 4 |
#define | BUFFER_PLUS_PADDING_SIZE (BUFFER_SIZE + PADDING_SIZE) |
#define | BUFFER_PLUS_HALF_PADDING_SIZE (BUFFER_SIZE + HALF_PADDING_SIZE) |
#define | TFM_PS_TEST_PROTO(test_name) static void test_name(struct test_result_t *ret) |
Expands to the prototype of a test function. More... | |
#define | TFM_PS_TEST_NAME(test_num) CONCAT(tfm_ps_test_, test_num) |
Expands to the standard name of a test function. More... | |
#define | TFM_PS_TASK_NAME(test_num) CONCAT(TFM_PS_TEST_NAME(test_num), _task) |
Expands to the standard name of a task function. More... | |
#define | TFM_PS_TEST(test_num) TFM_PS_TEST_PROTO(TFM_PS_TEST_NAME(test_num)) |
Expands to a test function declaration. More... | |
#define | TFM_PS_TASK(test_num) TFM_PS_TEST_PROTO(TFM_PS_TASK_NAME(test_num)) |
Expands to a task function declaration. More... | |
#define | TFM_PS_NS_TEST(test_num, thread_name) |
Defines a single-threaded PS NS test function and declares the corresponding task function. More... | |
Typedefs | |
typedef void | test_func_t (struct test_result_t *ret) |
Functions | |
void | tfm_ps_run_test (const char *thread_name, struct test_result_t *ret, test_func_t *test_func) |
Executes the given test function from the specified thread context. More... | |
#define BUFFER_PLUS_HALF_PADDING_SIZE (BUFFER_SIZE + HALF_PADDING_SIZE) |
Definition at line 37 of file ns_test_helpers.h.
#define BUFFER_PLUS_PADDING_SIZE (BUFFER_SIZE + PADDING_SIZE) |
Definition at line 36 of file ns_test_helpers.h.
#define BUFFER_SIZE 24 |
Several tests use a buffer to read back data from an asset. This buffer is larger than the size of the asset data by PADDING_SIZE bytes. This allows us to ensure that the only the expected data is read back and that it is read back correctly.
For example if the buffer and asset are as follows: Buffer - "XXXXXXXXXXXX", Asset data - "AAAA"
Then a correct and successful read would give this result: "XXXXAAAAXXXX" (Assuming a PADDING_SIZE of 8)
Definition at line 32 of file ns_test_helpers.h.
#define CONCAT | ( | x, | |
y | |||
) | CONCAT_(x, y) |
Definition at line 18 of file ns_test_helpers.h.
#define CONCAT_ | ( | x, | |
y | |||
) | x ## y |
Definition at line 17 of file ns_test_helpers.h.
#define HALF_PADDING_SIZE 4 |
Definition at line 34 of file ns_test_helpers.h.
#define PADDING_SIZE 8 |
Definition at line 33 of file ns_test_helpers.h.
#define TFM_PS_NS_TEST | ( | test_num, | |
thread_name | |||
) |
Defines a single-threaded PS NS test function and declares the corresponding task function.
[in] | test_num | Identification number of the test |
[in] | thread_name | Name of the thread in which to run the test |
Definition at line 82 of file ns_test_helpers.h.
#define TFM_PS_TASK | ( | test_num | ) | TFM_PS_TEST_PROTO(TFM_PS_TASK_NAME(test_num)) |
Expands to a task function declaration.
[in] | test_num | Identification number of the task |
Definition at line 73 of file ns_test_helpers.h.
#define TFM_PS_TASK_NAME | ( | test_num | ) | CONCAT(TFM_PS_TEST_NAME(test_num), _task) |
Expands to the standard name of a task function.
[in] | test_num | Identification number of the task |
Definition at line 59 of file ns_test_helpers.h.
#define TFM_PS_TEST | ( | test_num | ) | TFM_PS_TEST_PROTO(TFM_PS_TEST_NAME(test_num)) |
Expands to a test function declaration.
[in] | test_num | Identification number of the test |
Definition at line 66 of file ns_test_helpers.h.
#define TFM_PS_TEST_NAME | ( | test_num | ) | CONCAT(tfm_ps_test_, test_num) |
Expands to the standard name of a test function.
[in] | test_num | Identification number of the test |
Definition at line 52 of file ns_test_helpers.h.
#define TFM_PS_TEST_PROTO | ( | test_name | ) | static void test_name(struct test_result_t *ret) |
Expands to the prototype of a test function.
[in] | test_name | Name of the test function |
Definition at line 44 of file ns_test_helpers.h.
typedef void test_func_t(struct test_result_t *ret) |
Definition at line 91 of file ns_test_helpers.h.
void tfm_ps_run_test | ( | const char * | thread_name, |
struct test_result_t * | ret, | ||
test_func_t * | test_func | ||
) |
Executes the given test function from the specified thread context.
[in] | thread_name | Name of the thread to be created for test |
[out] | ret | Result of the test |
[in] | test_func | Test function to be run in the new thread |
Definition at line 48 of file ns_test_helpers.c.