Skip to content

Commit

Permalink
Refs #20401: Fix segfault in Mac tests
Browse files Browse the repository at this point in the history
Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com>
  • Loading branch information
JesusPoderoso committed Apr 4, 2024
1 parent 33103f1 commit 15ed027
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
8 changes: 5 additions & 3 deletions test/unittest/dds/publisher/DataWriterTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1587,9 +1587,11 @@ TEST(DataWriterTests, history_depth_max_samples_per_instance_warning)
ASSERT_EQ(wait_for_log_entries(expected_entries, retries, wait_ms), expected_entries);

/* Tear down */
participant->delete_contained_entities();
DomainParticipantFactory::get_instance()->delete_participant(participant);
Log::KillThread();
ASSERT_EQ(publisher->delete_datawriter(datawriter_1), ReturnCode_t::RETCODE_OK);
ASSERT_EQ(publisher->delete_datawriter(datawriter_2), ReturnCode_t::RETCODE_OK);
ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK);
ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK);
ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK);
}

} // namespace dds
Expand Down
9 changes: 6 additions & 3 deletions test/unittest/dds/subscriber/DataReaderTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2723,9 +2723,12 @@ TEST_F(DataReaderTests, history_depth_max_samples_per_instance_warning)
ASSERT_EQ(wait_for_log_entries(expected_entries, retries, wait_ms), expected_entries);

/* Tear down */
participant->delete_contained_entities();
DomainParticipantFactory::get_instance()->delete_participant(participant);
Log::KillThread();
ASSERT_EQ(subscriber->delete_datareader(datareader_1), ReturnCode_t::RETCODE_OK);
ASSERT_EQ(subscriber->delete_datareader(datareader_2), ReturnCode_t::RETCODE_OK);
ASSERT_EQ(participant->delete_subscriber(subscriber), ReturnCode_t::RETCODE_OK);
ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK);
ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK);

}

} // namespace dds
Expand Down

0 comments on commit 15ed027

Please sign in to comment.