Skip to content

Commit 69015da

Browse files
committed
Refs #22721: Review
Signed-off-by: cferreiragonz <[email protected]>
1 parent d221393 commit 69015da

File tree

2 files changed

+12
-33
lines changed

2 files changed

+12
-33
lines changed

src/cpp/rtps/RTPSDomain.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -645,8 +645,8 @@ RTPSParticipant* RTPSDomainImpl::clientServerEnvironmentCreationOverride(
645645
else
646646
{
647647
// There is already a profile with the given name. Do not overwrite it
648-
EPROSIMA_LOG_WARNING(RTPS_DOMAIN, "A XML profile for 'service' was found. When using ROS2_EASY_MODE, please ensure"
649-
" the max_blocking_time is configured with a higher value than default.");
648+
EPROSIMA_LOG_WARNING(RTPS_DOMAIN, "An XML profile for 'service' was found. When using ROS2_EASY_MODE, please ensure"
649+
" the max_blocking_time is configured with a value higher than the default.");
650650
}
651651

652652
SystemCommandBuilder sys_command;

test/unittest/dds/participant/ParticipantTests.cpp

+10-31
Original file line numberDiff line numberDiff line change
@@ -1502,18 +1502,16 @@ TEST(ParticipantTests, ServerParticipantRemoteServerListConfiguration)
15021502

15031503
TEST(ParticipantTests, EasyModeParticipantLoadsServiceDataWriterQos)
15041504
{
1505-
// Use get_publisher_qos_from_profile to check if the profile is correctly loaded.
1506-
// But we cannot check the actual value of the max_blocking_time from qos because it belongs to the PublisherAttributes
1505+
// Use get_datawriter_qos_from_profile to check if the profile is correctly loaded.
15071506
{
15081507
// Default participant
15091508
DomainParticipant* participant = DomainParticipantFactory::get_instance()->create_participant(
15101509
(uint32_t)GET_PID() % 230, PARTICIPANT_QOS_DEFAULT);
15111510
ASSERT_NE(nullptr, participant);
15121511
Publisher* default_publisher = participant->create_publisher(PUBLISHER_QOS_DEFAULT);
15131512
ASSERT_NE(default_publisher, nullptr);
1514-
PublisherQos profile_qos;
1515-
EXPECT_EQ(default_publisher->get_participant()->get_publisher_qos_from_profile("service", profile_qos),
1516-
RETCODE_BAD_PARAMETER);
1513+
DataWriterQos dw_qos;
1514+
EXPECT_EQ(default_publisher->get_datawriter_qos_from_profile("service", dw_qos), RETCODE_BAD_PARAMETER);
15171515

15181516
EXPECT_EQ(RETCODE_OK, participant->delete_publisher(default_publisher));
15191517
EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant));
@@ -1527,23 +1525,12 @@ TEST(ParticipantTests, EasyModeParticipantLoadsServiceDataWriterQos)
15271525
ASSERT_NE(nullptr, participant);
15281526
Publisher* easy_mode_publisher = participant->create_publisher(PUBLISHER_QOS_DEFAULT);
15291527
ASSERT_NE(easy_mode_publisher, nullptr);
1530-
PublisherQos profile_qos;
1531-
EXPECT_EQ(easy_mode_publisher->get_participant()->get_publisher_qos_from_profile("service", profile_qos),
1532-
RETCODE_OK);
1533-
TypeSupport type(new TopicDataTypeMock());
1534-
type.register_type(participant, "footype");
1535-
Topic* topic = participant->create_topic("footopic", "footype", TOPIC_QOS_DEFAULT);
1536-
ASSERT_NE(nullptr, topic);
1537-
DataWriter* data_writer = easy_mode_publisher->create_datawriter_with_profile(topic, "service");
1538-
ASSERT_NE(nullptr, data_writer);
15391528
DataWriterQos dw_qos;
1540-
EXPECT_EQ(data_writer->get_qos(dw_qos), RETCODE_OK);
1541-
EXPECT_EQ(dw_qos.reliability().max_blocking_time.seconds, 1);
1542-
EXPECT_EQ(dw_qos.reliability().max_blocking_time.nanosec, 0);
1529+
EXPECT_EQ(easy_mode_publisher->get_datawriter_qos_from_profile("service", dw_qos), RETCODE_OK);
1530+
EXPECT_EQ(dw_qos.reliability().max_blocking_time.seconds, 1); // Easy Mode value
1531+
EXPECT_EQ(dw_qos.reliability().max_blocking_time.nanosec, 0); // Easy Mode value
15431532
EXPECT_EQ(dw_qos.durability().kind, TRANSIENT_LOCAL_DURABILITY_QOS); // Default value
15441533

1545-
EXPECT_EQ(RETCODE_OK, easy_mode_publisher->delete_datawriter(data_writer));
1546-
EXPECT_EQ(RETCODE_OK, participant->delete_topic(topic));
15471534
EXPECT_EQ(RETCODE_OK, participant->delete_publisher(easy_mode_publisher));
15481535
EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant));
15491536
stop_background_servers();
@@ -1554,7 +1541,7 @@ TEST(ParticipantTests, EasyModeParticipantDoNotOverwriteCustomDataWriterQos)
15541541
{
15551542
{
15561543
// Easy mode participant with existing profile
1557-
// set XML profile as environment variable: "export FASTDDS_DEFAULT_PROFILES_FILE=test_xml_service_easy_mode.xml"
1544+
// Set XML profile as environment variable: "export FASTDDS_DEFAULT_PROFILES_FILE=test_xml_service_easy_mode.xml"
15581545
eprosima::testing::set_environment_variable("FASTDDS_DEFAULT_PROFILES_FILE", "test_xml_service_easy_mode.xml");
15591546
set_easy_mode_environment_variable();
15601547
DomainParticipant* participant = DomainParticipantFactory::get_instance()->create_participant(
@@ -1565,20 +1552,12 @@ TEST(ParticipantTests, EasyModeParticipantDoNotOverwriteCustomDataWriterQos)
15651552
PublisherQos profile_qos;
15661553
EXPECT_EQ(easy_mode_publisher->get_participant()->get_publisher_qos_from_profile("service", profile_qos),
15671554
RETCODE_OK);
1568-
TypeSupport type(new TopicDataTypeMock());
1569-
type.register_type(participant, "footype");
1570-
Topic* topic = participant->create_topic("footopic", "footype", TOPIC_QOS_DEFAULT);
1571-
ASSERT_NE(nullptr, topic);
1572-
DataWriter* data_writer = easy_mode_publisher->create_datawriter_with_profile(topic, "service");
1573-
ASSERT_NE(nullptr, data_writer);
15741555
DataWriterQos dw_qos;
1575-
EXPECT_EQ(data_writer->get_qos(dw_qos), RETCODE_OK);
1576-
EXPECT_EQ(dw_qos.reliability().max_blocking_time.seconds, 5);
1577-
EXPECT_EQ(dw_qos.reliability().max_blocking_time.nanosec, 0);
1556+
easy_mode_publisher->get_datawriter_qos_from_profile("service", dw_qos);
1557+
EXPECT_EQ(dw_qos.reliability().max_blocking_time.seconds, 5); // XML value
1558+
EXPECT_EQ(dw_qos.reliability().max_blocking_time.nanosec, 0); // XML value
15781559
EXPECT_EQ(dw_qos.durability().kind, VOLATILE_DURABILITY_QOS); // XML value
15791560

1580-
EXPECT_EQ(RETCODE_OK, easy_mode_publisher->delete_datawriter(data_writer));
1581-
EXPECT_EQ(RETCODE_OK, participant->delete_topic(topic));
15821561
EXPECT_EQ(RETCODE_OK, participant->delete_publisher(easy_mode_publisher));
15831562
EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant));
15841563
stop_background_servers();

0 commit comments

Comments
 (0)