Skip to content

Commit

Permalink
Fix build after backport.
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
  • Loading branch information
MiguelCompany committed Jul 5, 2024
1 parent 8c0beb2 commit dc542d4
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 50 deletions.
22 changes: 13 additions & 9 deletions test/blackbox/common/DDSBlackboxTestsROS2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

#include <gtest/gtest.h>

#include <fastdds/dds/core/detail/DDSReturnCode.hpp>
#include <fastdds/dds/core/policy/QosPolicies.hpp>
#include <fastdds/dds/core/status/LivelinessChangedStatus.hpp>
#include <fastdds/dds/domain/DomainParticipant.hpp>
Expand All @@ -42,7 +41,10 @@
#include <fastdds/dds/topic/qos/TopicQos.hpp>
#include <fastdds/dds/topic/Topic.hpp>
#include <fastdds/dds/topic/TypeSupport.hpp>
#include <fastdds/rtps/common/Time_t.hpp>
#include <fastdds/rtps/common/Time_t.h>
#include <fastrtps/attributes/LibrarySettingsAttributes.h>
#include <fastrtps/types/TypesBase.h>
#include <fastrtps/xmlparser/XMLProfileManager.h>

#include "./ros2/Context.hpp"
#include "./ros2/DataReaderHolder.hpp"
Expand All @@ -53,7 +55,7 @@
#include "./ros2/TopicHolder.hpp"

#include "BlackboxTests.hpp"
#include "../types/HelloWorldPubSubTypes.hpp"
#include "../types/HelloWorldPubSubTypes.h"

namespace eprosima {
namespace fastdds {
Expand All @@ -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);
}

{
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions test/blackbox/common/ros2/Context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

#include <gtest/gtest.h>

#include <fastdds/dds/core/detail/DDSReturnCode.hpp>
#include <fastdds/dds/core/policy/QosPolicies.hpp>
#include <fastdds/dds/core/status/LivelinessChangedStatus.hpp>
#include <fastdds/dds/domain/DomainParticipant.hpp>
Expand All @@ -45,13 +44,14 @@
#include <fastdds/dds/topic/qos/TopicQos.hpp>
#include <fastdds/dds/topic/Topic.hpp>
#include <fastdds/dds/topic/TypeSupport.hpp>
#include <fastdds/rtps/common/Time_t.hpp>
#include <fastdds/rtps/common/Time_t.h>
#include <fastrtps/types/TypesBase.h>

#include "./DataReaderHolder.hpp"
#include "./DataWriterHolder.hpp"
#include "./TopicHolder.hpp"
#include "../BlackboxTests.hpp"
#include "../../types/HelloWorldPubSubTypes.hpp"
#include "../../types/HelloWorldPubSubTypes.h"

namespace eprosima {
namespace testing {
Expand Down Expand Up @@ -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<TopicHolder>(participant_, topic);
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox/common/ros2/DataReaderHolder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

#include <gtest/gtest.h>

#include <fastdds/dds/core/detail/DDSReturnCode.hpp>
#include <fastdds/dds/subscriber/Subscriber.hpp>
#include <fastdds/dds/subscriber/DataReader.hpp>
#include <fastrtps/types/TypesBase.h>

#include "./GenericHolder.hpp"

Expand Down
2 changes: 1 addition & 1 deletion test/blackbox/common/ros2/DataWriterHolder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

#include <gtest/gtest.h>

#include <fastdds/dds/core/detail/DDSReturnCode.hpp>
#include <fastdds/dds/publisher/Publisher.hpp>
#include <fastdds/dds/publisher/DataWriter.hpp>
#include <fastrtps/types/TypesBase.h>

#include "./GenericHolder.hpp"

Expand Down
62 changes: 31 additions & 31 deletions test/blackbox/common/ros2/GenericHolder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef FASTDDS_TEST_BLACKBOX_COMMON_ROS2__GENERICHOLDER_HPP
#define FASTDDS_TEST_BLACKBOX_COMMON_ROS2__GENERICHOLDER_HPP

#include <fastdds/dds/core/detail/DDSReturnCode.hpp>
#include <fastrtps/types/TypesBase.h>

#include <gtest/gtest.h>

Expand All @@ -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*

Expand Down
2 changes: 1 addition & 1 deletion test/blackbox/common/ros2/Node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "./DataReaderHolder.hpp"
#include "./DataWriterHolder.hpp"
#include "./TopicHolder.hpp"
#include "../../types/HelloWorldPubSubTypes.hpp"
#include "../../types/HelloWorldPubSubTypes.h"
#include <fastdds/dds/core/policy/QosPolicies.hpp>
#include <fastdds/dds/topic/TypeSupport.hpp>

Expand Down
2 changes: 1 addition & 1 deletion test/blackbox/common/ros2/PublicationNode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@

#include <gtest/gtest.h>

#include <fastdds/dds/core/detail/DDSReturnCode.hpp>
#include <fastdds/dds/core/policy/QosPolicies.hpp>
#include <fastdds/dds/publisher/DataWriter.hpp>
#include <fastdds/dds/publisher/DataWriterListener.hpp>
#include <fastdds/dds/publisher/Publisher.hpp>
#include <fastdds/dds/publisher/qos/DataWriterQos.hpp>
#include <fastdds/dds/topic/Topic.hpp>
#include <fastdds/dds/topic/TypeSupport.hpp>
#include <fastrtps/types/TypesBase.h>

#include "./Context.hpp"
#include "./DataWriterHolder.hpp"
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox/common/ros2/SubscriptionNode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

#include <gtest/gtest.h>

#include <fastdds/dds/core/detail/DDSReturnCode.hpp>
#include <fastdds/dds/core/policy/QosPolicies.hpp>
#include <fastdds/dds/core/status/LivelinessChangedStatus.hpp>
#include <fastdds/dds/subscriber/DataReader.hpp>
Expand All @@ -32,6 +31,7 @@
#include <fastdds/dds/subscriber/Subscriber.hpp>
#include <fastdds/dds/topic/Topic.hpp>
#include <fastdds/dds/topic/TypeSupport.hpp>
#include <fastrtps/types/TypesBase.h>

#include "./Context.hpp"
#include "./DataReaderHolder.hpp"
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox/common/ros2/TopicHolder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

#include <gtest/gtest.h>

#include <fastdds/dds/core/detail/DDSReturnCode.hpp>
#include <fastdds/dds/domain/DomainParticipant.hpp>
#include <fastdds/dds/topic/Topic.hpp>
#include <fastrtps/types/TypesBase.h>

#include "./GenericHolder.hpp"

Expand Down

0 comments on commit dc542d4

Please sign in to comment.