* correctly copy state label

* correctly copy transition label

* uncrustify

* address comments

* up

* use init and fini functions from rcl
This commit is contained in:
Karsten Knese 2017-12-05 20:22:57 -08:00 committed by GitHub
parent d823982f22
commit c40f3c25c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 272 additions and 71 deletions

View file

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