From 98b62fb32be6757fc96b209b4fcfb1f54ceff79b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Gonz=C3=A1lez=20Moreno?= Date: Fri, 31 May 2024 12:46:10 +0200 Subject: [PATCH] Refs #21044. Fix statistics tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ricardo González Moreno --- ...SBlackboxTestsStatisticsDomainParticipant.cpp | 16 ++++++++++++++++ .../dds/StatisticsDomainParticipantTests.cpp | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/test/blackbox/common/DDSBlackboxTestsStatisticsDomainParticipant.cpp b/test/blackbox/common/DDSBlackboxTestsStatisticsDomainParticipant.cpp index 81a80a88ff3..83d5882f274 100644 --- a/test/blackbox/common/DDSBlackboxTestsStatisticsDomainParticipant.cpp +++ b/test/blackbox/common/DDSBlackboxTestsStatisticsDomainParticipant.cpp @@ -260,20 +260,28 @@ TEST(StatisticsDomainParticipant, CreateParticipant) // Create TypeSupports eprosima::fastdds::dds::TypeSupport history_latency_type( new eprosima::fastdds::statistics::WriterReaderDataPubSubType); + history_latency_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport network_latency_type( new eprosima::fastdds::statistics::Locator2LocatorDataPubSubType); + network_latency_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport throughput_type( new eprosima::fastdds::statistics::EntityDataPubSubType); + throughput_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport rtps_traffic_type( new eprosima::fastdds::statistics::Entity2LocatorTrafficPubSubType); + rtps_traffic_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport count_type( new eprosima::fastdds::statistics::EntityCountPubSubType); + count_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport discovery_type( new eprosima::fastdds::statistics::DiscoveryTimePubSubType); + discovery_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport sample_identity_count_type( new eprosima::fastdds::statistics::SampleIdentityCountPubSubType); + sample_identity_count_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport physical_data_type( new eprosima::fastdds::statistics::PhysicalDataPubSubType); + physical_data_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport null_type(nullptr); // Create statistics DataReaders @@ -436,20 +444,28 @@ TEST(StatisticsDomainParticipant, CreateParticipantUsingXML) // Create TypeSupports eprosima::fastdds::dds::TypeSupport history_latency_type( new eprosima::fastdds::statistics::WriterReaderDataPubSubType); + history_latency_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport network_latency_type( new eprosima::fastdds::statistics::Locator2LocatorDataPubSubType); + network_latency_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport throughput_type( new eprosima::fastdds::statistics::EntityDataPubSubType); + throughput_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport rtps_traffic_type( new eprosima::fastdds::statistics::Entity2LocatorTrafficPubSubType); + rtps_traffic_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport count_type( new eprosima::fastdds::statistics::EntityCountPubSubType); + count_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport discovery_type( new eprosima::fastdds::statistics::DiscoveryTimePubSubType); + discovery_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport sample_identity_count_type( new eprosima::fastdds::statistics::SampleIdentityCountPubSubType); + sample_identity_count_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport physical_data_type( new eprosima::fastdds::statistics::PhysicalDataPubSubType); + physical_data_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport null_type(nullptr); // Create statistics DataReaders diff --git a/test/unittest/statistics/dds/StatisticsDomainParticipantTests.cpp b/test/unittest/statistics/dds/StatisticsDomainParticipantTests.cpp index c3d0db2e535..eccbaf80977 100644 --- a/test/unittest/statistics/dds/StatisticsDomainParticipantTests.cpp +++ b/test/unittest/statistics/dds/StatisticsDomainParticipantTests.cpp @@ -247,13 +247,21 @@ TEST_F(StatisticsDomainParticipantTests, EnableDisableStatisticsDataWriterTest) // 3. Create TypeSupports for the different DataTypes eprosima::fastdds::dds::TypeSupport history_latency_type(new WriterReaderDataPubSubType); + history_latency_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport network_latency_type(new Locator2LocatorDataPubSubType); + network_latency_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport throughput_type(new EntityDataPubSubType); + throughput_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport rtps_traffic_type(new Entity2LocatorTrafficPubSubType); + rtps_traffic_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport count_type(new EntityCountPubSubType); + count_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport discovery_type(new DiscoveryTimePubSubType); + discovery_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport sample_identity_count_type(new SampleIdentityCountPubSubType); + sample_identity_count_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport physical_data_type(new PhysicalDataPubSubType); + physical_data_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport null_type(nullptr); // 4. Check that the types are not registered yet @@ -514,13 +522,21 @@ TEST_F(StatisticsDomainParticipantTests, CreateParticipantWithInvalidTopicName) // 2. Check topics/types // Create TypeSupports eprosima::fastdds::dds::TypeSupport history_latency_type(new WriterReaderDataPubSubType); + history_latency_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport network_latency_type(new Locator2LocatorDataPubSubType); + network_latency_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport throughput_type(new EntityDataPubSubType); + throughput_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport rtps_traffic_type(new Entity2LocatorTrafficPubSubType); + rtps_traffic_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport count_type(new EntityCountPubSubType); + count_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport discovery_type(new DiscoveryTimePubSubType); + discovery_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport sample_identity_count_type(new SampleIdentityCountPubSubType); + sample_identity_count_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport physical_data_type(new PhysicalDataPubSubType); + physical_data_type->register_type_object_representation(); eprosima::fastdds::dds::TypeSupport null_type(nullptr); EXPECT_EQ(null_type, participant->find_type(history_latency_type.get_type_name()));