test_ipc.c 509 B

12345678910111213141516171819202122
  1. #include <stdio.h>
  2. #include "freertos/FreeRTOS.h"
  3. #include "freertos/task.h"
  4. #include "unity.h"
  5. #include "esp_ipc.h"
  6. #include "sdkconfig.h"
  7. #if !CONFIG_FREERTOS_UNICORE
  8. static void test_func_ipc_cb(void *arg)
  9. {
  10. vTaskDelay(50);
  11. int *val = (int *)arg;
  12. *val = 0xa5a5;
  13. }
  14. TEST_CASE("Test blocking IPC function call", "[ipc]")
  15. {
  16. int val = 0x5a5a;
  17. esp_ipc_call_blocking(!xPortGetCoreID(), test_func_ipc_cb, &val);
  18. TEST_ASSERT_EQUAL_HEX(val, 0xa5a5);
  19. }
  20. #endif /* !CONFIG_FREERTOS_UNICORE */