mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
FairMQ: Move static and interactive control modes to plugin (2)
This commit is contained in:
committed by
Mohammad Al-Turany
parent
10f67e4c72
commit
334b91785b
@@ -34,6 +34,7 @@ TEST_F(PluginServices, OnlySingleController)
|
||||
ASSERT_NO_THROW(mServices.ReleaseDeviceControl("foo"));
|
||||
ASSERT_FALSE(mServices.GetDeviceController());
|
||||
// take control implicitely
|
||||
ASSERT_NO_THROW(mServices.TakeDeviceControl("foo"));
|
||||
ASSERT_NO_THROW(mServices.ChangeDeviceState("foo", DeviceStateTransition::InitDevice));
|
||||
EXPECT_EQ(mServices.GetDeviceController(), string{"foo"});
|
||||
|
||||
@@ -47,6 +48,7 @@ TEST_F(PluginServices, OnlySingleController)
|
||||
TEST_F(PluginServices, Control)
|
||||
{
|
||||
ASSERT_EQ(mServices.GetCurrentDeviceState(), DeviceState::Idle);
|
||||
ASSERT_NO_THROW(mServices.TakeDeviceControl("foo"));
|
||||
ASSERT_NO_THROW(mServices.ChangeDeviceState("foo", DeviceStateTransition::InitDevice));
|
||||
|
||||
DeviceState nextState;
|
||||
|
@@ -72,12 +72,14 @@ TEST(PluginManager, LoadPluginStatic)
|
||||
auto device = make_shared<FairMQDevice>();
|
||||
mgr.EmplacePluginServices(&config, device);
|
||||
|
||||
ASSERT_NO_THROW(mgr.LoadPlugin("s:control_static"));
|
||||
device->SetTransport("zeromq");
|
||||
|
||||
ASSERT_NO_THROW(mgr.LoadPlugin("s:control"));
|
||||
|
||||
ASSERT_NO_THROW(mgr.InstantiatePlugins());
|
||||
|
||||
// check order
|
||||
const auto expected = vector<string>{"control_static"};
|
||||
const auto expected = vector<string>{"control"};
|
||||
auto actual = vector<string>{};
|
||||
mgr.ForEachPlugin([&](Plugin& plugin){ actual.push_back(plugin.GetName()); });
|
||||
ASSERT_TRUE(actual == expected);
|
||||
@@ -87,7 +89,7 @@ TEST(PluginManager, LoadPluginStatic)
|
||||
mgr.ForEachPluginProgOptions([&count](const options_description& d){ ++count; });
|
||||
ASSERT_EQ(count, 1);
|
||||
|
||||
control(device);
|
||||
mgr.WaitForPluginsToReleaseDeviceControl();
|
||||
}
|
||||
|
||||
TEST(PluginManager, Factory)
|
||||
|
Reference in New Issue
Block a user