Skip to content

Commit

Permalink
Cleanup test code
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich committed Nov 16, 2023
1 parent afba3bf commit 8ab7dbe
Showing 1 changed file with 7 additions and 42 deletions.
49 changes: 7 additions & 42 deletions joint_trajectory_controller/test/test_trajectory_actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,15 +249,7 @@ TEST_P(TestTrajectoryActionsTestParameterized, test_success_single_point_sendgoa
// it should be holding the last position goal
// i.e., active but trivial trajectory (one point only)
// note: the action goal also is a trivial trajectory
if (traj_controller_->has_position_command_interface())
{
expectCommandPoint(point_positions);
}
else
{
// no integration to position state interface from velocity/acceleration
expectCommandPoint(point_positions);
}
expectCommandPoint(point_positions);
}

TEST_P(TestTrajectoryActionsTestParameterized, test_success_single_point_with_velocity_sendgoal)
Expand Down Expand Up @@ -295,15 +287,7 @@ TEST_P(TestTrajectoryActionsTestParameterized, test_success_single_point_with_ve
// it should be holding the last position goal
// i.e., active but trivial trajectory (one point only)
// note: the action goal also is a trivial trajectory
if (traj_controller_->has_position_command_interface())
{
expectCommandPoint(point_positions, point_velocities);
}
else
{
// no integration to position state interface from velocity/acceleration
expectCommandPoint(point_positions, point_velocities);
}
expectCommandPoint(point_positions, point_velocities);
}

TEST_P(TestTrajectoryActionsTestParameterized, test_success_multi_point_sendgoal)
Expand Down Expand Up @@ -349,15 +333,7 @@ TEST_P(TestTrajectoryActionsTestParameterized, test_success_multi_point_sendgoal

// it should be holding the last position goal
// i.e., active but trivial trajectory (one point only)
if (traj_controller_->has_position_command_interface())
{
expectCommandPoint(points_positions.at(1));
}
else
{
// no integration to position state interface from velocity/acceleration
expectCommandPoint(points_positions.at(1));
}
expectCommandPoint(points_positions.at(1));
}

TEST_P(TestTrajectoryActionsTestParameterized, test_success_multi_point_with_velocity_sendgoal)
Expand Down Expand Up @@ -407,15 +383,7 @@ TEST_P(TestTrajectoryActionsTestParameterized, test_success_multi_point_with_vel

// it should be holding the last position goal
// i.e., active but trivial trajectory (one point only)
if (traj_controller_->has_position_command_interface())
{
expectCommandPoint(points_positions.at(1), points_velocities.at(1));
}
else
{
// no integration to position state interface from velocity/acceleration
expectCommandPoint(points_positions.at(1), points_velocities.at(1));
}
expectCommandPoint(points_positions.at(1), points_velocities.at(1));
}

/**
Expand Down Expand Up @@ -569,8 +537,7 @@ TEST_P(TestTrajectoryActionsTestParameterized, test_state_tolerances_fail)

// it should be holding the position (being the initial one)
// i.e., active but trivial trajectory (one point only)
std::vector<double> initial_positions{INITIAL_POS_JOINT1, INITIAL_POS_JOINT2, INITIAL_POS_JOINT3};
expectCommandPoint(initial_positions);
expectCommandPoint(INITIAL_POS_JOINTS);
}

TEST_P(TestTrajectoryActionsTestParameterized, test_goal_tolerances_fail)
Expand Down Expand Up @@ -618,8 +585,7 @@ TEST_P(TestTrajectoryActionsTestParameterized, test_goal_tolerances_fail)

// it should be holding the position (being the initial one)
// i.e., active but trivial trajectory (one point only)
std::vector<double> initial_positions{INITIAL_POS_JOINT1, INITIAL_POS_JOINT2, INITIAL_POS_JOINT3};
expectCommandPoint(initial_positions);
expectCommandPoint(INITIAL_POS_JOINTS);
}

TEST_P(TestTrajectoryActionsTestParameterized, test_no_time_from_start_state_tolerance_fail)
Expand Down Expand Up @@ -664,8 +630,7 @@ TEST_P(TestTrajectoryActionsTestParameterized, test_no_time_from_start_state_tol

// it should be holding the position (being the initial one)
// i.e., active but trivial trajectory (one point only)
std::vector<double> initial_positions{INITIAL_POS_JOINT1, INITIAL_POS_JOINT2, INITIAL_POS_JOINT3};
expectCommandPoint(initial_positions);
expectCommandPoint(INITIAL_POS_JOINTS);
}

TEST_P(TestTrajectoryActionsTestParameterized, test_cancel_hold_position)
Expand Down

0 comments on commit 8ab7dbe

Please sign in to comment.