Skip to content

Commit

Permalink
Refs #20543: Include unit test
Browse files Browse the repository at this point in the history
Signed-off-by: JesusPoderoso <[email protected]>
  • Loading branch information
JesusPoderoso committed Mar 11, 2024
1 parent 439ecad commit 48f5bad
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion test/unittest/dds/participant/ParticipantTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,20 @@ TEST(ParticipantTests, CreateDomainParticipantWithProfile)
ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK);
}

// Task #20543 participant creation loading values from env
TEST(ParticipantTests, CreateDomainParticipantWithDefaultProfile)
{
setenv("FASTDDS_DEFAULT_PROFILES_FILE", "test_xml_profile.xml", 1); // overwrite if exists
//participant using default profile
DomainParticipant* participant =
DomainParticipantFactory::get_instance()->create_participant_with_default_profile();
uint32_t domain_id = 123u; // default domain id from test_xml_profile.xml
ASSERT_NE(participant, nullptr);
ASSERT_EQ(participant->get_domain_id(), domain_id); //Keep the DID given to the method, not the one on the profile
ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK);
unsetenv("FASTDDS_DEFAULT_PROFILES_FILE");
}

TEST(ParticipantTests, GetParticipantProfileQos)
{
DomainParticipantFactory::get_instance()->load_XML_profiles_file("test_xml_profile.xml");
Expand All @@ -589,7 +603,6 @@ TEST(ParticipantTests, GetParticipantProfileQos)
ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK);
}


TEST(ParticipantTests, DeleteDomainParticipant)
{
DomainParticipant* participant =
Expand Down

0 comments on commit 48f5bad

Please sign in to comment.