Skip to content

Commit

Permalink
Addressed peer review comments v2
Browse files Browse the repository at this point in the history
  • Loading branch information
apojomovsky committed Nov 27, 2018
1 parent 10eebe3 commit f21c3d8
Showing 1 changed file with 30 additions and 13 deletions.
43 changes: 30 additions & 13 deletions rcl_action/test/rcl_action/test_action_communication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_valid_goal_c
EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
rcl_reset_error();

EXPECT_EQ(this->is_goal_request_ready, true) << rcl_get_error_string().str;
EXPECT_TRUE(this->is_goal_request_ready) << rcl_get_error_string().str;
EXPECT_FALSE(this->is_cancel_request_ready) << rcl_get_error_string().str;
EXPECT_FALSE(this->is_result_request_ready) << rcl_get_error_string().str;

// Take goal request with valid arguments
rmw_request_id_t request_header;
Expand Down Expand Up @@ -245,6 +247,12 @@ TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_valid_goal_c
EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
rcl_reset_error();

EXPECT_TRUE(this->is_goal_response_ready);
EXPECT_FALSE(this->is_cancel_response_ready);
EXPECT_FALSE(this->is_feedback_ready);
EXPECT_FALSE(this->is_status_ready);
EXPECT_FALSE(this->is_result_response_ready);

// Take goal response with valid arguments
ret = rcl_action_take_goal_response(
&this->action_client, &request_header, &incoming_goal_response);
Expand All @@ -266,7 +274,8 @@ TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_valid_goal_c
}


TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_valid_cancel_comm) {
TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_valid_cancel_comm)
{
action_msgs__srv__CancelGoal_Request outgoing_cancel_request;
action_msgs__srv__CancelGoal_Request incoming_cancel_request;
action_msgs__srv__CancelGoal_Response outgoing_cancel_response;
Expand Down Expand Up @@ -415,9 +424,9 @@ TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_valid_result
ret = rcl_action_server_wait_set_get_entities_ready(
&this->wait_set_server,
&this->action_server,
&is_goal_request_ready,
&is_cancel_request_ready,
&is_result_request_ready);
&this->is_goal_request_ready,
&this->is_cancel_request_ready,
&this->is_result_request_ready);
EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
rcl_reset_error();

Expand Down Expand Up @@ -624,7 +633,8 @@ TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_valid_feedba
test_msgs__action__Fibonacci_Feedback__fini(&outgoing_feedback);
}

TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_invalid_goal_request_opts) {
TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_invalid_goal_request_opts)
{
test_msgs__action__Fibonacci_Goal_Request outgoing_goal_request;
test_msgs__action__Fibonacci_Goal_Request incoming_goal_request;
test_msgs__action__Fibonacci_Goal_Request__init(&outgoing_goal_request);
Expand Down Expand Up @@ -680,7 +690,8 @@ TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_invalid_goal
test_msgs__action__Fibonacci_Goal_Request__init(&incoming_goal_request);
}

TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_invalid_goal_response_opts) {
TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_invalid_goal_response_opts)
{
test_msgs__action__Fibonacci_Goal_Response outgoing_goal_response;
test_msgs__action__Fibonacci_Goal_Response incoming_goal_response;
test_msgs__action__Fibonacci_Goal_Response__init(&outgoing_goal_response);
Expand Down Expand Up @@ -740,7 +751,8 @@ TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_invalid_goal
test_msgs__action__Fibonacci_Goal_Response__fini(&outgoing_goal_response);
}

TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_invalid_cancel_request_opts) {
TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_invalid_cancel_request_opts)
{
action_msgs__srv__CancelGoal_Request outgoing_cancel_request;
action_msgs__srv__CancelGoal_Request incoming_cancel_request;
action_msgs__srv__CancelGoal_Request__init(&outgoing_cancel_request);
Expand Down Expand Up @@ -798,7 +810,8 @@ TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_invalid_canc
}


TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_invalid_cancel_response_opts) {
TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_invalid_cancel_response_opts)
{
action_msgs__srv__CancelGoal_Response outgoing_cancel_response;
action_msgs__srv__CancelGoal_Response incoming_cancel_response;
action_msgs__srv__CancelGoal_Response__init(&outgoing_cancel_response);
Expand Down Expand Up @@ -859,7 +872,8 @@ TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_invalid_canc
action_msgs__srv__CancelGoal_Response__fini(&outgoing_cancel_response);
}

TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_invalid_result_request_opts) {
TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_invalid_result_request_opts)
{
test_msgs__action__Fibonacci_Result_Request outgoing_result_request;
test_msgs__action__Fibonacci_Result_Request incoming_result_request;
test_msgs__action__Fibonacci_Result_Request__init(&outgoing_result_request);
Expand Down Expand Up @@ -914,7 +928,8 @@ TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_invalid_resu
test_msgs__action__Fibonacci_Result_Request__fini(&outgoing_result_request);
}

TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_invalid_result_response_opts) {
TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_invalid_result_response_opts)
{
test_msgs__action__Fibonacci_Result_Response outgoing_result_response;
test_msgs__action__Fibonacci_Result_Response incoming_result_response;
test_msgs__action__Fibonacci_Result_Response__init(&outgoing_result_response);
Expand Down Expand Up @@ -975,7 +990,8 @@ TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_invalid_resu
test_msgs__action__Fibonacci_Result_Response__fini(&outgoing_result_response);
}

TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_invalid_feedback_opts) {
TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_invalid_feedback_opts)
{
test_msgs__action__Fibonacci_Feedback outgoing_feedback;
test_msgs__action__Fibonacci_Feedback incoming_feedback;
test_msgs__action__Fibonacci_Feedback__init(&outgoing_feedback);
Expand Down Expand Up @@ -1025,7 +1041,8 @@ TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_invalid_feed
test_msgs__action__Fibonacci_Feedback__fini(&outgoing_feedback);
}

TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_invalid_status_opts) {
TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_invalid_status_opts)
{
action_msgs__msg__GoalStatusArray incoming_status_array;
action_msgs__msg__GoalStatusArray__init(&incoming_status_array);

Expand Down

0 comments on commit f21c3d8

Please sign in to comment.