Skip to content

Commit 2c80d13

Browse files
author
Miguel Barro
committed
Refs 10805. Update participant statistics listener dependencies.
1 parent ede54c0 commit 2c80d13

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/cpp/statistics/rtps/StatisticsBase.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ bool StatisticsParticipantImpl::are_writers_involved(
140140
| RESENT_DATAS \
141141
| HEARTBEAT_COUNT \
142142
| GAP_COUNT \
143-
| DATA_COUNT;
143+
| DATA_COUNT \
144+
| SAMPLE_DATAS;
144145

145146
return writers_maks & mask;
146147
}

test/unittest/statistics/rtps/RTPSStatisticsTests.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ TEST_F(RTPSStatisticsTests, statistics_rpts_listener_management)
515515
* - RESENT_DATAS callbacks are performed for DATA submessages demanded by the readers
516516
* - ACKNACK_COUNT callbacks are performed
517517
* - HEARBEAT_COUNT callbacks are performed
518+
* - SAMPLE_DATAS callbacks are performed
518519
*/
519520
TEST_F(RTPSStatisticsTests, statistics_rpts_listener_callbacks)
520521
{
@@ -567,7 +568,7 @@ TEST_F(RTPSStatisticsTests, statistics_rpts_listener_callbacks)
567568
// writer callbacks through participant listener
568569
auto participant_writer_listener = make_shared<MockListener>();
569570
ASSERT_TRUE(participant_->add_statistics_listener(participant_writer_listener,
570-
EventKind::DATA_COUNT | EventKind::RESENT_DATAS));
571+
EventKind::DATA_COUNT | EventKind::RESENT_DATAS | EventKind::SAMPLE_DATAS));
571572

572573
// writer specific callbacks
573574
auto writer_listener = make_shared<MockListener>();
@@ -602,6 +603,8 @@ TEST_F(RTPSStatisticsTests, statistics_rpts_listener_callbacks)
602603
.Times(AtLeast(1));
603604
EXPECT_CALL(*participant_writer_listener, on_resent_count)
604605
.Times(AtLeast(1));
606+
EXPECT_CALL(*participant_writer_listener, on_sample_datas)
607+
.Times(AtLeast(1));
605608

606609
// + RTPSReader: SUBSCRIPTION_THROUGHPUT,
607610
// SAMPLE_DATAS & PHYSICAL_DATA
@@ -634,7 +637,7 @@ TEST_F(RTPSStatisticsTests, statistics_rpts_listener_callbacks)
634637

635638
EXPECT_TRUE(participant_->remove_statistics_listener(participant_listener, EventKind::RTPS_SENT));
636639
EXPECT_TRUE(participant_->remove_statistics_listener(participant_writer_listener,
637-
EventKind::DATA_COUNT | EventKind::RESENT_DATAS));
640+
EventKind::DATA_COUNT | EventKind::RESENT_DATAS | EventKind::SAMPLE_DATAS));
638641
EXPECT_TRUE(participant_->remove_statistics_listener(participant_reader_listener, EventKind::ACKNACK_COUNT));
639642
}
640643

0 commit comments

Comments
 (0)