@@ -27,6 +27,13 @@ TEST_F(FilterTest, TestExponentialFilterThrowsUnconfigured)
27
27
ASSERT_THROW (filter_->update (in, out), std::runtime_error);
28
28
}
29
29
30
+ TEST_F (FilterTest, TestExponentialFilterInvalidParameterValue)
31
+ {
32
+ std::shared_ptr<filters::FilterBase<double >> filter_ =
33
+ std::make_shared<control_filters::ExponentialFilter<double >>();
34
+ ASSERT_FALSE (filter_->configure (" " , " TestExponentialFilter" ,
35
+ node_->get_node_logging_interface (), node_->get_node_parameters_interface ()));
36
+ }
30
37
31
38
TEST_F (FilterTest, TestExponentialFilterComputation)
32
39
{
@@ -47,13 +54,13 @@ TEST_F(FilterTest, TestExponentialFilterComputation)
47
54
ASSERT_EQ (out, 1.0 );
48
55
49
56
// second filter pass with same values: no change
50
- // check equality with low-pass-filter
51
- ASSERT_TRUE (filter_->update (in, out));
52
- calculated = in;
53
- ASSERT_EQ (calculated, out);
57
+ // check equality with low-pass-filter
58
+ ASSERT_TRUE (filter_->update (in, out));
59
+ calculated = in;
60
+ ASSERT_EQ (calculated, out);
54
61
55
62
// input change
56
- in = 0.0 ;
63
+ in = 0.0 ;
57
64
for (int i = 0 ; i < 100 ; ++i){
58
65
ASSERT_TRUE (filter_->update (in, out));
59
66
calculated = alpha * in + (1 - alpha) * calculated;
0 commit comments