diff --git a/test/blackbox/common/DDSBlackboxTestsBasic.cpp b/test/blackbox/common/DDSBlackboxTestsBasic.cpp index 219c1615a2a..d387d796248 100644 --- a/test/blackbox/common/DDSBlackboxTestsBasic.cpp +++ b/test/blackbox/common/DDSBlackboxTestsBasic.cpp @@ -35,8 +35,12 @@ #include #include +#include + #include "BlackboxTests.hpp" #include "../types/HelloWorldPubSubTypes.h" +#include "PubSubReader.hpp" +#include "PubSubWriter.hpp" namespace eprosima { namespace fastdds { diff --git a/test/blackbox/common/RTPSBlackboxTestsBasic.cpp b/test/blackbox/common/RTPSBlackboxTestsBasic.cpp index 42d93a61fb6..fd2d8f15da5 100644 --- a/test/blackbox/common/RTPSBlackboxTestsBasic.cpp +++ b/test/blackbox/common/RTPSBlackboxTestsBasic.cpp @@ -902,6 +902,8 @@ TEST(RTPS, max_output_message_size_participant) reader.init(); EXPECT_TRUE(reader.isInitialized()); + // Create the RTPSWriter + RTPSWithRegistrationWriter writer(TEST_TOPIC_NAME); // Create the RTPSParticipants with the appropriate value for the property auto testTransport = std::make_shared(); const uint32_t segment_size = 1470; @@ -912,23 +914,15 @@ TEST(RTPS, max_output_message_size_participant) // Never drop samples return false; }; - - eprosima::fastrtps::rtps::RTPSParticipantAttributes patt; - patt.useBuiltinTransports = false; - patt.userTransports.push_back(testTransport); - patt.properties.properties().emplace_back("fastdds.max_message_size", segment_size_str); - eprosima::fastrtps::rtps::RTPSParticipant* participant_writer = - eprosima::fastrtps::rtps::RTPSDomain::createParticipant(static_cast(GET_PID()) % 230, patt); - ASSERT_NE(participant_writer, nullptr); - - // Create the RTPSWriter - RTPSWithRegistrationWriter writer(TEST_TOPIC_NAME, participant_writer); - writer.init(); + writer.add_user_transport_to_pparams(testTransport). + disable_builtin_transport(). + add_property("fastdds.max_message_size", segment_size_str). + init(); EXPECT_TRUE(writer.isInitialized()); // Wait for discovery - writer.wait_discovery(1, std::chrono::seconds(2)); - reader.wait_discovery(1, std::chrono::seconds(2)); + writer.wait_discovery(std::chrono::seconds(2)); + reader.wait_discovery(std::chrono::seconds(2)); EXPECT_EQ(writer.get_matched(), 1u); EXPECT_EQ(reader.get_matched(), 1u); @@ -942,9 +936,6 @@ TEST(RTPS, max_output_message_size_participant) // Wait for reception reader.block_for_all(std::chrono::seconds(1)); EXPECT_EQ(reader.getReceivedCount(), 1u); - - /* Tear-down */ - eprosima::fastrtps::rtps::RTPSDomain::removeRTPSParticipant(participant_writer); } /* Maximum number of bytes allowed for an RTPS datagram generated by this writer. */