Skip to content

Commit 2087ccd

Browse files
author
Juanjo Garcia
committed
Refs #22658: Included reviewer suggestions
Signed-off-by: Juanjo Garcia <[email protected]>
1 parent 92c93c3 commit 2087ccd

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

src/cpp/rtps/writer/StatefulWriter.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1521,6 +1521,8 @@ void StatefulWriter::check_acked_status()
15211521

15221522
if (min_low_mark >= get_seq_num_min())
15231523
{
1524+
// get_seq_num_min() returns SequenceNumber_t::unknown() when the history is empty.
1525+
// Thus, it is set to 2 to indicate that all samples have been removed.
15241526
may_remove_change_ = (get_seq_num_min() == SequenceNumber_t::unknown()) ? 2 : 1;
15251527
}
15261528

test/blackbox/api/dds-pim/PubSubWriter.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -894,10 +894,10 @@ class PubSubWriter
894894

895895
PubSubWriter& reliability(
896896
const eprosima::fastdds::dds::ReliabilityQosPolicyKind kind,
897-
int max_blocking_time)
897+
eprosima::fastdds::dds::Duration_t max_blocking_time)
898898
{
899899
datawriter_qos_.reliability().kind = kind;
900-
datawriter_qos_.reliability().max_blocking_time.seconds = max_blocking_time;
900+
datawriter_qos_.reliability().max_blocking_time = max_blocking_time;
901901
return *this;
902902
}
903903

test/blackbox/common/DDSBlackboxTestsListeners.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -3437,7 +3437,7 @@ TEST(DDSStatus, keyed_reliable_positive_acks_disabled_on_unack_sample_removed)
34373437
}
34383438

34393439
/*!
3440-
* Regression Test for 22658: when he entire history is acked in volatile, given that the entries are deleted from the
3440+
* Regression Test for 22658: when the entire history is acked in volatile, given that the entries are deleted from the
34413441
* history, check_acked_status satisfies min_low_mark >= get_seq_num_min() because seq_num_min is unknown. This makes
34423442
* try_remove to fail, because it tries to remove changes but there were none. This causes prepare_change to not
34433443
* perform the changes, since the history was full and could not delete any changes.
@@ -3448,7 +3448,7 @@ TEST(DDSStatus, entire_history_acked_volatile_unknown_pointer)
34483448
PubSubWriter<HelloWorldPubSubType> writer(TEST_TOPIC_NAME);
34493449
PubSubReader<HelloWorldPubSubType> reader(TEST_TOPIC_NAME);
34503450

3451-
writer.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS, 200)
3451+
writer.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS, eprosima::fastdds::dds::Duration_t (200, 0))
34523452
.durability_kind(eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS)
34533453
.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS)
34543454
.resource_limits_max_instances(1)
@@ -3469,6 +3469,9 @@ TEST(DDSStatus, entire_history_acked_volatile_unknown_pointer)
34693469
auto data = default_helloworld_data_generator(2);
34703470
for (auto sample : data)
34713471
{
3472+
// A value of true means that the sample was sent successfully.
3473+
// This aligns with the expected behaviour of having the history
3474+
// acknowledged and emptied before the next message.
34723475
EXPECT_TRUE(writer.send_sample(sample));
34733476
}
34743477
}

0 commit comments

Comments
 (0)