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:
Karsten Knese 2020-05-27 12:03:10 -07:00 committed by GitHub
parent c212a0dba4
commit 0de31d0483
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 12 deletions

View file

@ -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;

View file

@ -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();