Skip to content

Commit

Permalink
Refs #21044. Fix statistics tests
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>
  • Loading branch information
richiware committed May 31, 2024
1 parent 5951850 commit 98b62fb
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions test/unittest/statistics/dds/StatisticsDomainParticipantTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()));
Expand Down

0 comments on commit 98b62fb

Please sign in to comment.