Skip to content

Commit

Permalink
Reformat to delete extra code
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Perez <jjperez@ekumenlabs.com>
  • Loading branch information
Blast545 committed Jul 22, 2020
1 parent 6de0b1c commit 21c5577
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions rcl/test/rcl/test_events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -783,27 +783,26 @@ TEST_F(TestEventFixture, test_sub_message_lost_event)
rcl_ret_t ret = setup_subscriber(subscription_qos_profile);
ASSERT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;

if (is_fastrtps) {
// Check not supported
subscription_event = rcl_get_zero_initialized_event();
subscription_event = rcl_get_zero_initialized_event();
ret = rcl_subscription_event_init(
&subscription_event,
&subscription,
RCL_SUBSCRIPTION_MESSAGE_LOST);
EXPECT_EQ(ret, RCL_RET_UNSUPPORTED);

// clean up and exit test early
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT(
{
ret = rcl_event_fini(&subscription_event);
EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
ret = rcl_subscription_fini(&subscription, this->node_ptr);
EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
});

if (is_fastrtps) {
// Check not supported
EXPECT_EQ(ret, RCL_RET_UNSUPPORTED);

// clean up and exit test early
return;
} else {
subscription_event = rcl_get_zero_initialized_event();
ret = rcl_subscription_event_init(
&subscription_event,
&subscription,
RCL_SUBSCRIPTION_MESSAGE_LOST);
EXPECT_EQ(ret, RCL_RET_OK);
}

Expand All @@ -814,12 +813,6 @@ TEST_F(TestEventFixture, test_sub_message_lost_event)
EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
EXPECT_EQ(message_lost_status.total_count, 0u);
EXPECT_EQ(message_lost_status.total_count_change, 0u);

// clean up
ret = rcl_event_fini(&subscription_event);
EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
ret = rcl_subscription_fini(&subscription, this->node_ptr);
EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
}

static
Expand Down

0 comments on commit 21c5577

Please sign in to comment.