initialize_logging_ should be copied. (#1272)
Signed-off-by: Tomoya.Fujita <Tomoya.Fujita@sony.com>
This commit is contained in:
parent
efef96e657
commit
954cc3d27f
2 changed files with 19 additions and 0 deletions
|
@ -44,6 +44,7 @@ InitOptions::InitOptions(const InitOptions & other)
|
||||||
: InitOptions(*other.get_rcl_init_options())
|
: InitOptions(*other.get_rcl_init_options())
|
||||||
{
|
{
|
||||||
shutdown_on_sigint = other.shutdown_on_sigint;
|
shutdown_on_sigint = other.shutdown_on_sigint;
|
||||||
|
initialize_logging_ = other.initialize_logging_;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
@ -69,6 +70,7 @@ InitOptions::operator=(const InitOptions & other)
|
||||||
rclcpp::exceptions::throw_from_rcl_error(ret, "failed to copy rcl init options");
|
rclcpp::exceptions::throw_from_rcl_error(ret, "failed to copy rcl init options");
|
||||||
}
|
}
|
||||||
this->shutdown_on_sigint = other.shutdown_on_sigint;
|
this->shutdown_on_sigint = other.shutdown_on_sigint;
|
||||||
|
this->initialize_logging_ = other.initialize_logging_;
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,3 +44,20 @@ TEST(TestInitOptions, test_construction) {
|
||||||
ASSERT_TRUE(rcl_options_copy->impl != nullptr);
|
ASSERT_TRUE(rcl_options_copy->impl != nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(TestInitOptions, test_initialize_logging) {
|
||||||
|
{
|
||||||
|
auto options = rclcpp::InitOptions();
|
||||||
|
EXPECT_TRUE(options.auto_initialize_logging());
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
auto options = rclcpp::InitOptions().auto_initialize_logging(true);
|
||||||
|
EXPECT_TRUE(options.auto_initialize_logging());
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
auto options = rclcpp::InitOptions().auto_initialize_logging(false);
|
||||||
|
EXPECT_FALSE(options.auto_initialize_logging());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue