code style only: wrap after open parenthesis if not in one line (#565)

Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
This commit is contained in:
Dirk Thomas 2020-02-03 09:06:35 -08:00 committed by GitHub
parent 7537f83044
commit 4b9c0a30be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
43 changed files with 944 additions and 538 deletions

View file

@ -32,7 +32,8 @@ protected:
rcl_init_options_t init_options = rcl_get_zero_initialized_init_options();
ret = rcl_init_options_init(&init_options, rcl_get_default_allocator());
ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str;
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT({
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT(
{
EXPECT_EQ(RCL_RET_OK, rcl_init_options_fini(&init_options)) << rcl_get_error_string().str;
});
this->context = rcl_get_zero_initialized_context();

View file

@ -43,7 +43,8 @@ protected:
rcl_init_options_t init_options = rcl_get_zero_initialized_init_options();
ret = rcl_init_options_init(&init_options, allocator);
ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str;
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT({
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT(
{
EXPECT_EQ(RCL_RET_OK, rcl_init_options_fini(&init_options)) << rcl_get_error_string().str;
});
context = rcl_get_zero_initialized_context();
@ -210,7 +211,8 @@ TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_valid_goal_c
// Check that the goal request was received correctly
EXPECT_EQ(outgoing_goal_request.goal.order, incoming_goal_request.goal.order);
EXPECT_TRUE(uuidcmp(
EXPECT_TRUE(
uuidcmp(
outgoing_goal_request.goal_id.uuid,
incoming_goal_request.goal_id.uuid));
@ -315,7 +317,8 @@ TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_valid_cancel
EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
// Check that the cancel request was received correctly
EXPECT_TRUE(uuidcmp(
EXPECT_TRUE(
uuidcmp(
outgoing_cancel_request.goal_info.goal_id.uuid,
incoming_cancel_request.goal_info.goal_id.uuid));
EXPECT_EQ(
@ -326,7 +329,8 @@ TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_valid_cancel
incoming_cancel_request.goal_info.stamp.nanosec);
// Initialize cancel request
ASSERT_TRUE(action_msgs__msg__GoalInfo__Sequence__init(
ASSERT_TRUE(
action_msgs__msg__GoalInfo__Sequence__init(
&outgoing_cancel_response.goals_canceling, 2));
init_test_uuid0(outgoing_cancel_response.goals_canceling.data[0].goal_id.uuid);
outgoing_cancel_response.goals_canceling.data[0].stamp.sec = 102;
@ -437,12 +441,14 @@ TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_valid_result
EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
// Check that the result request was received correctly
EXPECT_TRUE(uuidcmp(
EXPECT_TRUE(
uuidcmp(
outgoing_result_request.goal_id.uuid,
incoming_result_request.goal_id.uuid));
// Initialize result response
ASSERT_TRUE(rosidl_generator_c__int32__Sequence__init(
ASSERT_TRUE(
rosidl_generator_c__int32__Sequence__init(
&outgoing_result_response.result.sequence, 4));
outgoing_result_response.result.sequence.data[0] = 0;
outgoing_result_response.result.sequence.data[1] = 1;
@ -491,7 +497,8 @@ TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_valid_result
ASSERT_EQ(
outgoing_result_response.result.sequence.size,
incoming_result_response.result.sequence.size);
EXPECT_TRUE(!memcmp(
EXPECT_TRUE(
!memcmp(
outgoing_result_response.result.sequence.data,
incoming_result_response.result.sequence.data,
outgoing_result_response.result.sequence.size));
@ -585,7 +592,8 @@ TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_valid_feedba
test_msgs__action__Fibonacci_FeedbackMessage__init(&incoming_feedback);
// Initialize feedback
ASSERT_TRUE(rosidl_generator_c__int32__Sequence__init(
ASSERT_TRUE(
rosidl_generator_c__int32__Sequence__init(
&outgoing_feedback.feedback.sequence, 3));
outgoing_feedback.feedback.sequence.data[0] = 0;
outgoing_feedback.feedback.sequence.data[1] = 1;
@ -624,11 +632,13 @@ TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_valid_feedba
EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
// Check that feedback was received correctly
EXPECT_TRUE(uuidcmp(
EXPECT_TRUE(
uuidcmp(
outgoing_feedback.goal_id.uuid,
incoming_feedback.goal_id.uuid));
ASSERT_EQ(outgoing_feedback.feedback.sequence.size, incoming_feedback.feedback.sequence.size);
EXPECT_TRUE(!memcmp(
EXPECT_TRUE(
!memcmp(
outgoing_feedback.feedback.sequence.data,
incoming_feedback.feedback.sequence.data,
outgoing_feedback.feedback.sequence.size));
@ -822,7 +832,8 @@ TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_invalid_canc
action_msgs__srv__CancelGoal_Response__init(&incoming_cancel_response);
// Initialize cancel request
ASSERT_TRUE(action_msgs__msg__GoalInfo__Sequence__init(
ASSERT_TRUE(
action_msgs__msg__GoalInfo__Sequence__init(
&outgoing_cancel_response.goals_canceling, 2));
init_test_uuid0(outgoing_cancel_response.goals_canceling.data[0].goal_id.uuid);
outgoing_cancel_response.goals_canceling.data[0].stamp.sec = 102;
@ -940,7 +951,8 @@ TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_invalid_resu
test_msgs__action__Fibonacci_GetResult_Response__init(&incoming_result_response);
// Initialize result response
ASSERT_TRUE(rosidl_generator_c__int32__Sequence__init(
ASSERT_TRUE(
rosidl_generator_c__int32__Sequence__init(
&outgoing_result_response.result.sequence, 4));
outgoing_result_response.result.sequence.data[0] = 0;
outgoing_result_response.result.sequence.data[1] = 1;
@ -1002,7 +1014,8 @@ TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_invalid_feed
test_msgs__action__Fibonacci_FeedbackMessage__init(&incoming_feedback);
// Initialize feedback
ASSERT_TRUE(rosidl_generator_c__int32__Sequence__init(
ASSERT_TRUE(
rosidl_generator_c__int32__Sequence__init(
&outgoing_feedback.feedback.sequence, 3));
outgoing_feedback.feedback.sequence.data[0] = 0;
outgoing_feedback.feedback.sequence.data[1] = 1;

View file

@ -55,7 +55,8 @@ protected:
rcl_init_options_t init_options = rcl_get_zero_initialized_init_options();
ret = rcl_init_options_init(&init_options, allocator);
ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str;
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT({
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT(
{
EXPECT_EQ(RCL_RET_OK, rcl_init_options_fini(&init_options)) << rcl_get_error_string().str;
});
context = rcl_get_zero_initialized_context();
@ -244,7 +245,8 @@ TEST_F(CLASSNAME(TestActionClientServerInteraction, RMW_IMPLEMENTATION), test_in
// Check that the goal request was received correctly
EXPECT_EQ(this->outgoing_goal_request.goal.order, this->incoming_goal_request.goal.order);
EXPECT_TRUE(uuidcmp(
EXPECT_TRUE(
uuidcmp(
this->outgoing_goal_request.goal_id.uuid,
this->incoming_goal_request.goal_id.uuid));
@ -304,7 +306,8 @@ TEST_F(CLASSNAME(TestActionClientServerInteraction, RMW_IMPLEMENTATION), test_in
EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
// Initialize feedback
ASSERT_TRUE(rosidl_generator_c__int32__Sequence__init(
ASSERT_TRUE(
rosidl_generator_c__int32__Sequence__init(
&this->outgoing_feedback.feedback.sequence, 3));
this->outgoing_feedback.feedback.sequence.data[0] = 0;
this->outgoing_feedback.feedback.sequence.data[1] = 1;
@ -346,13 +349,15 @@ TEST_F(CLASSNAME(TestActionClientServerInteraction, RMW_IMPLEMENTATION), test_in
EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
// Check that feedback was received correctly
EXPECT_TRUE(uuidcmp(
EXPECT_TRUE(
uuidcmp(
this->outgoing_feedback.goal_id.uuid,
this->incoming_feedback.goal_id.uuid));
ASSERT_EQ(
this->outgoing_feedback.feedback.sequence.size,
this->incoming_feedback.feedback.sequence.size);
EXPECT_TRUE(!memcmp(
EXPECT_TRUE(
!memcmp(
this->outgoing_feedback.feedback.sequence.data,
this->incoming_feedback.feedback.sequence.data,
this->outgoing_feedback.feedback.sequence.size));
@ -386,12 +391,14 @@ TEST_F(CLASSNAME(TestActionClientServerInteraction, RMW_IMPLEMENTATION), test_in
EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
// Check that the result request was received correctly
EXPECT_TRUE(uuidcmp(
EXPECT_TRUE(
uuidcmp(
this->outgoing_result_request.goal_id.uuid,
this->incoming_result_request.goal_id.uuid));
// Initialize result response
ASSERT_TRUE(rosidl_generator_c__int32__Sequence__init(
ASSERT_TRUE(
rosidl_generator_c__int32__Sequence__init(
&this->outgoing_result_response.result.sequence, 4));
this->outgoing_result_response.result.sequence.data[0] = 0;
this->outgoing_result_response.result.sequence.data[1] = 1;
@ -443,7 +450,8 @@ TEST_F(CLASSNAME(TestActionClientServerInteraction, RMW_IMPLEMENTATION), test_in
ASSERT_EQ(
this->outgoing_result_response.result.sequence.size,
this->incoming_result_response.result.sequence.size);
EXPECT_TRUE(!memcmp(
EXPECT_TRUE(
!memcmp(
this->outgoing_result_response.result.sequence.data,
this->incoming_result_response.result.sequence.data,
this->outgoing_result_response.result.sequence.size));
@ -505,7 +513,8 @@ TEST_F(
// Check that the goal request was received correctly
EXPECT_EQ(this->outgoing_goal_request.goal.order, this->incoming_goal_request.goal.order);
EXPECT_TRUE(uuidcmp(
EXPECT_TRUE(
uuidcmp(
this->outgoing_goal_request.goal_id.uuid,
this->incoming_goal_request.goal_id.uuid));
@ -565,7 +574,8 @@ TEST_F(
EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
// Initialize feedback
ASSERT_TRUE(rosidl_generator_c__int32__Sequence__init(
ASSERT_TRUE(
rosidl_generator_c__int32__Sequence__init(
&this->outgoing_feedback.feedback.sequence, 3));
this->outgoing_feedback.feedback.sequence.data[0] = 0;
this->outgoing_feedback.feedback.sequence.data[1] = 1;
@ -607,13 +617,15 @@ TEST_F(
EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
// Check that feedback was received correctly
EXPECT_TRUE(uuidcmp(
EXPECT_TRUE(
uuidcmp(
this->outgoing_feedback.goal_id.uuid,
this->incoming_feedback.goal_id.uuid));
ASSERT_EQ(
this->outgoing_feedback.feedback.sequence.size,
this->incoming_feedback.feedback.sequence.size);
EXPECT_TRUE(!memcmp(
EXPECT_TRUE(
!memcmp(
this->outgoing_feedback.feedback.sequence.data,
this->incoming_feedback.feedback.sequence.data,
this->outgoing_feedback.feedback.sequence.size));
@ -647,12 +659,14 @@ TEST_F(
EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
// Check that the result request was received correctly
EXPECT_TRUE(uuidcmp(
EXPECT_TRUE(
uuidcmp(
this->outgoing_result_request.goal_id.uuid,
this->incoming_result_request.goal_id.uuid));
// Initialize result response
ASSERT_TRUE(rosidl_generator_c__int32__Sequence__init(
ASSERT_TRUE(
rosidl_generator_c__int32__Sequence__init(
&this->outgoing_result_response.result.sequence, 4));
this->outgoing_result_response.result.sequence.data[0] = 0;
this->outgoing_result_response.result.sequence.data[1] = 1;
@ -699,7 +713,8 @@ TEST_F(
EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
// Check that the cancel request was received correctly
EXPECT_TRUE(uuidcmp(
EXPECT_TRUE(
uuidcmp(
outgoing_cancel_request.goal_info.goal_id.uuid,
incoming_cancel_request.goal_info.goal_id.uuid));
EXPECT_EQ(
@ -808,7 +823,8 @@ TEST_F(
ASSERT_EQ(
this->outgoing_result_response.result.sequence.size,
this->incoming_result_response.result.sequence.size);
EXPECT_TRUE(!memcmp(
EXPECT_TRUE(
!memcmp(
this->outgoing_result_response.result.sequence.data,
this->incoming_result_response.result.sequence.data,
this->outgoing_result_response.result.sequence.size));

View file

@ -166,7 +166,8 @@ protected:
rcl_init_options_t init_options = rcl_get_zero_initialized_init_options();
ret = rcl_init_options_init(&init_options, allocator);
ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str;
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT({
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT(
{
EXPECT_EQ(RCL_RET_OK, rcl_init_options_fini(&init_options)) << rcl_get_error_string().str;
});
context = rcl_get_zero_initialized_context();

View file

@ -59,7 +59,8 @@ public:
rcl_init_options_t init_options = rcl_get_zero_initialized_init_options();
ret = rcl_init_options_init(&init_options, this->allocator);
ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str;
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT({
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT(
{
EXPECT_EQ(RCL_RET_OK, rcl_init_options_fini(&init_options)) << rcl_get_error_string().str;
});
this->old_context = rcl_get_zero_initialized_context();
@ -244,8 +245,9 @@ TEST_F(
/**
* Type define a get actions function.
*/
typedef std::function<rcl_ret_t(const rcl_node_t *,
rcl_names_and_types_t *)> GetActionsFunc;
typedef std::function<
rcl_ret_t(const rcl_node_t *, rcl_names_and_types_t *)
> GetActionsFunc;
/**
* Extend the TestActionGraphFixture with a multi-node fixture for node discovery and node-graph
@ -268,7 +270,8 @@ public:
rcl_init_options_t init_options = rcl_get_zero_initialized_init_options();
ret = rcl_init_options_init(&init_options, rcl_get_default_allocator());
ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str;
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT({
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT(
{
EXPECT_EQ(RCL_RET_OK, rcl_init_options_fini(&init_options)) <<
rcl_get_error_string().str;
});
@ -283,22 +286,25 @@ public:
&this->remote_node, this->remote_node_name, "", &this->remote_context, &node_options);
ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str;
action_func = std::bind(rcl_action_get_names_and_types,
std::placeholders::_1,
&this->allocator,
std::placeholders::_2);
clients_by_node_func = std::bind(rcl_action_get_client_names_and_types_by_node,
std::placeholders::_1,
&this->allocator,
this->remote_node_name,
"",
std::placeholders::_2);
servers_by_node_func = std::bind(rcl_action_get_server_names_and_types_by_node,
std::placeholders::_1,
&this->allocator,
this->remote_node_name,
"",
std::placeholders::_2);
action_func = std::bind(
rcl_action_get_names_and_types,
std::placeholders::_1,
&this->allocator,
std::placeholders::_2);
clients_by_node_func = std::bind(
rcl_action_get_client_names_and_types_by_node,
std::placeholders::_1,
&this->allocator,
this->remote_node_name,
"",
std::placeholders::_2);
servers_by_node_func = std::bind(
rcl_action_get_server_names_and_types_by_node,
std::placeholders::_1,
&this->allocator,
this->remote_node_name,
"",
std::placeholders::_2);
WaitForAllNodesAlive();
}
@ -321,7 +327,8 @@ public:
rcl_ret_t ret;
rcutils_string_array_t node_names = rcutils_get_zero_initialized_string_array();
rcutils_string_array_t node_namespaces = rcutils_get_zero_initialized_string_array();
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT({
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT(
{
ret = rcutils_string_array_fini(&node_names);
ASSERT_EQ(RCUTILS_RET_OK, ret);
ret = rcutils_string_array_fini(&node_namespaces);
@ -379,7 +386,8 @@ TEST_F(TestActionGraphMultiNodeFixture, test_action_get_names_and_types) {
client_action_name,
&action_client_options);
ASSERT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT({
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT(
{
EXPECT_EQ(RCL_RET_OK, rcl_action_client_fini(&action_client, &this->remote_node)) <<
rcl_get_error_string().str;
});
@ -403,7 +411,8 @@ TEST_F(TestActionGraphMultiNodeFixture, test_action_get_names_and_types) {
rcl_clock_t clock;
ret = rcl_clock_init(RCL_STEADY_TIME, &clock, &this->allocator);
ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str;
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT({
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT(
{
EXPECT_EQ(RCL_RET_OK, rcl_clock_fini(&clock)) << rcl_get_error_string().str;
});
const char * server_action_name = "/test_action_get_names_and_types_server_action_name";
@ -416,7 +425,8 @@ TEST_F(TestActionGraphMultiNodeFixture, test_action_get_names_and_types) {
server_action_name,
&action_server_options);
ASSERT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT({
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT(
{
EXPECT_EQ(RCL_RET_OK, rcl_action_server_fini(&action_server, &this->remote_node)) <<
rcl_get_error_string().str;
});
@ -452,7 +462,8 @@ TEST_F(TestActionGraphMultiNodeFixture, test_action_get_server_names_and_types_b
this->action_name,
&action_client_options);
ASSERT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT({
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT(
{
EXPECT_EQ(RCL_RET_OK, rcl_action_client_fini(&action_client, &this->remote_node)) <<
rcl_get_error_string().str;
});
@ -471,7 +482,8 @@ TEST_F(TestActionGraphMultiNodeFixture, test_action_get_server_names_and_types_b
rcl_clock_t clock;
ret = rcl_clock_init(RCL_STEADY_TIME, &clock, &this->allocator);
ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str;
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT({
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT(
{
EXPECT_EQ(RCL_RET_OK, rcl_clock_fini(&clock)) << rcl_get_error_string().str;
});
rcl_action_server_options_t action_server_options = rcl_action_server_get_default_options();
@ -483,7 +495,8 @@ TEST_F(TestActionGraphMultiNodeFixture, test_action_get_server_names_and_types_b
this->action_name,
&action_server_options);
ASSERT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT({
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT(
{
EXPECT_EQ(RCL_RET_OK, rcl_action_server_fini(&action_server, &this->remote_node)) <<
rcl_get_error_string().str;
});
@ -510,7 +523,8 @@ TEST_F(TestActionGraphMultiNodeFixture, test_action_get_client_names_and_types_b
rcl_clock_t clock;
ret = rcl_clock_init(RCL_STEADY_TIME, &clock, &this->allocator);
ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str;
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT({
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT(
{
EXPECT_EQ(RCL_RET_OK, rcl_clock_fini(&clock)) << rcl_get_error_string().str;
});
rcl_action_server_options_t action_server_options = rcl_action_server_get_default_options();
@ -522,7 +536,8 @@ TEST_F(TestActionGraphMultiNodeFixture, test_action_get_client_names_and_types_b
this->action_name,
&action_server_options);
ASSERT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT({
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT(
{
EXPECT_EQ(RCL_RET_OK, rcl_action_server_fini(&action_server, &this->remote_node)) <<
rcl_get_error_string().str;
});
@ -547,7 +562,8 @@ TEST_F(TestActionGraphMultiNodeFixture, test_action_get_client_names_and_types_b
this->action_name,
&action_client_options);
ASSERT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT({
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT(
{
EXPECT_EQ(RCL_RET_OK, rcl_action_client_fini(&action_client, &this->remote_node)) <<
rcl_get_error_string().str;
});