param_test.c 673 B

123456789101112131415161718192021
  1. #include "param_test.h"
  2. #include "esp_log.h"
  3. void test_serializer(const param_group_t *param_group, const ptest_func_t* test_func)
  4. {
  5. ESP_LOGI("test", "run test: %s", param_group->name);
  6. //in this test case, we want to make two devices as similar as possible, so use the same context
  7. void *context = NULL;
  8. test_func->pre_test(&context);
  9. void *pset = param_group->param_group;
  10. for (int i = param_group->pset_num; i >0; i--) {
  11. if (test_func->def_param) test_func->def_param(pset);
  12. test_func->loop(pset, context);
  13. pset+=param_group->pset_size;
  14. }
  15. test_func->post_test(context);
  16. free(context);
  17. context = NULL;
  18. }