Commit 7bc819ac authored by Dominik Charousset's avatar Dominik Charousset

Make io_dsl fixtures more flexible

parent 30517ea5
......@@ -103,7 +103,7 @@ public:
}
};
using sub_fixture = test_node_fixture<remoting_config>;
using sub_fixture = test_node_fixture_t<remoting_config>;
} // namespace <anonymous>
......@@ -131,7 +131,7 @@ struct dsl_path_info {
} \
CAF_MESSAGE("<<< path done")
CAF_TEST_FIXTURE_SCOPE(netstreams, point_to_point_fixture<remoting_config>)
CAF_TEST_FIXTURE_SCOPE(netstreams, point_to_point_fixture_t<remoting_config>)
CAF_TEST(stream_crossing_the_wire) {
CAF_MESSAGE("earth stream serv: " << to_string(earth.stream_serv));
......
......@@ -27,10 +27,10 @@ namespace {
using namespace caf;
using namespace caf::io;
template <class Config = caf::actor_system_config>
class test_node_fixture : public test_coordinator_fixture<Config> {
template <class BaseFixture = test_coordinator_fixture<actor_system_config>>
class test_node_fixture : public BaseFixture {
public:
using super = test_coordinator_fixture<Config>;
using super = BaseFixture;
middleman& mm;
network::test_multiplexer& mpx;
......@@ -123,12 +123,16 @@ private:
}
};
/// Binds `test_coordinator_fixture<Config>` to `test_node_fixture`.
template <class Config = actor_system_config>
using test_node_fixture_t = test_node_fixture<test_coordinator_fixture<Config>>;
/// A simple fixture that includes two nodes (`earth` and `mars`) that are
/// connected to each other.
template <class Config = caf::actor_system_config>
template <class BaseFixture = test_coordinator_fixture<actor_system_config>>
class point_to_point_fixture {
public:
using planet_type = test_node_fixture<Config>;
using planet_type = test_node_fixture<BaseFixture>;
planet_type earth;
planet_type mars;
......@@ -167,6 +171,11 @@ public:
}
};
/// Binds `test_coordinator_fixture<Config>` to `point_to_point_fixture`.
template <class Config = actor_system_config>
using point_to_point_fixture_t =
point_to_point_fixture<test_coordinator_fixture<Config>>;
}// namespace <anonymous>
#define expect_on(where, types, fields) \
......
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