Skip to content

Commit bdfdf6b

Browse files
committed
modify the test to have 2 parameters
1 parent fd477a6 commit bdfdf6b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

controller_manager/test/test_spawner_unspawner.cpp

+8-3
Original file line numberDiff line numberDiff line change
@@ -811,9 +811,9 @@ TEST_F(TestLoadController, test_spawner_parsed_controller_ros_args)
811811

812812
// Now test the remapping of the service name with the controller_ros_args
813813
EXPECT_EQ(
814-
call_spawner("ctrl_2 -c test_controller_manager --controller-ros-args '-r "
815-
"/ctrl_2/set_bool:=/set_bool' --controller-ros-args '-r "
816-
"/ctrl_1/set_value:=/set_value -p run_cycle:=20'"),
814+
call_spawner(
815+
"ctrl_2 -c test_controller_manager --controller-ros-args '-r "
816+
"/ctrl_2/set_bool:=/set_bool' --controller-ros-args '-p test_cycle:=-11.0 -p run_cycle:=20'"),
817817
0);
818818

819819
ASSERT_EQ(cm_->get_loaded_controllers().size(), 2ul);
@@ -835,6 +835,11 @@ TEST_F(TestLoadController, test_spawner_parsed_controller_ros_args)
835835
ctrl_2->declare_parameter("run_cycle", -200);
836836
}
837837
ASSERT_THAT(ctrl_2->get_parameter("run_cycle").as_int(), 20);
838+
if (!ctrl_2->has_parameter("test_cycle"))
839+
{
840+
ctrl_2->declare_parameter("test_cycle", 1231.0);
841+
}
842+
ASSERT_THAT(ctrl_2->get_parameter("test_cycle").as_double(), -11.0);
838843
}
839844

840845
class TestLoadControllerWithoutRobotDescription

0 commit comments

Comments
 (0)