21 #ifndef INCLUDE_OLA_TESTING_MOCKUDPSOCKET_H_
22 #define INCLUDE_OLA_TESTING_MOCKUDPSOCKET_H_
24 #include <cppunit/extensions/HelperMacros.h>
28 #include <ola/network/Socket.h>
66 ssize_t
SendTo(
const uint8_t *buffer,
69 unsigned short port)
const;
70 ssize_t
SendTo(
const uint8_t *buffer,
73 return SendTo(buffer, size, dest.Host(), dest.Port());
77 unsigned short port)
const;
80 return SendTo(data, dest.Host(), dest.Port());
83 bool RecvFrom(uint8_t *buffer, ssize_t *data_read)
const;
90 uint16_t &port)
const;
98 bool multicast_loop =
false);
104 void SetDiscardMode(
bool discard_mode) { m_discard_mode = discard_mode; }
107 void AddExpectedData(
const uint8_t *data,
127 bool CheckNetworkParamsMatch(
bool init_called,
143 typedef expected_call received_data;
148 ola::io::DescriptorHandle m_dummy_handle;
149 bool m_bound_to_port;
150 bool m_broadcast_set;
153 mutable std::queue<expected_call> m_expected_calls;
154 mutable std::queue<received_data> m_received_data;
159 unsigned int *size)
const;
161 DISALLOW_COPY_AND_ASSIGN(MockUDPSocket);
184 #endif // INCLUDE_OLA_TESTING_MOCKUDPSOCKET_H_