#include "test.h" static int identify_setup(struct et_test *test, void *work, int exi_channel) { int *pexi_channel = work; *pexi_channel = exi_channel; return 1; } static int identify_tick(struct et_test *test, void *work) { int exi_channel = *((int *)work); EXI_Lock(exi_channel, EXI_DEVICE_0, NULL); } static et_status identify_finish(struct et_test *test, void *work) { } static const char *identify_translate(struct et_test *test, char *out, size_t outbuf_sz, et_status status) { } #define DEF_TEST(_flags, _name, _work_t, _setup, _tick, _finish, ...) { \ .flags = _flags, \ .name = _name, \ .work_size = sizeof(_work_t), \ .setup_f = _setup, \ .tick_f = _tick, \ .finish_f = _finish, \ __VA_ARGS__ \ } #define msg_table priv_data[0] #define TEST_MSGS(_msg_table) .msg_table = _msg_table #define TEST_TRANSLATE_DEFAULT .trans_f = &et_translate_default, #define TEST_TRANSLATE(_t) .trans_f = _t, const struct et_test et_tests[] = { DEF_TEST(ET_TEST_ESSENTIAL, "Identify_Gecko", int, identify_setup, identify_tick, identify_finish, TEST_TRANSLATE(identify_translate)), }; const size_t et_ntests = sizeof(et_tests) / sizeof(et_tests[0]);