From c7391f4466c42539070583ad744719d471e2541b Mon Sep 17 00:00:00 2001 From: Mario Dominguez Date: Mon, 17 Jun 2024 08:04:26 +0200 Subject: [PATCH] Refs #21131: Update DDSBlackboxTests* Signed-off-by: Mario Dominguez --- .../common/DDSBlackboxTestsAckPositive.cpp | 19 ++--- .../blackbox/common/DDSBlackboxTestsBasic.cpp | 10 ++- .../common/DDSBlackboxTestsContentFilter.cpp | 31 ++++---- .../common/DDSBlackboxTestsDataReader.cpp | 17 ++++- .../common/DDSBlackboxTestsDataWriter.cpp | 12 ++- .../common/DDSBlackboxTestsDiscovery.cpp | 27 +++---- .../common/DDSBlackboxTestsListeners.cpp | 74 +++++++++++++++---- .../DDSBlackboxTestsTransportSHMUDP.cpp | 3 - .../common/RTPSBlackboxTestsBasic.cpp | 36 +++++---- 9 files changed, 140 insertions(+), 89 deletions(-) diff --git a/test/blackbox/common/DDSBlackboxTestsAckPositive.cpp b/test/blackbox/common/DDSBlackboxTestsAckPositive.cpp index 2cb15e1616c..9f402e67464 100644 --- a/test/blackbox/common/DDSBlackboxTestsAckPositive.cpp +++ b/test/blackbox/common/DDSBlackboxTestsAckPositive.cpp @@ -38,9 +38,6 @@ #include #include -// TODO(jlbueno): remove private headers -#include - #include "BlackboxTests.hpp" #include "../api/dds-pim/CustomPayloadPool.hpp" #include "../api/dds-pim/PubSubReader.hpp" @@ -154,7 +151,7 @@ TEST(AcknackQos, RecoverAfterLosingCommunicationWithDisablePositiveAck) // Number of samples written by writer uint32_t writer_samples = 15; - auto testTransport = std::make_shared(); + auto test_transport = std::make_shared(); writer.keep_duration({2, 0}); //writer.history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS); @@ -163,7 +160,7 @@ TEST(AcknackQos, RecoverAfterLosingCommunicationWithDisablePositiveAck) writer.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS); //writer.lifespan_period(lifespan_s); writer.disable_builtin_transport(); - writer.add_user_transport_to_pparams(testTransport); + writer.add_user_transport_to_pparams(test_transport); writer.init(); reader.keep_duration({1, 0}); @@ -190,7 +187,7 @@ TEST(AcknackQos, RecoverAfterLosingCommunicationWithDisablePositiveAck) // Block reader until reception finished or timeout. reader.block_for_all(); - test_UDPv4Transport::test_UDPv4Transport_ShutdownAllNetwork = true; + test_transport->test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = true; data = default_helloworld_data_generator(writer_samples); reader.startReception(data); @@ -201,7 +198,7 @@ TEST(AcknackQos, RecoverAfterLosingCommunicationWithDisablePositiveAck) std::this_thread::sleep_for(std::chrono::seconds(1)); - test_UDPv4Transport::test_UDPv4Transport_ShutdownAllNetwork = false; + test_transport->test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = false; // Block reader until reception finished or timeout. reader.block_for_all(); @@ -220,7 +217,7 @@ TEST(AcknackQos, NotRecoverAfterLosingCommunicationWithDisablePositiveAck) // Number of samples written by writer uint32_t writer_samples = 15; - auto testTransport = std::make_shared(); + auto test_transport = std::make_shared(); writer.keep_duration({1, 0}); //writer.history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS); @@ -229,7 +226,7 @@ TEST(AcknackQos, NotRecoverAfterLosingCommunicationWithDisablePositiveAck) writer.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS); //writer.lifespan_period(lifespan_s); writer.disable_builtin_transport(); - writer.add_user_transport_to_pparams(testTransport); + writer.add_user_transport_to_pparams(test_transport); writer.init(); reader.keep_duration({1, 0}); @@ -256,7 +253,7 @@ TEST(AcknackQos, NotRecoverAfterLosingCommunicationWithDisablePositiveAck) // Block reader until reception finished or timeout. reader.block_for_all(); - test_UDPv4Transport::test_UDPv4Transport_ShutdownAllNetwork = true; + test_transport->test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = true; data = default_helloworld_data_generator(writer_samples); reader.startReception(data); @@ -267,7 +264,7 @@ TEST(AcknackQos, NotRecoverAfterLosingCommunicationWithDisablePositiveAck) std::this_thread::sleep_for(std::chrono::seconds(2)); - test_UDPv4Transport::test_UDPv4Transport_ShutdownAllNetwork = false; + test_transport->test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = false; // Block reader until reception finished or timeout. ASSERT_EQ(reader.block_for_all(std::chrono::seconds(1)), 0u); diff --git a/test/blackbox/common/DDSBlackboxTestsBasic.cpp b/test/blackbox/common/DDSBlackboxTestsBasic.cpp index bec88eb3b69..df3ae93d1c7 100644 --- a/test/blackbox/common/DDSBlackboxTestsBasic.cpp +++ b/test/blackbox/common/DDSBlackboxTestsBasic.cpp @@ -41,6 +41,7 @@ #include #include +#include "../utils/filter_helpers.hpp" #include "BlackboxTests.hpp" #include "mock/BlackboxMockConsumer.h" #include "../api/dds-pim/CustomPayloadPool.hpp" @@ -392,11 +393,14 @@ bool check_related_sample_identity_field( msg.pos = original_pos + qos_size; ParameterId_t pid{PID_SENTINEL}; - uint16_t plength = 0; bool valid = true; auto msg_pid_pos = msg.pos; - valid &= fastdds::rtps::CDRMessage::readUInt16(&msg, (uint16_t*)&pid); - valid &= fastdds::rtps::CDRMessage::readUInt16(&msg, &plength); + pid = (ParameterId_t)eprosima::fastdds::helpers::cdr_parse_u16( + (char*)&msg.buffer[msg.pos]); + msg.pos += 2; + uint16_t plength = eprosima::fastdds::helpers::cdr_parse_u16( + (char*)&msg.buffer[msg.pos]); + msg.pos += 2; if (pid == PID_SENTINEL) { diff --git a/test/blackbox/common/DDSBlackboxTestsContentFilter.cpp b/test/blackbox/common/DDSBlackboxTestsContentFilter.cpp index c27d5ff04dc..f38133c3c9b 100644 --- a/test/blackbox/common/DDSBlackboxTestsContentFilter.cpp +++ b/test/blackbox/common/DDSBlackboxTestsContentFilter.cpp @@ -30,11 +30,11 @@ #include #include #include -#include #include "../types/HelloWorldTypeObjectSupport.hpp" #include "../types/TestRegression3361PubSubTypes.h" #include "../types/TestRegression3361TypeObjectSupport.hpp" +#include "../utils/filter_helpers.hpp" #include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" @@ -65,14 +65,16 @@ struct ContentFilterInfoCounter // Skip extraFlags, read octetsToInlineQos, and calculate inline qos position. msg.pos += 2; - uint16_t to_inline_qos = 0; - fastdds::rtps::CDRMessage::readUInt16(&msg, &to_inline_qos); + uint16_t to_inline_qos = eprosima::fastdds::helpers::cdr_parse_u16( + (char*)&msg.buffer[msg.pos]); + msg.pos += 2; uint32_t inline_qos_pos = msg.pos + to_inline_qos; // Read writerId, and skip if built-in. msg.pos += 4; fastdds::rtps::GUID_t writer_guid; - fastdds::rtps::CDRMessage::readEntityId(&msg, &writer_guid.entityId); + writer_guid.entityId = eprosima::fastdds::helpers::cdr_parse_entity_id( + (char*)&msg.buffer[msg.pos]); msg.pos = old_pos; if (writer_guid.is_builtin()) @@ -87,11 +89,12 @@ struct ContentFilterInfoCounter msg.pos = inline_qos_pos; while (msg.pos < msg.length) { - uint16_t pid = 0; - uint16_t plen = 0; - - fastdds::rtps::CDRMessage::readUInt16(&msg, &pid); - fastdds::rtps::CDRMessage::readUInt16(&msg, &plen); + uint16_t pid = eprosima::fastdds::helpers::cdr_parse_u16( + (char*)&msg.buffer[msg.pos]); + msg.pos += 2; + uint16_t plen = eprosima::fastdds::helpers::cdr_parse_u16( + (char*)&msg.buffer[msg.pos]); + msg.pos += 2; uint32_t next_pos = msg.pos + plen; if (pid == PID_CONTENT_FILTER_INFO) @@ -102,13 +105,15 @@ struct ContentFilterInfoCounter if (plen >= 4 + 4 + 4 + 16) { // Read numBitmaps and skip bitmaps - uint32_t num_bitmaps = 0; - fastdds::rtps::CDRMessage::readUInt32(&msg, &num_bitmaps); + uint32_t num_bitmaps = eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; msg.pos += 4 * num_bitmaps; // Read numSignatures and keep maximum - uint32_t num_signatures = 0; - fastdds::rtps::CDRMessage::readUInt32(&msg, &num_signatures); + uint32_t num_signatures = eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; if (max_filter_signature_number < num_signatures) { max_filter_signature_number = num_signatures; diff --git a/test/blackbox/common/DDSBlackboxTestsDataReader.cpp b/test/blackbox/common/DDSBlackboxTestsDataReader.cpp index 79f9d03cb88..d002c1463bf 100644 --- a/test/blackbox/common/DDSBlackboxTestsDataReader.cpp +++ b/test/blackbox/common/DDSBlackboxTestsDataReader.cpp @@ -28,9 +28,10 @@ #include #include #include +#include #include -#include +#include "../utils/filter_helpers.hpp" #include "BlackboxTests.hpp" #include "PubSubParticipant.hpp" #include "PubSubReader.hpp" @@ -273,9 +274,17 @@ TEST(DDSDataReader, GetFirstUntakenInfoReturnsTheFirstValidChange) msg.pos += 2; // flags msg.pos += 2; // octets to inline quos - CDRMessage::readEntityId(&msg, &readerID); - CDRMessage::readEntityId(&msg, &writerID); - CDRMessage::readSequenceNumber(&msg, &sn); + readerID = eprosima::fastdds::helpers::cdr_parse_entity_id( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + writerID = eprosima::fastdds::helpers::cdr_parse_entity_id( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + sn.high = (int32_t)eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + sn.low = eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); // restore buffer pos msg.pos = old_pos; diff --git a/test/blackbox/common/DDSBlackboxTestsDataWriter.cpp b/test/blackbox/common/DDSBlackboxTestsDataWriter.cpp index de16f9a7fad..dc508c50e59 100644 --- a/test/blackbox/common/DDSBlackboxTestsDataWriter.cpp +++ b/test/blackbox/common/DDSBlackboxTestsDataWriter.cpp @@ -30,9 +30,7 @@ #include #include #include - -// TODO(jlbueno): remove private header -#include +#include #include "BlackboxTests.hpp" #include "PubSubReader.hpp" @@ -97,9 +95,9 @@ TEST_P(DDSDataWriter, WaitForAcknowledgmentInstance) PubSubWriter writer(TEST_TOPIC_NAME); PubSubReader reader(TEST_TOPIC_NAME); - auto testTransport = std::make_shared(); + auto test_transport = std::make_shared(); - writer.disable_builtin_transport().add_user_transport_to_pparams(testTransport).init(); + writer.disable_builtin_transport().add_user_transport_to_pparams(test_transport).init(); ASSERT_TRUE(writer.isInitialized()); reader.reliability(RELIABLE_RELIABILITY_QOS).init(); @@ -109,7 +107,7 @@ TEST_P(DDSDataWriter, WaitForAcknowledgmentInstance) reader.wait_discovery(); // Disable communication to prevent reception of ACKs - eprosima::fastdds::rtps::test_UDPv4Transport::test_UDPv4Transport_ShutdownAllNetwork = true; + test_transport->test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = true; auto data = default_keyedhelloworld_data_generator(2); @@ -139,7 +137,7 @@ TEST_P(DDSDataWriter, WaitForAcknowledgmentInstance) } // Enable communication and wait for acknowledgment - eprosima::fastdds::rtps::test_UDPv4Transport::test_UDPv4Transport_ShutdownAllNetwork = false; + test_transport->test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = false; EXPECT_TRUE(writer.waitForInstanceAcked(&sample_1, instance_handle_1, std::chrono::seconds(1))); EXPECT_TRUE(writer.waitForInstanceAcked(&sample_2, rtps::c_InstanceHandle_Unknown, std::chrono::seconds(1))); diff --git a/test/blackbox/common/DDSBlackboxTestsDiscovery.cpp b/test/blackbox/common/DDSBlackboxTestsDiscovery.cpp index 50c1018165f..5c400a818fb 100644 --- a/test/blackbox/common/DDSBlackboxTestsDiscovery.cpp +++ b/test/blackbox/common/DDSBlackboxTestsDiscovery.cpp @@ -30,14 +30,14 @@ #include #include #include +#include #include #include #include +#include #include -// TODO(jlbueno): remove private header -#include - +#include "../utils/filter_helpers.hpp" #include "BlackboxTests.hpp" #include "PubSubParticipant.hpp" #include "PubSubReader.hpp" @@ -437,8 +437,8 @@ TEST(DDSDiscovery, DDSNetworkInterfaceChangesAtRunTime) ASSERT_TRUE(datareader.isInitialized()); // datawriter: launch without interfaces - test_UDPv4Transport::simulate_no_interfaces = true; auto test_transport = std::make_shared(); + test_transport->test_transport_options->simulate_no_interfaces = true; datawriter.disable_builtin_transport().add_user_transport_to_pparams(test_transport).history_depth(100).init(); ASSERT_TRUE(datawriter.isInitialized()); @@ -461,7 +461,7 @@ TEST(DDSDiscovery, DDSNetworkInterfaceChangesAtRunTime) EXPECT_EQ(datareader.block_for_all(std::chrono::seconds(3)), 0u); // enable interfaces - test_UDPv4Transport::simulate_no_interfaces = false; + test_transport->test_transport_options->simulate_no_interfaces = false; datawriter.participant_set_qos(); // Wait for discovery @@ -1975,7 +1975,7 @@ TEST(DDSDiscovery, DataracePDP) participant_listener.discovery_future.wait(); // Shutdown auxiliary participant's network, so it will be removed after lease duration - test_UDPv4Transport::test_UDPv4Transport_ShutdownAllNetwork = true; + aux_udp_transport->test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = true; DomainParticipantFactory::get_instance()->delete_participant(aux_participant); std::this_thread::sleep_for(std::chrono::milliseconds(1500)); // Wait for longer than lease duration @@ -2041,13 +2041,14 @@ TEST(DDSDiscovery, pdp_simple_participants_exchange_same_pid_domain_id_and_disco { msg.pos = original_pos + qos_size; - ParameterId_t pid{eprosima::fastdds::dds::PID_SENTINEL}; - uint16_t plength = 0; + uint16_t pid = eprosima::fastdds::helpers::cdr_parse_u16( + (char*)&msg.buffer[msg.pos]); + msg.pos += 2; + uint16_t plength = eprosima::fastdds::helpers::cdr_parse_u16( + (char*)&msg.buffer[msg.pos]); + msg.pos += 2; bool valid = true; - valid &= eprosima::fastdds::rtps::CDRMessage::readUInt16(&msg, (uint16_t*)&pid); - valid &= eprosima::fastdds::rtps::CDRMessage::readUInt16(&msg, &plength); - if (pid == eprosima::fastdds::dds::PID_SENTINEL) { // PID_SENTINEL is always considered of length 0 @@ -2068,8 +2069,8 @@ TEST(DDSDiscovery, pdp_simple_participants_exchange_same_pid_domain_id_and_disco { if (pid == eprosima::fastdds::dds::PID_DOMAIN_ID) { - uint32_t domain_id = 0; - eprosima::fastdds::rtps::CDRMessage::readUInt32(&msg, &domain_id); + uint32_t domain_id = eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); if (domain_id == (uint32_t)GET_PID() % 230) { pid_was_found = true; diff --git a/test/blackbox/common/DDSBlackboxTestsListeners.cpp b/test/blackbox/common/DDSBlackboxTestsListeners.cpp index 43c8abec4cd..2af296c2269 100644 --- a/test/blackbox/common/DDSBlackboxTestsListeners.cpp +++ b/test/blackbox/common/DDSBlackboxTestsListeners.cpp @@ -21,10 +21,11 @@ #include #include #include +#include #include #include -#include +#include "../utils/filter_helpers.hpp" #include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" @@ -701,9 +702,17 @@ void sample_lost_test_dw_init( msg.pos += 2; // flags msg.pos += 2; // octets to inline quos - CDRMessage::readEntityId(&msg, &readerID); - CDRMessage::readEntityId(&msg, &writerID); - CDRMessage::readSequenceNumber(&msg, &sn); + readerID = eprosima::fastdds::helpers::cdr_parse_entity_id( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + writerID = eprosima::fastdds::helpers::cdr_parse_entity_id( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + sn.high = (int32_t)eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + sn.low = eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); // restore buffer pos msg.pos = old_pos; @@ -736,10 +745,21 @@ void sample_lost_test_dw_init( msg.pos += 2; // flags msg.pos += 2; // octets to inline quos - CDRMessage::readEntityId(&msg, &readerID); - CDRMessage::readEntityId(&msg, &writerID); - CDRMessage::readSequenceNumber(&msg, &sn); - CDRMessage::readUInt32(&msg, &first_fragment); + readerID = eprosima::fastdds::helpers::cdr_parse_entity_id( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + writerID = eprosima::fastdds::helpers::cdr_parse_entity_id( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + sn.high = (int32_t)eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + sn.low = eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + + first_fragment = eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); // restore buffer pos msg.pos = old_pos; @@ -1708,9 +1728,17 @@ void sample_rejected_test_dw_init( msg.pos += 2; // flags msg.pos += 2; // octets to inline quos - CDRMessage::readEntityId(&msg, &readerID); - CDRMessage::readEntityId(&msg, &writerID); - CDRMessage::readSequenceNumber(&msg, &sn); + readerID = eprosima::fastdds::helpers::cdr_parse_entity_id( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + writerID = eprosima::fastdds::helpers::cdr_parse_entity_id( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + sn.high = (int32_t)eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + sn.low = eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); // restore buffer pos msg.pos = old_pos; @@ -2901,9 +2929,17 @@ TEST(DDSStatus, sample_rejected_waitset) msg.pos += 2; // flags msg.pos += 2; // octets to inline quos - CDRMessage::readEntityId(&msg, &readerID); - CDRMessage::readEntityId(&msg, &writerID); - CDRMessage::readSequenceNumber(&msg, &sn); + readerID = eprosima::fastdds::helpers::cdr_parse_entity_id( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + writerID = eprosima::fastdds::helpers::cdr_parse_entity_id( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + sn.high = (int32_t)eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + sn.low = eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); // restore buffer pos msg.pos = old_pos; @@ -3088,8 +3124,14 @@ void reliable_on_unack_test_init( msg.pos += 2; // flags msg.pos += 2; // inline QoS msg.pos += 4; // readerID - CDRMessage::readEntityId(&msg, &writerID); - CDRMessage::readSequenceNumber(&msg, &sn); + writerID = eprosima::fastdds::helpers::cdr_parse_entity_id( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + sn.high = (int32_t)eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + sn.low = eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); // restore buffer pos msg.pos = old_pos; diff --git a/test/blackbox/common/DDSBlackboxTestsTransportSHMUDP.cpp b/test/blackbox/common/DDSBlackboxTestsTransportSHMUDP.cpp index 1d8b235a628..2b87994923a 100644 --- a/test/blackbox/common/DDSBlackboxTestsTransportSHMUDP.cpp +++ b/test/blackbox/common/DDSBlackboxTestsTransportSHMUDP.cpp @@ -25,9 +25,6 @@ #include #include -// TODO(jlbueno): remove private header -#include - #include "BlackboxTests.hpp" #include "mock/BlackboxMockConsumer.h" #include "PubSubReader.hpp" diff --git a/test/blackbox/common/RTPSBlackboxTestsBasic.cpp b/test/blackbox/common/RTPSBlackboxTestsBasic.cpp index 41ac24f7eb2..278ef3be793 100644 --- a/test/blackbox/common/RTPSBlackboxTestsBasic.cpp +++ b/test/blackbox/common/RTPSBlackboxTestsBasic.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -28,9 +29,6 @@ #include #include -// TODO(jlbueno): remove private headers -#include - #include "BlackboxTests.hpp" #include "RTPSAsSocketReader.hpp" #include "RTPSAsSocketWriter.hpp" @@ -396,8 +394,8 @@ TEST_P(RTPS, RTPSAsReliableWithRegistrationAndHolesInHistory) // To simulate lossy conditions int gaps_to_drop = 2; - auto testTransport = std::make_shared(); - testTransport->drop_gap_messages_filter_ = [&gaps_to_drop](rtps::CDRMessage_t& ) + auto test_transport = std::make_shared(); + test_transport->drop_gap_messages_filter_ = [&gaps_to_drop](rtps::CDRMessage_t& ) { if (gaps_to_drop > 0) { @@ -406,7 +404,7 @@ TEST_P(RTPS, RTPSAsReliableWithRegistrationAndHolesInHistory) } return false; }; - testTransport->dropLogLength = 1; + test_transport->dropLogLength = 1; reader. durability(eprosima::fastdds::rtps::DurabilityKind_t::TRANSIENT_LOCAL). @@ -416,7 +414,7 @@ TEST_P(RTPS, RTPSAsReliableWithRegistrationAndHolesInHistory) writer.durability(eprosima::fastdds::rtps::DurabilityKind_t::TRANSIENT_LOCAL). disable_builtin_transport(). - add_user_transport_to_pparams(testTransport).init(); + add_user_transport_to_pparams(test_transport).init(); ASSERT_TRUE(writer.isInitialized()); @@ -483,7 +481,7 @@ TEST(RTPS, RTPSUnavailableSampleGapWhenSeparateSending) RTPSWithRegistrationWriter writer(TEST_TOPIC_NAME); // To simulate lossy conditions - auto testTransport = std::make_shared(); + auto test_transport = std::make_shared(); reader. durability(eprosima::fastdds::rtps::DurabilityKind_t::TRANSIENT_LOCAL). @@ -498,7 +496,7 @@ TEST(RTPS, RTPSUnavailableSampleGapWhenSeparateSending) disable_builtin_transport(). reliability(eprosima::fastdds::rtps::ReliabilityKind_t::RELIABLE). history_depth(3). - add_user_transport_to_pparams(testTransport).init(); + add_user_transport_to_pparams(test_transport).init(); ASSERT_TRUE(writer.isInitialized()); @@ -525,7 +523,7 @@ TEST(RTPS, RTPSUnavailableSampleGapWhenSeparateSending) reader.expected_data(expected); writer.send(data); - test_UDPv4Transport::test_UDPv4Transport_ShutdownAllNetwork = true; + test_transport->test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = true; std::this_thread::sleep_for(std::chrono::seconds(1)); @@ -543,7 +541,7 @@ TEST(RTPS, RTPSUnavailableSampleGapWhenSeparateSending) std::this_thread::sleep_for(std::chrono::seconds(1)); - test_UDPv4Transport::test_UDPv4Transport_ShutdownAllNetwork = false; + test_transport->test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = false; std::this_thread::sleep_for(std::chrono::seconds(1)); @@ -689,8 +687,8 @@ TEST(RTPS, RTPSNetworkInterfaceChangesAtRunTime) ASSERT_TRUE(reader.isInitialized()); // writer: launch without interfaces - test_UDPv4Transport::simulate_no_interfaces = true; auto test_transport = std::make_shared(); + test_transport->test_transport_options->simulate_no_interfaces = true; writer.disable_builtin_transport().add_user_transport_to_pparams(test_transport).init(); ASSERT_TRUE(writer.isInitialized()); @@ -715,7 +713,7 @@ TEST(RTPS, RTPSNetworkInterfaceChangesAtRunTime) EXPECT_EQ(reader.getReceivedCount(), 0u); // enable interfaces - test_UDPv4Transport::simulate_no_interfaces = false; + test_transport->test_transport_options->simulate_no_interfaces = false; writer.participant_update_attributes(); // Wait for discovery @@ -1163,10 +1161,10 @@ TEST(RTPS, max_output_message_size_participant) EXPECT_TRUE(reader.isInitialized()); // Create the RTPSParticipants with the appropriate value for the property - auto testTransport = std::make_shared(); + auto test_transport = std::make_shared(); const uint32_t segment_size = 1470; std::string segment_size_str = std::to_string(segment_size); - testTransport->messages_filter_ = [segment_size](eprosima::fastdds::rtps::CDRMessage_t& datagram) + test_transport->messages_filter_ = [segment_size](eprosima::fastdds::rtps::CDRMessage_t& datagram) { EXPECT_LE(datagram.length, segment_size); // Never drop samples @@ -1175,7 +1173,7 @@ TEST(RTPS, max_output_message_size_participant) eprosima::fastdds::rtps::RTPSParticipantAttributes patt; patt.useBuiltinTransports = false; - patt.userTransports.push_back(testTransport); + patt.userTransports.push_back(test_transport); patt.properties.properties().emplace_back("fastdds.max_message_size", segment_size_str); eprosima::fastdds::rtps::RTPSParticipant* participant_writer = eprosima::fastdds::rtps::RTPSDomain::createParticipant(static_cast(GET_PID()) % 230, patt); @@ -1213,8 +1211,8 @@ TEST(RTPS, max_output_message_size_writer) const uint32_t segment_size = 1470; std::string segment_size_str = std::to_string(segment_size); - auto testTransport = std::make_shared(); - testTransport->messages_filter_ = [segment_size](eprosima::fastdds::rtps::CDRMessage_t& datagram) + auto test_transport = std::make_shared(); + test_transport->messages_filter_ = [segment_size](eprosima::fastdds::rtps::CDRMessage_t& datagram) { EXPECT_LE(datagram.length, segment_size); // Never drop samples @@ -1222,7 +1220,7 @@ TEST(RTPS, max_output_message_size_writer) }; RTPSWithRegistrationWriter writer(TEST_TOPIC_NAME); writer.add_property("fastdds.max_message_size", segment_size_str). - disable_builtin_transport().add_user_transport_to_pparams(testTransport).init(); + disable_builtin_transport().add_user_transport_to_pparams(test_transport).init(); ASSERT_TRUE(writer.isInitialized()); RTPSWithRegistrationReader reader(TEST_TOPIC_NAME);