diff --git a/Tests/filters.cpp b/Tests/filters.cpp index 8acd908..d1c4049 100644 --- a/Tests/filters.cpp +++ b/Tests/filters.cpp @@ -123,6 +123,19 @@ TEST_CASE("Two filters can be linked together.") REQUIRE(high_pass.currentValue() == 46); } } + + SECTION("Decoupling filters works as expected.") + { + high_pass.update(60); + REQUIRE(high_pass.currentValue() == 0); + + high_pass.clearPrecedingFilter(); + high_pass.update(60); + REQUIRE(high_pass.currentValue() == 60); + + high_pass.update(30); + REQUIRE(high_pass.currentValue() == 60); + } } TEST_CASE("Median filter works as expected.") diff --git a/Utility/Inc/utility_ifilter.hpp b/Utility/Inc/utility_ifilter.hpp index b321832..2c454ce 100644 --- a/Utility/Inc/utility_ifilter.hpp +++ b/Utility/Inc/utility_ifilter.hpp @@ -12,7 +12,7 @@ template class IFilter { public: - virtual ~IFilter() {} + virtual ~IFilter() = default; void assignPrecedingFilter(IFilter& filter) {