Skip to content

Commit

Permalink
Refs #21121: Fix old payload tests
Browse files Browse the repository at this point in the history
Signed-off-by: cferreiragonz <[email protected]>
  • Loading branch information
cferreiragonz committed Jun 11, 2024
1 parent befd466 commit bc4a145
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 2 additions & 1 deletion test/blackbox/common/DDSBlackboxTestsBasic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
5 changes: 1 addition & 4 deletions test/unittest/rtps/history/TopicPayloadPoolTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit bc4a145

Please sign in to comment.