MCPcopy Create free account
hub / github.com/boostorg/asio / partial_bind_executor_test

Function partial_bind_executor_test

test/bind_executor.cpp:176–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174}
175
176void partial_bind_executor_test()
177{
178 io_context ioc1;
179 io_context ioc2;
180
181 int count = 0;
182
183 timer t(ioc1, chronons::seconds(1));
184 t.async_wait(bind_executor(ioc2.get_executor()))(
185 bindns::bind(&increment, &count));
186
187 ioc1.run();
188
189 BOOST_ASIO_CHECK(count == 0);
190
191 ioc2.run();
192
193 BOOST_ASIO_CHECK(count == 1);
194
195 t.expires_after(chronons::seconds(1));
196 t.async_wait()(
197 bind_executor(ioc2.get_executor()))(
198 incrementer_token_v2(&count));
199
200 ioc1.restart();
201 ioc1.run();
202
203 BOOST_ASIO_CHECK(count == 1);
204
205 ioc2.restart();
206 ioc2.run();
207
208 BOOST_ASIO_CHECK(count == 2);
209}
210
211BOOST_ASIO_TEST_SUITE
212(

Callers

nothing calls this directly

Calls 7

restartMethod · 0.80
bindFunction · 0.50
async_waitMethod · 0.45
get_executorMethod · 0.45
runMethod · 0.45
expires_afterMethod · 0.45

Tested by

no test coverage detected