Fix bug when mixing shared_ptr and bind. (#470)

This commit is contained in:
Michael Carroll 2018-05-04 13:10:47 -05:00 committed by GitHub
parent 7cd8429534
commit 1be4d2d914
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -137,16 +137,16 @@ public:
TEST_F(TestRegisterCustomCallbacks, custom_callbacks) {
auto test_node = std::make_shared<CustomLifecycleNode>("testnode");
test_node->register_on_configure(
std::bind(&CustomLifecycleNode::on_custom_configure, test_node, std::placeholders::_1));
test_node->register_on_cleanup(std::bind(&CustomLifecycleNode::on_custom_cleanup, test_node,
std::placeholders::_1));
test_node->register_on_shutdown(std::bind(&CustomLifecycleNode::on_custom_shutdown, test_node,
std::placeholders::_1));
test_node->register_on_activate(std::bind(&CustomLifecycleNode::on_custom_activate, test_node,
std::placeholders::_1));
test_node->register_on_configure(std::bind(&CustomLifecycleNode::on_custom_configure,
test_node.get(), std::placeholders::_1));
test_node->register_on_cleanup(std::bind(&CustomLifecycleNode::on_custom_cleanup,
test_node.get(), std::placeholders::_1));
test_node->register_on_shutdown(std::bind(&CustomLifecycleNode::on_custom_shutdown,
test_node.get(), std::placeholders::_1));
test_node->register_on_activate(std::bind(&CustomLifecycleNode::on_custom_activate,
test_node.get(), std::placeholders::_1));
test_node->register_on_deactivate(std::bind(&CustomLifecycleNode::on_custom_deactivate,
test_node, std::placeholders::_1));
test_node.get(), std::placeholders::_1));
EXPECT_EQ(State::PRIMARY_STATE_UNCONFIGURED, test_node->get_current_state().id());
EXPECT_EQ(State::PRIMARY_STATE_INACTIVE, test_node->trigger_transition(