Commit 03008eb2 authored by Dominik Charousset's avatar Dominik Charousset

Add run_exhaustively convenience function

parent 86216d83
...@@ -159,7 +159,7 @@ CAF_TEST(depth_3_pipeline_with_fork) { ...@@ -159,7 +159,7 @@ CAF_TEST(depth_3_pipeline_with_fork) {
sched.run(); sched.run();
CAF_CHECK_EQUAL(st.stage->out().num_paths(), 2u); CAF_CHECK_EQUAL(st.stage->out().num_paths(), 2u);
CAF_CHECK_EQUAL(st.stage->inbound_paths().size(), 1u); CAF_CHECK_EQUAL(st.stage->inbound_paths().size(), 1u);
sched.run_dispatch_loop(streaming_cycle); run_exhaustively();
CAF_CHECK_EQUAL(st.stage->out().num_paths(), 2u); CAF_CHECK_EQUAL(st.stage->out().num_paths(), 2u);
CAF_CHECK_EQUAL(st.stage->inbound_paths().size(), 0u); CAF_CHECK_EQUAL(st.stage->inbound_paths().size(), 0u);
CAF_CHECK_EQUAL(deref<sum_up_actor>(snk1).state.x, 1275); CAF_CHECK_EQUAL(deref<sum_up_actor>(snk1).state.x, 1275);
...@@ -183,7 +183,7 @@ CAF_TEST(depth_3_pipeline_with_join) { ...@@ -183,7 +183,7 @@ CAF_TEST(depth_3_pipeline_with_join) {
sched.run(); sched.run();
CAF_CHECK_EQUAL(st.stage->out().num_paths(), 1u); CAF_CHECK_EQUAL(st.stage->out().num_paths(), 1u);
CAF_CHECK_EQUAL(st.stage->inbound_paths().size(), 2u); CAF_CHECK_EQUAL(st.stage->inbound_paths().size(), 2u);
sched.run_dispatch_loop(streaming_cycle); run_exhaustively();
CAF_CHECK_EQUAL(st.stage->out().num_paths(), 1u); CAF_CHECK_EQUAL(st.stage->out().num_paths(), 1u);
CAF_CHECK_EQUAL(st.stage->inbound_paths().size(), 0u); CAF_CHECK_EQUAL(st.stage->inbound_paths().size(), 0u);
CAF_CHECK_EQUAL(deref<sum_up_actor>(snk).state.x, 2550); CAF_CHECK_EQUAL(deref<sum_up_actor>(snk).state.x, 2550);
......
...@@ -573,6 +573,11 @@ struct test_coordinator_fixture { ...@@ -573,6 +573,11 @@ struct test_coordinator_fixture {
sched.run(); sched.run();
} }
/// Dispatches messages and timeouts until no activity remains.
void run_exhaustively() {
sched.run_dispatch_loop(streaming_cycle);
}
template <class T = int> template <class T = int>
caf::expected<T> fetch_result() { caf::expected<T> fetch_result() {
caf::expected<T> result = caf::error{}; caf::expected<T> result = caf::error{};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment