Skip to content

Commit

Permalink
transition start and goal states can be null (#662)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
Karsten1987 authored May 27, 2020
1 parent c212a0d commit 0de31d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
10 changes: 0 additions & 10 deletions rcl_lifecycle/src/rcl_lifecycle.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions rcl_lifecycle/test/test_rcl_lifecycle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 0de31d0

Please sign in to comment.