Skip to content

Commit

Permalink
Fix the compatibility build by checking if the parameter has already …
Browse files Browse the repository at this point in the history
…been declared
  • Loading branch information
saikishor committed Nov 29, 2024
1 parent 0bdb06f commit 597d46b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions controller_manager/test/test_spawner_unspawner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,16 @@ TEST_F(TestLoadController, spawner_test_with_params_file_string_parameter)
lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED);
ASSERT_EQ(
cm_->get_parameter("ctrl_with_parameters_and_type.params_file").as_string(), test_file_path);
auto ctrl_node = ctrl_with_parameters_and_type.c->get_node();
ASSERT_THAT(
ctrl_with_parameters_and_type.info.parameters_files,
std::vector<std::string>({test_file_path}));
ctrl_with_parameters_and_type.c->get_node()->declare_parameter(
"joint_names", std::vector<std::string>({"random_joint"}));
if (!ctrl_node->has_parameter("joint_names"))
{
ctrl_node->declare_parameter("joint_names", std::vector<std::string>({"random_joint"}));
}
ASSERT_THAT(
ctrl_with_parameters_and_type.c->get_node()->get_parameter("joint_names").as_string_array(),
ctrl_node->get_parameter("joint_names").as_string_array(),
std::vector<std::string>({"joint0"}));
}

Expand Down

0 comments on commit 597d46b

Please sign in to comment.