system_doubles.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // SPDX-License-Identifier: GPL-3.0-or-later
  2. #include "test_exporting_engine.h"
  3. void __wrap_uv_thread_create(uv_thread_t thread, void (*worker)(void *arg), void *arg)
  4. {
  5. function_called();
  6. check_expected_ptr(thread);
  7. check_expected_ptr(worker);
  8. check_expected_ptr(arg);
  9. }
  10. void __wrap_uv_mutex_lock(uv_mutex_t *mutex)
  11. {
  12. (void)mutex;
  13. }
  14. void __wrap_uv_mutex_unlock(uv_mutex_t *mutex)
  15. {
  16. (void)mutex;
  17. }
  18. void __wrap_uv_cond_signal(uv_cond_t *cond_var)
  19. {
  20. (void)cond_var;
  21. }
  22. void __wrap_uv_cond_wait(uv_cond_t *cond_var, uv_mutex_t *mutex)
  23. {
  24. (void)cond_var;
  25. (void)mutex;
  26. }
  27. ssize_t __wrap_recv(int sockfd, void *buf, size_t len, int flags)
  28. {
  29. function_called();
  30. check_expected(sockfd);
  31. check_expected_ptr(buf);
  32. check_expected(len);
  33. check_expected(flags);
  34. char *mock_string = "Test recv";
  35. strcpy(buf, mock_string);
  36. return strlen(mock_string);
  37. }
  38. ssize_t __wrap_send(int sockfd, const void *buf, size_t len, int flags)
  39. {
  40. function_called();
  41. check_expected(sockfd);
  42. check_expected_ptr(buf);
  43. check_expected_ptr(buf);
  44. check_expected(len);
  45. check_expected(flags);
  46. return strlen(buf);
  47. }