Fix race in plugin manager/services

This commit is contained in:
Alexey Rybalchenko
2018-07-25 15:16:23 +02:00
committed by Dennis Klein
parent a53ef79552
commit ee8afd7d2b
14 changed files with 204 additions and 250 deletions

View File

@@ -44,7 +44,6 @@ struct PluginServices : ::testing::Test {
{
fRunStateMachineThread = std::thread(&FairMQDevice::RunStateMachine, mDevice.get());
mDevice->SetTransport("zeromq");
}
~PluginServices()

View File

@@ -104,14 +104,14 @@ TEST(PluginManager, LoadPluginStatic)
TEST(PluginManager, Factory)
{
const auto args = vector<string>{"-l", "debug", "--help", "-S", ">/lib", "</home/user/lib", "/usr/local/lib", "/usr/lib"};
auto mgr = PluginManager::MakeFromCommandLineOptions(args);
PluginManager mgr(args);
const auto path1 = path{"/home/user/lib"};
const auto path2 = path{"/usr/local/lib"};
const auto path3 = path{"/usr/lib"};
const auto path4 = path{"/lib"};
const auto expected = vector<path>{path1, path2, path3, path4};
ASSERT_TRUE(static_cast<bool>(mgr));
ASSERT_TRUE(mgr->SearchPaths() == expected);
// ASSERT_TRUE(static_cast<bool>(mgr));
ASSERT_TRUE(mgr.SearchPaths() == expected);
}
TEST(PluginManager, SearchPathValidation)