Fix 393 (#418)
* correctly copy state label * correctly copy transition label * uncrustify * address comments * up * use init and fini functions from rcl
This commit is contained in:
parent
d823982f22
commit
c40f3c25c6
7 changed files with 272 additions and 71 deletions
|
@ -36,6 +36,13 @@ TEST_F(TestStateWrapper, wrapper) {
|
|||
EXPECT_STREQ("my_state", state.label().c_str());
|
||||
}
|
||||
|
||||
{
|
||||
std::string state_name("my_state");
|
||||
rclcpp_lifecycle::State state(1, state_name);
|
||||
state_name = "not_my_state";
|
||||
EXPECT_STREQ("my_state", state.label().c_str());
|
||||
}
|
||||
|
||||
{
|
||||
rcl_lifecycle_state_t lc_state = {"my_c_state", 2, NULL, NULL, 0};
|
||||
rclcpp_lifecycle::State c_state(lc_state.id, lc_state.label);
|
||||
|
@ -59,9 +66,9 @@ TEST_F(TestStateWrapper, wrapper) {
|
|||
EXPECT_EQ(3, c_state.id());
|
||||
EXPECT_FALSE(c_state.label().empty());
|
||||
EXPECT_STREQ("my_c_state", c_state.label().c_str());
|
||||
delete lc_state;
|
||||
}
|
||||
|
||||
|
||||
// introduces flakiness
|
||||
// unsupported behavior!
|
||||
// fails when compiled with memory sanitizer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue