mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 17:41:45 +00:00
FairMQ: Fix various errors from CI
* move Plugins::Version to fair::mq::tools * fix Parser interface * make device a shared pointer in main * provide std::hash template specialization * fix FairMQ.Plugins/FairMQ.PluginsStatic when run with ctest * fix MQ/serialization example * add --no-as-needed flag * GCC 4 does not support member refs, move to pointer types
This commit is contained in:
committed by
Mohammad Al-Turany
parent
ad0f050c99
commit
a26925cbf5
@@ -9,8 +9,10 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include <fairmq/Plugin.h>
|
||||
#include <fairmq/PluginServices.h>
|
||||
#include <fairmq/Tools.h>
|
||||
#include <FairMQDevice.h>
|
||||
#include <options/FairMQProgOptions.h>
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -21,27 +23,27 @@ namespace
|
||||
using namespace std;
|
||||
using namespace fair::mq;
|
||||
|
||||
auto control(FairMQDevice& device) -> void
|
||||
auto control(shared_ptr<FairMQDevice> device) -> void
|
||||
{
|
||||
device.SetTransport("zeromq");
|
||||
device->SetTransport("zeromq");
|
||||
for (const auto event : {
|
||||
FairMQDevice::INIT_DEVICE,
|
||||
FairMQDevice::RESET_DEVICE,
|
||||
FairMQDevice::END,
|
||||
}) {
|
||||
device.ChangeState(event);
|
||||
if (event != FairMQDevice::END) device.WaitForEndOfState(event);
|
||||
device->ChangeState(event);
|
||||
if (event != FairMQDevice::END) device->WaitForEndOfState(event);
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Plugin, Operators)
|
||||
{
|
||||
FairMQProgOptions config{};
|
||||
FairMQDevice device{};
|
||||
PluginServices services{config, device};
|
||||
auto p1 = Plugin{"dds", {1, 0, 0}, "Foo Bar <foo.bar@test.net>", "https://git.test.net/dds.git", services};
|
||||
auto p2 = Plugin{"dds", {1, 0, 0}, "Foo Bar <foo.bar@test.net>", "https://git.test.net/dds.git", services};
|
||||
auto p3 = Plugin{"file", {1, 0, 0}, "Foo Bar <foo.bar@test.net>", "https://git.test.net/file.git", services};
|
||||
auto device = make_shared<FairMQDevice>();
|
||||
PluginServices services{&config, device};
|
||||
auto p1 = Plugin{"dds", {1, 0, 0}, "Foo Bar <foo.bar@test.net>", "https://git.test.net/dds.git", &services};
|
||||
auto p2 = Plugin{"dds", {1, 0, 0}, "Foo Bar <foo.bar@test.net>", "https://git.test.net/dds.git", &services};
|
||||
auto p3 = Plugin{"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);
|
||||
@@ -50,9 +52,9 @@ TEST(Plugin, Operators)
|
||||
TEST(Plugin, OstreamOperators)
|
||||
{
|
||||
FairMQProgOptions config{};
|
||||
FairMQDevice device{};
|
||||
PluginServices services{config, device};
|
||||
auto p1 = Plugin{"dds", {1, 0, 0}, "Foo Bar <foo.bar@test.net>", "https://git.test.net/dds.git", services};
|
||||
auto device = make_shared<FairMQDevice>();
|
||||
PluginServices services{&config, device};
|
||||
auto p1 = Plugin{"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'"});
|
||||
@@ -61,9 +63,9 @@ TEST(Plugin, OstreamOperators)
|
||||
|
||||
TEST(PluginVersion, Operators)
|
||||
{
|
||||
struct Plugin::Version v1{1, 0, 0};
|
||||
struct Plugin::Version v2{1, 0, 0};
|
||||
struct Plugin::Version v3{1, 2, 0};
|
||||
struct fair::mq::tools::Version v1{1, 0, 0};
|
||||
struct fair::mq::tools::Version v2{1, 0, 0};
|
||||
struct fair::mq::tools::Version v3{1, 2, 0};
|
||||
EXPECT_EQ(v1, v2);
|
||||
EXPECT_NE(v1, v3);
|
||||
EXPECT_GT(v3, v2);
|
||||
|
Reference in New Issue
Block a user