diff --git a/control_toolbox/test/control_filters/test_low_pass_filter.cpp b/control_toolbox/test/control_filters/test_low_pass_filter.cpp index 1380df7f..d36f8181 100644 --- a/control_toolbox/test/control_filters/test_low_pass_filter.cpp +++ b/control_toolbox/test/control_filters/test_low_pass_filter.cpp @@ -51,7 +51,7 @@ TEST_F(FilterTest, TestLowPassWrenchFilterMissingParameter) node_->get_node_parameters_interface())); } -TEST_F(FilterTest, TestLowPassWrenchFilterInvalidThenFixedParameter) +TEST_F(FilterTest, TestLowPassWrenchFilterInvalidParameter) { std::shared_ptr> filter_ = std::make_shared>(); @@ -60,13 +60,10 @@ TEST_F(FilterTest, TestLowPassWrenchFilterInvalidThenFixedParameter) ASSERT_FALSE(filter_->configure( "", "TestLowPassFilter", node_->get_node_logging_interface(), node_->get_node_parameters_interface())); - - // fix the param - node_->set_parameter(rclcpp::Parameter("sampling_frequency", 1000.0)); - // should allow configuration and pass second call to unconfigured filter - ASSERT_TRUE(filter_->configure( - "", "TestLowPassFilter", node_->get_node_logging_interface(), - node_->get_node_parameters_interface())); + // remains now undeclared, so should throw if we try to set it + ASSERT_THROW( + node_->set_parameter(rclcpp::Parameter("sampling_frequency", 1000.0)), + rclcpp::exceptions::ParameterNotDeclaredException); } TEST_F(FilterTest, TestLowPassFilterThrowsUnconfigured) diff --git a/control_toolbox/test/control_filters/test_low_pass_filter_parameters.yaml b/control_toolbox/test/control_filters/test_low_pass_filter_parameters.yaml index d220da10..a7756620 100644 --- a/control_toolbox/test/control_filters/test_low_pass_filter_parameters.yaml +++ b/control_toolbox/test/control_filters/test_low_pass_filter_parameters.yaml @@ -9,7 +9,7 @@ TestLowPassWrenchFilterMissingParameter: damping_frequency: 20.5 damping_intensity: 1.25 -TestLowPassWrenchFilterInvalidThenFixedParameter: +TestLowPassWrenchFilterInvalidParameter: ros__parameters: sampling_frequency: 0.0 damping_frequency: 20.5