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;
92 uint16_t &port)
const;
100 bool multicast_loop =
false);
106 void SetDiscardMode(
bool discard_mode) { m_discard_mode = discard_mode; }
109 void AddExpectedData(
const uint8_t *data,
129 bool CheckNetworkParamsMatch(
bool init_called,
145 typedef expected_call received_data;
150 ola::io::DescriptorHandle m_dummy_handle;
151 bool m_bound_to_port;
152 bool m_broadcast_set;
155 mutable std::queue<expected_call> m_expected_calls;
156 mutable std::queue<received_data> m_received_data;
161 unsigned int *size)
const;
163 DISALLOW_COPY_AND_ASSIGN(MockUDPSocket);
186 #endif // INCLUDE_OLA_TESTING_MOCKUDPSOCKET_H_