mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2026-11-25 13:11:36 +00:00
refactor(test): set up test configs with test::Configure()
- 33 places repeated the same session, shm segment size, shm monitor and expanded metadata properties - call test::Configure() and set only the properties that differ Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
|
||||
#include <boost/container/pmr/polymorphic_allocator.hpp>
|
||||
|
||||
#include <helper/Transport.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <cstddef>
|
||||
@@ -78,11 +79,8 @@ int TestData::ndeallocations = 0;
|
||||
|
||||
TEST(MemoryResources, transportAllocatorMap)
|
||||
{
|
||||
size_t session{tools::UuidHash()};
|
||||
ProgOptions config;
|
||||
config.SetProperty<string>("session", to_string(session));
|
||||
config.SetProperty<bool>("shm-monitor", true);
|
||||
config.SetProperty<size_t>("shm-segment-size", 100000000);
|
||||
test::Configure(config);
|
||||
|
||||
FactoryType factoryZMQ = TransportFactory::CreateTransportFactory("zeromq", fair::mq::tools::Uuid(), &config);
|
||||
FactoryType factorySHM = TransportFactory::CreateTransportFactory("shmem", fair::mq::tools::Uuid(), &config);
|
||||
@@ -102,9 +100,8 @@ TEST(MemoryResources, allocator)
|
||||
TestData::nallocations = 0;
|
||||
TestData::ndeallocations = 0;
|
||||
|
||||
size_t session{tools::UuidHash()};
|
||||
ProgOptions config;
|
||||
config.SetProperty<std::string>("session", to_string(session));
|
||||
test::Configure(config);
|
||||
|
||||
FactoryType factoryZMQ = TransportFactory::CreateTransportFactory("zeromq", fair::mq::tools::Uuid(), &config);
|
||||
|
||||
@@ -130,11 +127,8 @@ TEST(MemoryResources, getMessage)
|
||||
TestData::nallocations = 0;
|
||||
TestData::ndeallocations = 0;
|
||||
|
||||
size_t session{tools::UuidHash()};
|
||||
ProgOptions config;
|
||||
config.SetProperty<std::string>("session", to_string(session));
|
||||
config.SetProperty<bool>("shm-monitor", true);
|
||||
config.SetProperty<size_t>("shm-segment-size", 100000000);
|
||||
test::Configure(config);
|
||||
|
||||
FactoryType factoryZMQ = TransportFactory::CreateTransportFactory("zeromq", fair::mq::tools::Uuid(), &config);
|
||||
FactoryType factorySHM = TransportFactory::CreateTransportFactory("shmem", fair::mq::tools::Uuid(), &config);
|
||||
|
||||
Reference in New Issue
Block a user