Skip to content

Commit

Permalink
Comment on message loaning mocks.
Browse files Browse the repository at this point in the history
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
  • Loading branch information
hidmic committed Aug 11, 2020
1 parent 6158ea2 commit 2f3875f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rcl/test/rcl/test_subscription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -771,8 +771,10 @@ TEST_F(CLASSNAME(TestSubscriptionFixture, RMW_IMPLEMENTATION), test_subscription
mocking_utils::prepare_patch("lib:rcl", rmw_take_loaned_message_with_info);
auto patch_return =
mocking_utils::prepare_patch("lib:rcl", rmw_return_loaned_message_from_subscription);
// Only if rmw supports the functionality

if (!rcl_subscription_can_loan_messages(&subscription)) {
// If rcl (and ultimately rmw) does not support message loaning,
// mock it so that a unit test can still be constructed.
patch_take.then_call(
[](const rmw_subscription_t * subscription,
void ** loaned_message, bool * taken,
Expand Down

0 comments on commit 2f3875f

Please sign in to comment.