From 2e8424baa59de9fdff1ea676c2f758e57aa72a50 Mon Sep 17 00:00:00 2001 From: cferreiragonz Date: Tue, 11 Jun 2024 15:08:04 +0200 Subject: [PATCH] Refs #21121: Fix old payload tests Signed-off-by: cferreiragonz --- test/blackbox/common/DDSBlackboxTestsBasic.cpp | 3 ++- test/unittest/rtps/history/TopicPayloadPoolTests.cpp | 5 +---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/test/blackbox/common/DDSBlackboxTestsBasic.cpp b/test/blackbox/common/DDSBlackboxTestsBasic.cpp index 5534ed789ad..3fb378fde8d 100644 --- a/test/blackbox/common/DDSBlackboxTestsBasic.cpp +++ b/test/blackbox/common/DDSBlackboxTestsBasic.cpp @@ -797,7 +797,8 @@ TEST(DDSBasic, endpoint_custom_payload_pools) std::this_thread::sleep_for(std::chrono::seconds(2)); - ASSERT_EQ(reader_payload_pool->requested_payload_count, 1u); + // Two consecutive calls to get_payload are expected + ASSERT_EQ(reader_payload_pool->requested_payload_count, 2u); ASSERT_EQ(writer_payload_pool->requested_payload_count, 1u); participant->delete_contained_entities(); diff --git a/test/unittest/rtps/history/TopicPayloadPoolTests.cpp b/test/unittest/rtps/history/TopicPayloadPoolTests.cpp index 67f50ffaa23..7c4d524167b 100644 --- a/test/unittest/rtps/history/TopicPayloadPoolTests.cpp +++ b/test/unittest/rtps/history/TopicPayloadPoolTests.cpp @@ -346,16 +346,13 @@ void do_dynamic_topic_payload_pool_zero_size_test( change_to_add->writerGUID = GUID_t(GuidPrefix_t(), 1); change_to_add->sequenceNumber = SequenceNumber_t(0, 1); - //! Retrieve owner (nullptr) - IPayloadPool* payload_owner = change->serializedPayload.payload_owner; - //! get the payload of size 0. //! Allocate it on the pool //! Set change_to_add owner ASSERT_TRUE(pool->get_payload(change->serializedPayload, change_to_add->serializedPayload)); //! Now set the payload ownership on the source change - change->serializedPayload.payload_owner = payload_owner; + pool->get_payload(change_to_add->serializedPayload, change->serializedPayload); //! Release the payload from the source change pool->release_payload(change->serializedPayload);