Skip to content

Commit

Permalink
Refs #21709: Add one RTPS participant test and Update comments to lat…
Browse files Browse the repository at this point in the history
…est design

Signed-off-by: Mario Dominguez <[email protected]>
  • Loading branch information
Mario-DL committed Sep 30, 2024
1 parent 828275f commit 1e15733
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
35 changes: 34 additions & 1 deletion test/blackbox/common/RTPSBlackboxTestsBasic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1403,7 +1403,40 @@ bool validate_subscription_builtin_topic_data(
}

/**
* Tests get_publication_info() get_subscription_info() RTPSParticipant APIs
* Refers to RTPS-PART-API-GSI-GPI-01 from the test plan.
*/
TEST(RTPS, rtps_participant_get_pubsub_info_negative)
{
RTPSWithRegistrationWriter<HelloWorldPubSubType> writer(TEST_TOPIC_NAME);
RTPSWithRegistrationReader<HelloWorldPubSubType> reader(TEST_TOPIC_NAME);

writer.reliability(BEST_EFFORT)
.init();
reader.reliability(RELIABLE)
.init();

ASSERT_TRUE(writer.isInitialized());
ASSERT_TRUE(reader.isInitialized());

writer.wait_discovery(std::chrono::seconds(1));

ASSERT_FALSE(writer.get_matched());
ASSERT_FALSE(reader.get_matched());

eprosima::fastdds::dds::builtin::PublicationBuiltinTopicData pubdata;
eprosima::fastdds::dds::builtin::SubscriptionBuiltinTopicData subdata;

// Get publication info from the reader participant and validate it
bool ret = reader.get_rtps_participant()->get_publication_info(pubdata, writer.guid());
ASSERT_FALSE(ret);

// Get subscription info from the reader participant and validate it
ret = writer.get_rtps_participant()->get_subscription_info(subdata, reader.guid());
ASSERT_FALSE(ret);
}

/**
* Refers to RTPS-PART-API-GSI-GPI-02 from the test plan.
*/
TEST_P(RTPS, rtps_participant_get_pubsub_info)
{
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox/common/RTPSBlackboxTestsReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class RTPSReaderTests : public testing::TestWithParam<communication_type>
};

/**
* Tests matched_writers_guids() RTPSReader API
* Refers to RTPS-READER-API-MWG-01 from the test plan.
*/
TEST_P(RTPSReaderTests, rtpsreader_matched_writers_guids)
{
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox/common/RTPSBlackboxTestsWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class RTPSWriterTests : public testing::TestWithParam<communication_type>
};

/**
* Tests matched_readers_guids() RTPSWriter API
* Refers to RTPS-WRITER-API-MRG-01 from the test plan.
*/
TEST_P(RTPSWriterTests, rtpswriter_matched_readers_guids)
{
Expand Down

0 comments on commit 1e15733

Please sign in to comment.