Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Lucia Echevarria <[email protected]>
  • Loading branch information
LuciaEchevarria99 committed Sep 17, 2024
1 parent ab8187a commit 17f22eb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ddsrecorder/test/blackbox/mcap/McapFileCreationTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <fastdds/dds/xtypes/dynamic_types/DynamicTypeBuilder.hpp>
#include <fastdds/dds/xtypes/dynamic_types/DynamicTypeBuilderFactory.hpp>
#include <fastdds/dds/xtypes/type_representation/TypeObject.hpp>
#include <fastdds/dds/xtypes/utils.hpp>

#include <cpp_utils/ros2_mangling.hpp>

Expand Down Expand Up @@ -145,12 +146,13 @@ void create_publisher(
test::dynamic_type_ = eprosima::fastdds::dds::DynamicTypeBuilderFactory::get_instance()->create_type_w_type_object(
dyn_type_objects.complete_type_object)->build();

// Register the type in the Participant
participant_->register_type(type);

// Create the Publisher
eprosima::fastdds::dds::Publisher* publisher_ = participant_->create_publisher(PUBLISHER_QOS_DEFAULT, nullptr);

// Register the type support in the Participant
eprosima::fastdds::dds::TypeSupport dyn_type_support(new eprosima::fastdds::dds::DynamicPubSubType(test::dynamic_type_));
participant_->register_type(dyn_type_support);

// Create the DDS Topic
eprosima::fastdds::dds::Topic* topic_ = participant_->create_topic(topic_name, type_name,
TOPIC_QOS_DEFAULT);
Expand All @@ -176,7 +178,7 @@ eprosima::fastdds::dds::traits<eprosima::fastdds::dds::DynamicData>::ref_type se
dynamic_data_->set_uint32_value(dynamic_data_->get_member_id_by_name("index"), index);
// Set message
dynamic_data_->set_string_value(dynamic_data_->get_member_id_by_name("message"), test::send_message);
test::writer_->write(dynamic_data_.get());
test::writer_->write(&dynamic_data_);

EPROSIMA_LOG_INFO(DDSRECORDER_TEST, "Message published.");

Expand Down

0 comments on commit 17f22eb

Please sign in to comment.