151#ifndef __VSF_TEST_H__
152# define __VSF_TEST_H__
154# if VSF_USE_TEST == ENABLED
159# ifndef VSF_TEST_CFG_LONGJMP
160# define VSF_TEST_CFG_LONGJMP ENABLED
164# ifndef VSF_TEST_CFG_INTERNAL_TIMEOUT_MS
165# define VSF_TEST_CFG_INTERNAL_TIMEOUT_MS 1000
169# ifndef VSF_TEST_CFG_EXTERNAL_TIMEOUT_MS
170# define VSF_TEST_CFG_EXTERNAL_TIMEOUT_MS 1500
174# ifndef VSF_TEST_CFG_USE_HAL_WDT
175# define VSF_TEST_CFG_USE_HAL_WDT DISABLED
179# ifndef VSF_TEST_CFG_USE_STDIO_DATA_SYNC
180# define VSF_TEST_CFG_USE_STDIO_DATA_SYNC DISABLED
189# define VSF_TEST_ASSERT(__t, __v) \
192 __vsf_test_longjmp(__t, VSF_TEST_RESULT_FAIL, __FILE__, \
193 __LINE__, __FUNCTION__, #__v); \
206# define VSF_TEST_ADD_EX(__FN, __CFG, __TYPE, ...) \
207 {.jmp_fn = __FN, .cfg_str = __CFG, .type = __TYPE, __VA_ARGS__}
217# define VSF_TEST_ADD_BOOL_FN(__FN, __CFG, ...) \
220 .type = VSF_TEST_TYPE_BOOL_FN, \
231# define VSF_TEST_ADD(__FN, __CFG, ...) \
234 .type = VSF_TEST_TYPE_LONGJMP_FN, \
426# if VSF_TEST_CFG_LONGJMP == ENABLED
498 const char *file_name,
uint32_t line,
499 const char *function_name,
500 const char *condition);
513 const char *file_name,
uint32_t line,
514 const char *function_name,
515 const char *additional_str);
struct ieee80211_ext_chansw_ie data
Definition ieee80211.h:80
unsigned uint32_t
Definition stdint.h:9
unsigned char uint8_t
Definition stdint.h:5
Definition vsf_test.h:368
vsf_test_bool_fn_t * b_fn
Definition vsf_test.h:373
uint8_t expect_wdt
Definition vsf_test.h:390
vsf_test_jmp_fn_t * jmp_fn
Definition vsf_test.h:378
uint8_t type
Definition vsf_test.h:386
char * cfg_str
Definition vsf_test.h:380
Definition vsf_test.h:315
char * request_str
Definition vsf_test.h:342
const char * file_name
Definition vsf_test.h:359
const char * function_name
Definition vsf_test.h:358
void(* sync)(vsf_test_data_t *data, vsf_test_data_cmd_t cmd)
Definition vsf_test.h:325
uint32_t line
Definition vsf_test.h:361
struct vsf_test_data_t::@106 error
void(* init)(vsf_test_data_t *data)
Definition vsf_test.h:319
uint32_t req_continue
Definition vsf_test.h:347
uint32_t status
Test status, vsf_test_status_t.
Definition vsf_test.h:337
uint32_t idx
Definition vsf_test.h:334
const char * condition
Definition vsf_test.h:360
uint32_t result
Definition vsf_test.h:353
Definition vsf_test.h:393
vsf_test_wdt_t external
Definition vsf_test.h:405
uint32_t offset
Definition vsf_test.h:433
vsf_test_data_t data
Definition vsf_test.h:424
vsf_test_reboot_t * internal
Use the chip's internal reset, possibly a hot reset.
Definition vsf_test.h:416
struct vsf_test_t::@110 reboot
struct vsf_test_t::@111 test_case
Information for each test.
struct vsf_test_t::@109 wdt
jmp_buf * jmp_buf
Definition vsf_test.h:427
uint32_t size
Definition vsf_test.h:432
vsf_test_reboot_t * external
Definition vsf_test.h:419
vsf_test_wdt_t internal
Definition vsf_test.h:401
vsf_test_case_t * array
Definition vsf_test.h:434
Definition vsf_test.h:273
uint32_t timeout_ms
Definition vsf_test.h:283
void(* feed)(vsf_test_wdt_t *wdt)
The feed function will be called once after each test is completed.
Definition vsf_test.h:279
void(* init)(vsf_test_wdt_t *wdt, uint32_t timeout_ms)
Definition vsf_test.h:277
void vsf_test_reboot_t(void)
Definition vsf_test.h:270
vsf_test_req_t
Definition vsf_test.h:244
@ VSF_TEST_REQ_NO_SUPPORT
Definition vsf_test.h:245
@ VSF_TEST_REQ_SUPPORT
Definition vsf_test.h:246
void vsf_test_reboot(vsf_test_t *test, vsf_test_result_t result, const char *file_name, uint32_t line, const char *function_name, const char *additional_str)
reboot, usually called inside an exception.
Definition vsf_test.c:108
void vsf_test_run_tests(vsf_test_t *test)
Run all tests. Should be called after all use cases have been initialized.
Definition vsf_test.c:138
void __vsf_test_longjmp(vsf_test_t *test, vsf_test_result_t result, const char *file_name, uint32_t line, const char *function_name, const char *condition)
rong jump. the user does not need to directly call this API
Definition vsf_test.c:92
vsf_test_data_cmd_t
Device commands during data synchronization.
Definition vsf_test.h:287
@ VSF_TEST_TESECASE_REQUEST_WRITE
Send test request information, requires an assist device response.
Definition vsf_test.h:299
@ VSF_TEST_TESTCASE_INDEX_READ
Reading the current index requires a response from the assist device.
Definition vsf_test.h:294
@ VSF_TEST_DONE
Definition vsf_test.h:308
@ VSF_TEST_TESTCASE_RESULT_WRITE
Definition vsf_test.h:303
@ VSF_TEST_STATUS_READ
Reading the current state requires a response from the assist device.
Definition vsf_test.h:289
@ VSF_TEST_STATUS_WRITE
Write current state, no assist device response required.
Definition vsf_test.h:291
@ VSF_TEST_TESTCASE_INDEX_WRITE
Write current index, no assist device response required.
Definition vsf_test.h:296
bool vsf_test_add(vsf_test_t *test, vsf_test_jmp_fn_t *jmp_fn, char *cfg)
Add to add a test case of VSF_TEST_TYPE_LONGJMP_FN type.
Definition vsf_test.c:64
void vsf_test_jmp_fn_t(void)
Definition vsf_test.h:366
vsf_test_result_t
Definition vsf_test.h:249
@ VSF_TEST_RESULT_ASSIST_FAIL
Definition vsf_test.h:256
@ VSF_TEST_RESULT_PASS
Definition vsf_test.h:250
@ VSF_TEST_RESULT_FAIL
Definition vsf_test.h:253
@ VSF_TEST_RESULT_ASSERT_FAIL
Definition vsf_test.h:254
@ VSF_TEST_RESULT_SKIP
Definition vsf_test.h:251
@ VSF_TEST_RESULT_WDT_FAIL
Definition vsf_test.h:255
@ VSF_TEST_RESULT_FAULT_HANDLER_FAIL
Definition vsf_test.h:257
@ VSF_TEST_RESULT_WDT_PASS
Definition vsf_test.h:252
bool vsf_test_bool_fn_t(void)
Definition vsf_test.h:365
bool vsf_test_add_ex(vsf_test_t *test, vsf_test_case_t *test_case)
Add to add a test case of any type.
Definition vsf_test.c:50
vsf_test_status_t
Definition vsf_test.h:239
@ VSF_TEST_STATUS_IDLE
Definition vsf_test.h:240
@ VSF_TEST_STATUS_RUNNING
Definition vsf_test.h:241
void vsf_test_init(vsf_test_t *test, vsf_test_case_t *tc_array, uint32_t array_size)
initialize vsf test
Definition vsf_test.c:32
bool vsf_test_add_bool_fn(vsf_test_t *test, vsf_test_bool_fn_t *b_fn, char *cfg)
Add to add a test case of VSF_TEST_TYPE_BOOL_FN type.
Definition vsf_test.c:79
vsf_test_type_t
Test the type of the function,.
Definition vsf_test.h:261
@ VSF_TEST_TYPE_LONGJMP_FN
Definition vsf_test.h:264
@ VSF_TEST_TYPE_BOOL_FN
Definition vsf_test.h:267