Skip to content

Commit

Permalink
Refs #20849: Apply suggestions
Browse files Browse the repository at this point in the history
Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com>
  • Loading branch information
elianalf committed May 17, 2024
1 parent 5967809 commit 43623c5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
5 changes: 2 additions & 3 deletions test/blackbox/api/dds-pim/PubSubWriter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,10 @@ class PubSubWriter
typedef typename type_support::type type;

PubSubWriter(
const std::string& topic_name,
eprosima::fastdds::dds::DomainParticipant* participant = nullptr)
const std::string& topic_name)
: participant_listener_(*this)
, listener_(*this)
, participant_(participant)
, participant_(nullptr)
, topic_(nullptr)
, publisher_(nullptr)
, datawriter_(nullptr)
Expand Down
16 changes: 6 additions & 10 deletions test/blackbox/common/DDSBlackboxTestsBasic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -780,12 +780,10 @@ TEST(DDSBasic, max_output_message_size_participant)
};

// Create the DomainParticipants with the appropriate value for the property
DomainParticipantQos participant_qos;
participant_qos.properties().properties().emplace_back("fastdds.max_message_size", segment_size_str);
DomainParticipant* participant =
DomainParticipantFactory::get_instance()->create_participant((uint32_t)GET_PID() % 230, participant_qos);
PubSubWriter<Data1mbPubSubType> writer(TEST_TOPIC_NAME, participant);
writer.disable_builtin_transport()
eprosima::fastrtps::rtps::PropertyPolicy property_policy;
property_policy.properties().emplace_back("fastdds.max_message_size", segment_size_str);
PubSubWriter<Data1mbPubSubType> writer(TEST_TOPIC_NAME);
writer.property_policy(property_policy).disable_builtin_transport()
.add_user_transport_to_pparams(testTransport).init();
EXPECT_TRUE(writer.isInitialized());

Expand All @@ -804,8 +802,6 @@ TEST(DDSBasic, max_output_message_size_participant)
// Wait for reception
reader.block_for_all(std::chrono::seconds(1));
EXPECT_EQ(reader.getReceivedCount(), 1u);

DomainParticipantFactory::get_instance()->delete_participant(participant);
}

/**
Expand All @@ -828,8 +824,8 @@ TEST(DDSBasic, max_output_message_size_writer)
eprosima::fastrtps::rtps::PropertyPolicy property_policy;
property_policy.properties().emplace_back("fastdds.max_message_size", segment_size_str);
PubSubWriter<Data1mbPubSubType> writer(TEST_TOPIC_NAME);
writer.property_policy(property_policy).disable_builtin_transport().add_user_transport_to_pparams(testTransport);
writer.init();
writer.entity_property_policy(property_policy).disable_builtin_transport()
.add_user_transport_to_pparams(testTransport).init();
ASSERT_TRUE(writer.isInitialized());

PubSubReader<Data1mbPubSubType> reader(TEST_TOPIC_NAME);
Expand Down

0 comments on commit 43623c5

Please sign in to comment.