MockPosixSocket.hpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2022-12-09
  6. * Changed: 2022-12-25
  7. *
  8. * */
  9. #ifndef LS_STD_MOCK_POSIX_SOCKET_HPP
  10. #define LS_STD_MOCK_POSIX_SOCKET_HPP
  11. #include <ls_std/ls_std_common.hpp>
  12. #include <gmock/gmock.h>
  13. namespace ls_std_core_test
  14. {
  15. class MockPosixSocket : public ls::std::common::interface_type::IPosixSocket
  16. {
  17. public:
  18. MockPosixSocket() = default;
  19. ~MockPosixSocket() override = default;
  20. MOCK_METHOD(int, accept, (int _socketFileDescriptor, struct sockaddr *_address, socklen_t* _addressLength), (override));
  21. MOCK_METHOD(int, bind, (int _socketFileDescriptor, const struct sockaddr *_address, socklen_t _addressLength), (override));
  22. MOCK_METHOD(int, close, (int _socketFileDescriptor), (override));
  23. MOCK_METHOD(int, connect, (int _socketFileDescriptor, const struct sockaddr *_address, socklen_t _addressLength), (override));
  24. MOCK_METHOD(int, create, (int _domain, int _type, int _protocol), (override));
  25. MOCK_METHOD(int, listen, (int _socketFileDescriptor, int _backlog), (override));
  26. };
  27. }
  28. #endif