mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
Run state handlers on the main thread (breaking change for control).
This commit is contained in:
committed by
Dennis Klein
parent
c064da91df
commit
a53ef79552
@@ -16,6 +16,7 @@
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <thread>
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -38,7 +39,7 @@ auto control(shared_ptr<FairMQDevice> device) -> void
|
||||
|
||||
TEST(Plugin, Operators)
|
||||
{
|
||||
FairMQProgOptions config{};
|
||||
FairMQProgOptions config;
|
||||
auto device = make_shared<FairMQDevice>();
|
||||
PluginServices services{&config, device};
|
||||
Plugin p1{"dds", {1, 0, 0}, "Foo Bar <foo.bar@test.net>", "https://git.test.net/dds.git", &services};
|
||||
@@ -46,19 +47,27 @@ TEST(Plugin, Operators)
|
||||
Plugin p3{"file", {1, 0, 0}, "Foo Bar <foo.bar@test.net>", "https://git.test.net/file.git", &services};
|
||||
EXPECT_EQ(p1, p2);
|
||||
EXPECT_NE(p1, p3);
|
||||
control(device);
|
||||
thread t(control, device);
|
||||
device->RunStateMachine();
|
||||
if (t.joinable()) {
|
||||
t.join();
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Plugin, OstreamOperators)
|
||||
{
|
||||
FairMQProgOptions config{};
|
||||
FairMQProgOptions config;
|
||||
auto device = make_shared<FairMQDevice>();
|
||||
PluginServices services{&config, device};
|
||||
Plugin p1{"dds", {1, 0, 0}, "Foo Bar <foo.bar@test.net>", "https://git.test.net/dds.git", &services};
|
||||
stringstream ss;
|
||||
ss << p1;
|
||||
EXPECT_EQ(ss.str(), string{"'dds', version '1.0.0', maintainer 'Foo Bar <foo.bar@test.net>', homepage 'https://git.test.net/dds.git'"});
|
||||
control(device);
|
||||
thread t(control, device);
|
||||
device->RunStateMachine();
|
||||
if (t.joinable()) {
|
||||
t.join();
|
||||
}
|
||||
}
|
||||
|
||||
TEST(PluginVersion, Operators)
|
||||
|
Reference in New Issue
Block a user