Skip to content

Commit

Permalink
Adjust tests for 2.6.x
Browse files Browse the repository at this point in the history
Signed-off-by: elianalf <[email protected]>
  • Loading branch information
elianalf committed Jun 26, 2024
1 parent 9299b06 commit 2b80553
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
4 changes: 4 additions & 0 deletions test/blackbox/common/DDSBlackboxTestsBasic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@
#include <fastdds/dds/topic/TypeSupport.hpp>
#include <fastrtps/types/TypesBase.h>

#include <rtps/transport/test_UDPv4Transport.h>

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

namespace eprosima {
namespace fastdds {
Expand Down
25 changes: 8 additions & 17 deletions test/blackbox/common/RTPSBlackboxTestsBasic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,8 @@ TEST(RTPS, max_output_message_size_participant)
reader.init();
EXPECT_TRUE(reader.isInitialized());

// Create the RTPSWriter
RTPSWithRegistrationWriter<Data1mbPubSubType> writer(TEST_TOPIC_NAME);
// Create the RTPSParticipants with the appropriate value for the property
auto testTransport = std::make_shared<eprosima::fastdds::rtps::test_UDPv4TransportDescriptor>();
const uint32_t segment_size = 1470;
Expand All @@ -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<uint32_t>(GET_PID()) % 230, patt);
ASSERT_NE(participant_writer, nullptr);

// Create the RTPSWriter
RTPSWithRegistrationWriter<Data1mbPubSubType> 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);

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

0 comments on commit 2b80553

Please sign in to comment.