From dc542d4fd23c9a19b607d355a3d866a61b530327 Mon Sep 17 00:00:00 2001 From: Miguel Company Date: Fri, 5 Jul 2024 09:39:48 +0200 Subject: [PATCH] Fix build after backport. Signed-off-by: Miguel Company --- test/blackbox/common/DDSBlackboxTestsROS2.cpp | 22 ++++--- test/blackbox/common/ros2/Context.hpp | 8 +-- .../blackbox/common/ros2/DataReaderHolder.hpp | 2 +- .../blackbox/common/ros2/DataWriterHolder.hpp | 2 +- test/blackbox/common/ros2/GenericHolder.hpp | 62 +++++++++---------- test/blackbox/common/ros2/Node.hpp | 2 +- test/blackbox/common/ros2/PublicationNode.hpp | 2 +- .../blackbox/common/ros2/SubscriptionNode.hpp | 2 +- test/blackbox/common/ros2/TopicHolder.hpp | 2 +- 9 files changed, 54 insertions(+), 50 deletions(-) diff --git a/test/blackbox/common/DDSBlackboxTestsROS2.cpp b/test/blackbox/common/DDSBlackboxTestsROS2.cpp index d04dfbc3005..43ea22f5032 100644 --- a/test/blackbox/common/DDSBlackboxTestsROS2.cpp +++ b/test/blackbox/common/DDSBlackboxTestsROS2.cpp @@ -23,7 +23,6 @@ #include -#include #include #include #include @@ -42,7 +41,10 @@ #include #include #include -#include +#include +#include +#include +#include #include "./ros2/Context.hpp" #include "./ros2/DataReaderHolder.hpp" @@ -53,7 +55,7 @@ #include "./ros2/TopicHolder.hpp" #include "BlackboxTests.hpp" -#include "../types/HelloWorldPubSubTypes.hpp" +#include "../types/HelloWorldPubSubTypes.h" namespace eprosima { namespace fastdds { @@ -69,14 +71,16 @@ namespace ros2 = eprosima::testing::ros2; */ TEST(DDS_ROS2, test_automatic_liveliness_changed) { + using namespace eprosima::fastrtps; + // Force intraprocess - auto factory = DomainParticipantFactory::get_shared_instance(); - LibrarySettings old_library_settings; - factory->get_library_settings(old_library_settings); + LibrarySettingsAttributes old_library_settings; + old_library_settings = xmlparser::XMLProfileManager::library_settings(); + { - LibrarySettings library_settings; + LibrarySettingsAttributes library_settings; library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - factory->set_library_settings(library_settings); + xmlparser::XMLProfileManager::library_settings(library_settings); } { @@ -159,7 +163,7 @@ TEST(DDS_ROS2, test_automatic_liveliness_changed) sub->stop(); } - factory->set_library_settings(old_library_settings); + xmlparser::XMLProfileManager::library_settings(old_library_settings); } } // namespace dds diff --git a/test/blackbox/common/ros2/Context.hpp b/test/blackbox/common/ros2/Context.hpp index 7d1644d1f5c..3a467efa839 100644 --- a/test/blackbox/common/ros2/Context.hpp +++ b/test/blackbox/common/ros2/Context.hpp @@ -26,7 +26,6 @@ #include -#include #include #include #include @@ -45,13 +44,14 @@ #include #include #include -#include +#include +#include #include "./DataReaderHolder.hpp" #include "./DataWriterHolder.hpp" #include "./TopicHolder.hpp" #include "../BlackboxTests.hpp" -#include "../../types/HelloWorldPubSubTypes.hpp" +#include "../../types/HelloWorldPubSubTypes.h" namespace eprosima { namespace testing { @@ -146,7 +146,7 @@ class Context topic_holder = topics_[topic_name]; if (!topic_holder) { - EXPECT_EQ(RETCODE_OK, type_support.register_type(participant_, type_name)); + EXPECT_EQ(ReturnCode_t::RETCODE_OK, type_support.register_type(participant_, type_name)); auto topic = participant_->create_topic("testing/" + topic_name, type_name, TOPIC_QOS_DEFAULT); ASSERT_NE(nullptr, topic); topic_holder = std::make_shared(participant_, topic); diff --git a/test/blackbox/common/ros2/DataReaderHolder.hpp b/test/blackbox/common/ros2/DataReaderHolder.hpp index 47b5af81cc1..548f8450b9f 100644 --- a/test/blackbox/common/ros2/DataReaderHolder.hpp +++ b/test/blackbox/common/ros2/DataReaderHolder.hpp @@ -17,9 +17,9 @@ #include -#include #include #include +#include #include "./GenericHolder.hpp" diff --git a/test/blackbox/common/ros2/DataWriterHolder.hpp b/test/blackbox/common/ros2/DataWriterHolder.hpp index 60a52df9ad9..8499a0d36a0 100644 --- a/test/blackbox/common/ros2/DataWriterHolder.hpp +++ b/test/blackbox/common/ros2/DataWriterHolder.hpp @@ -17,9 +17,9 @@ #include -#include #include #include +#include #include "./GenericHolder.hpp" diff --git a/test/blackbox/common/ros2/GenericHolder.hpp b/test/blackbox/common/ros2/GenericHolder.hpp index ffa93e07da8..2a449e83b9d 100644 --- a/test/blackbox/common/ros2/GenericHolder.hpp +++ b/test/blackbox/common/ros2/GenericHolder.hpp @@ -15,7 +15,7 @@ #ifndef FASTDDS_TEST_BLACKBOX_COMMON_ROS2__GENERICHOLDER_HPP #define FASTDDS_TEST_BLACKBOX_COMMON_ROS2__GENERICHOLDER_HPP -#include +#include #include @@ -41,36 +41,36 @@ * GENERIC_HOLDER_CLASS(DomainParticipant, Topic, delete_topic, topic) generates TopicHolder. * GENERIC_HOLDER_CLASS(DomainParticipantFactory, DomainParticipant, delete_participant, participant) generates DomainParticipantHolder. */ -#define GENERIC_HOLDER_CLASS(_Factory, _Entity, _Release, _Getter) \ -class _Entity##Holder \ -{ \ -public: \ - _Entity##Holder( \ - _Factory* factory, \ - _Entity* entity) \ - : factory_(factory) \ - , entity_(entity) \ - { \ - } \ - \ - ~_Entity##Holder() \ - { \ - if (nullptr != factory_ && nullptr != entity_) \ - { \ - EXPECT_EQ(RETCODE_OK, factory_->_Release(entity_)); \ - } \ - } \ - \ - _Entity* _Getter() \ - { \ - return entity_; \ - } \ - \ -private: \ - \ - _Factory* factory_ = nullptr; \ - _Entity* entity_ = nullptr; \ - \ +#define GENERIC_HOLDER_CLASS(_Factory, _Entity, _Release, _Getter) \ +class _Entity##Holder \ +{ \ +public: \ + _Entity##Holder( \ + _Factory* factory, \ + _Entity* entity) \ + : factory_(factory) \ + , entity_(entity) \ + { \ + } \ + \ + ~_Entity##Holder() \ + { \ + if (nullptr != factory_ && nullptr != entity_) \ + { \ + EXPECT_EQ(ReturnCode_t::RETCODE_OK, factory_->_Release(entity_)); \ + } \ + } \ + \ + _Entity* _Getter() \ + { \ + return entity_; \ + } \ + \ +private: \ + \ + _Factory* factory_ = nullptr; \ + _Entity* entity_ = nullptr; \ + \ }; // *INDENT-ON* diff --git a/test/blackbox/common/ros2/Node.hpp b/test/blackbox/common/ros2/Node.hpp index 57146a43c5b..4cd9d870a9e 100644 --- a/test/blackbox/common/ros2/Node.hpp +++ b/test/blackbox/common/ros2/Node.hpp @@ -24,7 +24,7 @@ #include "./DataReaderHolder.hpp" #include "./DataWriterHolder.hpp" #include "./TopicHolder.hpp" -#include "../../types/HelloWorldPubSubTypes.hpp" +#include "../../types/HelloWorldPubSubTypes.h" #include #include diff --git a/test/blackbox/common/ros2/PublicationNode.hpp b/test/blackbox/common/ros2/PublicationNode.hpp index a2d6632369c..388f05bb58d 100644 --- a/test/blackbox/common/ros2/PublicationNode.hpp +++ b/test/blackbox/common/ros2/PublicationNode.hpp @@ -22,7 +22,6 @@ #include -#include #include #include #include @@ -30,6 +29,7 @@ #include #include #include +#include #include "./Context.hpp" #include "./DataWriterHolder.hpp" diff --git a/test/blackbox/common/ros2/SubscriptionNode.hpp b/test/blackbox/common/ros2/SubscriptionNode.hpp index 43b5941f981..2943dd66e55 100644 --- a/test/blackbox/common/ros2/SubscriptionNode.hpp +++ b/test/blackbox/common/ros2/SubscriptionNode.hpp @@ -23,7 +23,6 @@ #include -#include #include #include #include @@ -32,6 +31,7 @@ #include #include #include +#include #include "./Context.hpp" #include "./DataReaderHolder.hpp" diff --git a/test/blackbox/common/ros2/TopicHolder.hpp b/test/blackbox/common/ros2/TopicHolder.hpp index 13e206ef8b2..0be359e1c51 100644 --- a/test/blackbox/common/ros2/TopicHolder.hpp +++ b/test/blackbox/common/ros2/TopicHolder.hpp @@ -17,9 +17,9 @@ #include -#include #include #include +#include #include "./GenericHolder.hpp"