Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion ddsrouter_core/test/unittest/efficiency/FastPayloadPoolTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ TEST(FastPayloadPoolTest, get_payload_from_src)
// Check payload pool is empty
ASSERT_TRUE(pool_->is_clean());
ASSERT_EQ(pool_->pointers_stored(), 0);

delete pool;
}

/**
Expand Down Expand Up @@ -214,6 +216,9 @@ TEST(FastPayloadPoolTest, get_payload_from_src_no_owner)
// release payload
pool_->release_payload(payload_target);
ASSERT_EQ(pool_->pointers_stored(), 0);

delete pool_aux;
delete pool;
}

/**
Expand All @@ -228,7 +233,7 @@ TEST(FastPayloadPoolTest, get_payload_from_src_negative)
{
eprosima::fastrtps::rtps::IPayloadPool* pool = new test::MockFastPayloadPool(); // Requires to be ptr to pass it to get_payload
test::MockFastPayloadPool* pool_ = static_cast<test::MockFastPayloadPool*>(pool);
eprosima::fastrtps::rtps::IPayloadPool* pool_aux; // nullptr
eprosima::fastrtps::rtps::IPayloadPool* pool_aux = nullptr; // nullptr

Payload payload_src;
Payload payload_target;
Expand All @@ -238,6 +243,8 @@ TEST(FastPayloadPoolTest, get_payload_from_src_negative)
payload_src,
pool_aux,
payload_target));

delete pool;
}
}

Expand Down Expand Up @@ -290,6 +297,8 @@ TEST(FastPayloadPoolTest, release_payload)
// Check payload pool is empty
ASSERT_TRUE(pool_->is_clean());
ASSERT_EQ(pool_->pointers_stored(), 0);

delete pool;
}

/**
Expand Down
13 changes: 12 additions & 1 deletion ddsrouter_core/test/unittest/efficiency/MapPayloadPoolTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ TEST(MapPayloadPoolTest, get_payload_from_src)
// Check payload pool is empty
ASSERT_TRUE(pool_->is_clean());
ASSERT_EQ(pool_->pointers_stored(), 0);

delete pool;
}

/**
Expand Down Expand Up @@ -230,6 +232,9 @@ TEST(MapPayloadPoolTest, get_payload_from_src_no_owner)
// release payload
pool_->release_payload(payload_target);
ASSERT_EQ(pool_->pointers_stored(), 0);

delete pool_aux;
delete pool;
}

/**
Expand Down Expand Up @@ -258,13 +263,15 @@ TEST(MapPayloadPoolTest, get_payload_from_src_negative)

// END : release payload
pool_aux.release_payload(payload_src);

delete pool;
}

// Source has size 0 and different owner
{
eprosima::fastrtps::rtps::IPayloadPool* pool = new test::MockMapPayloadPool(); // Requires to be ptr to pass it to get_payload
test::MockMapPayloadPool* pool_ = static_cast<test::MockMapPayloadPool*>(pool);
eprosima::fastrtps::rtps::IPayloadPool* pool_aux; // nullptr
eprosima::fastrtps::rtps::IPayloadPool* pool_aux = nullptr; // nullptr

Payload payload_src;
Payload payload_target;
Expand All @@ -274,6 +281,8 @@ TEST(MapPayloadPoolTest, get_payload_from_src_negative)
payload_src,
pool_aux,
payload_target));

delete pool;
}
}

Expand Down Expand Up @@ -330,6 +339,8 @@ TEST(MapPayloadPoolTest, release_payload)
// Check payload pool is empty
ASSERT_TRUE(pool_->is_clean());
ASSERT_EQ(pool_->pointers_stored(), 0);

delete pool;
}

/**
Expand Down