37inline std::size_t mock_hdr_decoder_func (
const std::byte*, std::size_t) {
return 0u; }
40 using endpoint_type = asio::ip::udp::endpoint;
42 double mock_sock = 42.0;
45 constexpr static std::size_t qs_base = 42;
47 bool is_io_started()
const {
return started; }
50 void visit_socket(F&& f) {
58 bool send_called =
false;
60 bool send(chops::const_shared_buffer) { send_called =
true;
return true; }
61 bool send(chops::const_shared_buffer,
const endpoint_type&) { send_called =
true;
return true; }
63 bool mf_sio_called =
false;
64 bool simple_var_len_sio_called =
false;
65 bool delim_sio_called =
false;
66 bool rd_sio_called =
false;
67 bool rd_endp_sio_called =
false;
68 bool send_sio_called =
false;
69 bool send_endp_sio_called =
false;
71 template <
typename MH,
typename MF>
72 bool start_io(std::size_t, MH&&, MF&&) {
73 return started ? false : started =
true, mf_sio_called =
true,
true;
76 template <
typename MH>
77 bool start_io(std::size_t, MH&&, chops::net::hdr_decoder_func) {
78 return started ? false : started =
true, simple_var_len_sio_called =
true,
true;
81 template <
typename MH>
82 bool start_io(std::string_view, MH&&) {
83 return started ? false : started =
true, delim_sio_called =
true,
true;
86 template <
typename MH>
87 bool start_io(std::size_t, MH&&) {
88 return started ? false : started =
true, rd_sio_called =
true,
true;
91 template <
typename MH>
92 bool start_io(
const endpoint_type&, std::size_t, MH&&) {
93 return started ? false : started =
true, rd_endp_sio_called =
true,
true;
97 return started ? false : started =
true, send_sio_called =
true,
true;
100 bool start_io(
const endpoint_type&) {
101 return started ? false : started =
true, send_endp_sio_called =
true,
true;
105 return started ? started =
false, true :
false;
117 std::shared_ptr<io_handler_mock> mock_ioh_sp = std::make_shared<io_handler_mock>();
118 float mock_sock = 11.0f;
119 bool started =
false;
123 bool is_started()
const {
return started; }
125 template <
typename F>
126 void visit_socket(F&& f) {
130 template <
typename F>
131 std::size_t visit_io_output(F&& f) {
136 template <
typename F1,
typename F2>
137 std::error_code start(F1&& ios, F2&&) {
139 return std::make_error_code(std::errc::too_many_files_open);
145 return std::error_code {};
148 std::error_code stop() {
150 return std::make_error_code(std::errc::too_many_files_open);
154 return std::error_code {};