Utility: update filter unit tests with decoupling test.
This commit is contained in:
parent
47d7e87023
commit
927b950dec
@ -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.")
|
||||
|
||||
@ -12,7 +12,7 @@ template<typename T>
|
||||
class IFilter
|
||||
{
|
||||
public:
|
||||
virtual ~IFilter() {}
|
||||
virtual ~IFilter() = default;
|
||||
|
||||
void assignPrecedingFilter(IFilter<T>& filter)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user