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

Make io_dsl fixtures more flexible

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