diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/include/tests/test.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/include/tests/test.h b/tests/include/tests/test.h index 4dc9988fde..ceb965462e 100644 --- a/tests/include/tests/test.h +++ b/tests/include/tests/test.h @@ -14,4 +14,18 @@ #include <setjmp.h> #include <cmocka.h> +/* + * Set symbol value and make it global. + */ +#define TEST_SYMBOL(symbol, address) asm(".set " #symbol ", " #address "\n\t.globl " #symbol) + +/* + * Define memory region for testing purpose. + * + * Create buffer with specified name and size. + * Create end symbol for it. + */ +#define TEST_REGION(region, size) uint8_t _##region[size]; \ + TEST_SYMBOL(_e##region, _##region + size) + #endif /* _TESTS_TEST_H */ |