transition start and goal states can be null (#662)
* transition start and goal states can be null Signed-off-by: Karsten Knese <karsten@openrobotics.org> * correct tests Signed-off-by: Karsten Knese <karsten@openrobotics.org>
This commit is contained in:
parent
c212a0dba4
commit
0de31d0483
2 changed files with 2 additions and 12 deletions
|
@ -132,16 +132,6 @@ rcl_lifecycle_transition_init(
|
|||
return RCL_RET_ERROR;
|
||||
}
|
||||
|
||||
if (!start) {
|
||||
RCL_SET_ERROR_MSG("start state pointer is null\n");
|
||||
return RCL_RET_ERROR;
|
||||
}
|
||||
|
||||
if (!goal) {
|
||||
RCL_SET_ERROR_MSG("goal state pointer is null\n");
|
||||
return RCL_RET_ERROR;
|
||||
}
|
||||
|
||||
transition->start = start;
|
||||
transition->goal = goal;
|
||||
|
||||
|
|
|
@ -133,12 +133,12 @@ TEST(TestRclLifecycle, lifecycle_transition) {
|
|||
|
||||
ret = rcl_lifecycle_transition_init(
|
||||
&transition, expected_id, &expected_label[0], nullptr, nullptr, &allocator);
|
||||
EXPECT_EQ(ret, RCL_RET_ERROR);
|
||||
EXPECT_EQ(ret, RCL_RET_OK);
|
||||
rcutils_reset_error();
|
||||
|
||||
ret = rcl_lifecycle_transition_init(
|
||||
&transition, expected_id, &expected_label[0], start, nullptr, &allocator);
|
||||
EXPECT_EQ(ret, RCL_RET_ERROR);
|
||||
EXPECT_EQ(ret, RCL_RET_OK);
|
||||
rcutils_reset_error();
|
||||
|
||||
rcl_allocator_t bad_allocator = rcl_get_default_allocator();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue