diff --git a/ddsrouter_core/src/cpp/core/ParticipantFactory.cpp b/ddsrouter_core/src/cpp/core/ParticipantFactory.cpp index ec8b22b08..fd30ef829 100644 --- a/ddsrouter_core/src/cpp/core/ParticipantFactory.cpp +++ b/ddsrouter_core/src/cpp/core/ParticipantFactory.cpp @@ -31,9 +31,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include @@ -104,7 +104,7 @@ std::shared_ptr ParticipantFactory::create_particip case types::ParticipantKind::simple: return generic_create_participant_with_init< ddspipe::participants::SimpleParticipantConfiguration, - ddspipe::participants::rtps::SimpleParticipant> + ddspipe::participants::dds::SimpleParticipant> ( kind, participant_configuration, @@ -115,7 +115,7 @@ std::shared_ptr ParticipantFactory::create_particip case types::ParticipantKind::discovery_server: return generic_create_participant_with_init< ddspipe::participants::DiscoveryServerParticipantConfiguration, - ddspipe::participants::rtps::DiscoveryServerParticipant> + ddspipe::participants::dds::DiscoveryServerParticipant> ( kind, participant_configuration, @@ -126,7 +126,7 @@ std::shared_ptr ParticipantFactory::create_particip case types::ParticipantKind::initial_peers: return generic_create_participant_with_init< ddspipe::participants::InitialPeersParticipantConfiguration, - ddspipe::participants::rtps::InitialPeersParticipant> + ddspipe::participants::dds::InitialPeersParticipant> ( kind, participant_configuration, diff --git a/ddsrouter_core/test/blackbox/ddsrouter_core/dds/local/DDSTestLocal.cpp b/ddsrouter_core/test/blackbox/ddsrouter_core/dds/local/DDSTestLocal.cpp index 7b54503f5..022dd02bc 100644 --- a/ddsrouter_core/test/blackbox/ddsrouter_core/dds/local/DDSTestLocal.cpp +++ b/ddsrouter_core/test/blackbox/ddsrouter_core/dds/local/DDSTestLocal.cpp @@ -22,6 +22,7 @@ #include #include +#include #include @@ -50,7 +51,8 @@ constexpr const uint32_t DEFAULT_MESSAGE_SIZE = 1; // x50 bytes */ DdsRouterConfiguration dds_test_simple_configuration( bool disable_dynamic_discovery = false, - bool transient_local_readers = false) + bool transient_local_readers = false, + bool keyed = false) { DdsRouterConfiguration conf; @@ -79,13 +81,24 @@ DdsRouterConfiguration dds_test_simple_configuration( topic.type_name = "HelloWorld"; topic.topic_qos = qos; - core::types::DdsTopic topic_keyed(topic); - topic_keyed.type_name = "HelloWorldKeyed"; - topic_keyed.topic_qos.keyed = true; + // DDS Participants cannot have two topics with the same name. + // Since this test does not require two distinct topics, we can simply avoid inserting + // the other topic if it isn't needed. + if (!keyed) + { + conf.ddspipe_configuration.builtin_topics.insert(utils::Heritable::make_heritable(topic)); + } + else + { + core::types::DdsTopic topic_keyed(topic); + topic_keyed.type_name = "HelloWorldKeyed"; + topic_keyed.topic_qos.keyed = true; - conf.ddspipe_configuration.builtin_topics.insert(utils::Heritable::make_heritable(topic)); - conf.ddspipe_configuration.builtin_topics.insert(utils::Heritable::make_heritable( - topic_keyed)); + conf.ddspipe_configuration.builtin_topics.insert(utils::Heritable::make_heritable( + topic_keyed)); + } + + conf.ddspipe_configuration.discovery_trigger = core::DiscoveryTrigger::NONE; } // Two simple participants @@ -225,7 +238,7 @@ TEST(DDSTestLocal, end_to_end_local_communication) TEST(DDSTestLocal, end_to_end_local_communication_keyed) { test::test_local_communication( - test::dds_test_simple_configuration()); + test::dds_test_simple_configuration(false, false, true)); } /** @@ -242,7 +255,7 @@ TEST(DDSTestLocal, end_to_end_local_communication_disable_dynamic_discovery) TEST(DDSTestLocal, end_to_end_local_communication_disable_dynamic_discovery_keyed) { test::test_local_communication( - test::dds_test_simple_configuration(true)); + test::dds_test_simple_configuration(true,false,true)); } /** diff --git a/ddsrouter_core/test/blackbox/ddsrouter_core/dds/local/DDSTestLocalDisposeKey.cpp b/ddsrouter_core/test/blackbox/ddsrouter_core/dds/local/DDSTestLocalDisposeKey.cpp index 3397b858e..4bde6f741 100644 --- a/ddsrouter_core/test/blackbox/ddsrouter_core/dds/local/DDSTestLocalDisposeKey.cpp +++ b/ddsrouter_core/test/blackbox/ddsrouter_core/dds/local/DDSTestLocalDisposeKey.cpp @@ -22,6 +22,7 @@ #include #include +#include #include diff --git a/ddsrouter_core/test/blackbox/ddsrouter_core/dds/types/test_participants.hpp b/ddsrouter_core/test/blackbox/ddsrouter_core/dds/types/test_participants.hpp index 7a1dba444..904ec5c27 100644 --- a/ddsrouter_core/test/blackbox/ddsrouter_core/dds/types/test_participants.hpp +++ b/ddsrouter_core/test/blackbox/ddsrouter_core/dds/types/test_participants.hpp @@ -37,13 +37,6 @@ #include #include -#include -#include - -#include - -#include - #include "HelloWorld/HelloWorldPubSubTypes.hpp" #include "HelloWorldKeyed/HelloWorldKeyedPubSubTypes.hpp" diff --git a/ddsrouter_core/test/unittest/ParticipantFactoryTest.cpp b/ddsrouter_core/test/unittest/ParticipantFactoryTest.cpp index 0b421c9d5..3cab327b6 100644 --- a/ddsrouter_core/test/unittest/ParticipantFactoryTest.cpp +++ b/ddsrouter_core/test/unittest/ParticipantFactoryTest.cpp @@ -32,9 +32,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include @@ -61,11 +61,11 @@ class EchoTestClass : public ddspipe::participants::EchoParticipant * It provides public access to the protected member 'configuration_' from its base class * ddspipe::participants::SimpleParticipant. */ -class SimpleTestClass : public ddspipe::participants::rtps::SimpleParticipant +class SimpleTestClass : public ddspipe::participants::dds::SimpleParticipant { public: - using ddspipe::participants::rtps::SimpleParticipant::configuration_; // Make protected member accessible + using ddspipe::participants::dds::SimpleParticipant::configuration_; // Make protected member accessible }; /** @@ -73,11 +73,11 @@ class SimpleTestClass : public ddspipe::participants::rtps::SimpleParticipant * It provides public access to the protected member 'configuration_' from its base class * ddspipe::participants::DiscoveryServerParticipant. */ -class DiscoveryServerTestClass : public ddspipe::participants::rtps::DiscoveryServerParticipant +class DiscoveryServerTestClass : public ddspipe::participants::dds::DiscoveryServerParticipant { public: - using ddspipe::participants::rtps::DiscoveryServerParticipant::configuration_; // Make protected member accessible + using ddspipe::participants::dds::DiscoveryServerParticipant::configuration_; // Make protected member accessible }; /** @@ -85,11 +85,11 @@ class DiscoveryServerTestClass : public ddspipe::participants::rtps::DiscoverySe * It provides public access to the protected member 'configuration_' from its base class * ddspipe::participants::InitialPeersParticipant. */ -class InitialPeersTestClass : public ddspipe::participants::rtps::InitialPeersParticipant +class InitialPeersTestClass : public ddspipe::participants::dds::InitialPeersParticipant { public: - using ddspipe::participants::rtps::InitialPeersParticipant::configuration_; // Make protected member accessible + using ddspipe::participants::dds::InitialPeersParticipant::configuration_; // Make protected member accessible }; /**