|
VSF Documented
|
#include <vsf_test.h>
Data Fields | ||
| union { | ||
| vsf_test_bool_fn_t * b_fn | ||
| vsf_test_jmp_fn_t * jmp_fn | ||
| }; | ||
| char * | cfg_str | |
| uint8_t | type | |
| uint8_t | expect_wdt | |
| uint8_t | expect_assert | |
| vsf_test_bool_fn_t* vsf_test_case_t::b_fn |
The test function uses Boolean return value of function that returns true for a successful test and false for a failed test. You cannot use VSF_TEST_ASSERT inside this function.
| vsf_test_jmp_fn_t* vsf_test_case_t::jmp_fn |
Test functions that use no return value use VSF_TEST_ASSERT to assert failure. Inside a function, if it is not asserted, the test succeeds
| union { ... } vsf_test_case_t |
| char* vsf_test_case_t::cfg_str |
| uint8_t vsf_test_case_t::type |
Use different test function prototypes depending on the type. vsf_test_type_t VSF_TEST_TYPE_BOOL_FN: use b_fn VSF_TEST_TYPE_LONGJMP_FN : use jmp_fn
| uint8_t vsf_test_case_t::expect_wdt |
If the result of the test is expected to be a watchdog reset. Then set this variable to one
| uint8_t vsf_test_case_t::expect_assert |
If the test is expected to trigger an assertion (e.g., null pointer check), then set this variable to one. When an assertion is triggered, the test will be considered as PASS instead of FAIL.