Skip to content

Commit

Permalink
Fix incorrectly failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
anjaldoshi committed Nov 8, 2024
1 parent 94d5f9b commit f918c1c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
13 changes: 5 additions & 8 deletions Plugins/BandpassFilter/Tests/BandpassFilterTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ class BandpassFilterTests : public ::testing::Test
{
Parameter* param = processor->getDataStream (streamId)->getParameter ("low_cut");
param->setNextValue (value);
processor->parameterValueChanged (param);
processor->updateSettings();
if (assert_set)
{
ASSERT_EQ (getLowCut(), value);
Expand All @@ -83,8 +81,6 @@ class BandpassFilterTests : public ::testing::Test
{
Parameter* param = processor->getDataStream (streamId)->getParameter ("high_cut");
param->setNextValue (value);
processor->parameterValueChanged (param);
processor->updateSettings();
if (assert_set)
{
ASSERT_EQ (getHighCut(), value);
Expand Down Expand Up @@ -133,7 +129,7 @@ TEST_F (BandpassFilterTests, TestRespectsLowHighCutSetting)
setLowCut (10.0, false);
ASSERT_FLOAT_EQ (getLowCut(), 10.0f);

setHighCut (10000.0, false);
setHighCut (6000.0, false);
ASSERT_FLOAT_EQ (getLowCut(), 10.0f);
ASSERT_FLOAT_EQ (getHighCut(), 6000.0f);

Expand All @@ -143,9 +139,10 @@ TEST_F (BandpassFilterTests, TestRespectsLowHighCutSetting)
ASSERT_FLOAT_EQ (getHighCut(), 6000.0f);

// Same with an invalid low cut; it's ignored
setLowCut (20000.0f, false);
ASSERT_FLOAT_EQ (getLowCut(), 600.0f);
ASSERT_FLOAT_EQ (getHighCut(), 6000.0f);
setHighCut (900.0f, false);
setLowCut (950.0f, false);
ASSERT_FLOAT_EQ (getLowCut(), 10.0f);
ASSERT_FLOAT_EQ (getHighCut(), 900.0f);
}

TEST_F (BandpassFilterTests, Test_SignalInPassband)
Expand Down
4 changes: 2 additions & 2 deletions Plugins/CommonAvgRef/Tests/CommonAvgRefTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ TEST_F (CommonAverageRefTests, CommonAverageTest)
// Set 1st channel as reference and second as affected in every stream
for (auto stream : processor->getDataStreams())
{
auto referenceChans = (SelectedChannelsParameter*) stream->getParameter ("Reference");
auto referenceChans = (MaskChannelsParameter*) stream->getParameter ("reference");
referenceChans->currentValue = Array<var> ({ 0 });

auto affectedChans = (SelectedChannelsParameter*) stream->getParameter ("Affected");
auto affectedChans = (MaskChannelsParameter*) stream->getParameter ("affected");
affectedChans->currentValue = Array<var> ({ 1 });
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/Processors/ChannelInfoObjectTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ TEST (ChannelInfoObjectTests, GetStreamId)
DataStream::Settings settings;
DataStream stream (settings);
ChannelInfoObject channel (InfoObject::Type::CONTINUOUS_CHANNEL, &stream);
uint16_t expectedStreamId = 10060;
uint16_t expectedStreamId = stream.getStreamId();

// Act
uint16_t actualStreamId = channel.getStreamId();
Expand Down

0 comments on commit f918c1c

Please sign in to comment.