Skip to content

Commit

Permalink
Fixing more test issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jatinchowdhury18 committed Feb 22, 2024
1 parent e7e3b70 commit a83ae29
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ TEMPLATE_TEST_CASE ("Buffer Math Test",

SECTION ("RMS Test")
{
auto&& sineBuffer = test_utils::makeSineWave<T> ((NumericType) 100, (NumericType) 4800, (NumericType) 1);
auto&& sineBuffer = test_utils::makeSineWave<T> ((NumericType) 100, (NumericType) 1024, (NumericType) 1);
REQUIRE_MESSAGE (getRMSLevel (sineBuffer, 0) == SIMDApprox<T> ((T) (NumericType) 0.7071).margin ((NumericType) maxErr),
"RMS of a sine wave is incorrect!");
}

SECTION ("Copy Buffer Test")
{
auto&& srcBuffer = test_utils::makeSineWave<T> ((NumericType) 100, (NumericType) 4800, (NumericType) 1);
auto&& srcBuffer = test_utils::makeSineWave<T> ((NumericType) 100, (NumericType) 1024, (NumericType) 1);

BufferType destBuffer { srcBuffer.getNumChannels(), srcBuffer.getNumSamples() };
copyBufferData (srcBuffer, destBuffer);
Expand Down Expand Up @@ -130,7 +130,7 @@ TEMPLATE_TEST_CASE ("Buffer Math Test",

SECTION ("Add Buffer Test")
{
auto&& srcBuffer = test_utils::makeSineWave<T> ((NumericType) 100, (NumericType) 4800, (NumericType) 1);
auto&& srcBuffer = test_utils::makeSineWave<T> ((NumericType) 100, (NumericType) 1024, (NumericType) 1);

BufferType destBuffer { srcBuffer.getNumChannels(), srcBuffer.getNumSamples() };
for (int i = 0; i < destBuffer.getNumSamples(); ++i)
Expand Down Expand Up @@ -169,7 +169,7 @@ TEMPLATE_TEST_CASE ("Buffer Math Test",

SECTION ("Multiply Buffer Test")
{
auto&& srcBuffer = test_utils::makeSineWave<T> ((NumericType) 100, (NumericType) 4800, (NumericType) 1);
auto&& srcBuffer = test_utils::makeSineWave<T> ((NumericType) 100, (NumericType) 1024, (NumericType) 1);

BufferType destBuffer { srcBuffer.getNumChannels(), srcBuffer.getNumSamples() };
for (int i = 0; i < destBuffer.getNumSamples(); ++i)
Expand All @@ -186,8 +186,8 @@ TEMPLATE_TEST_CASE ("Buffer Math Test",

SECTION ("Apply Gain Test")
{
auto&& sineBuffer1 = test_utils::makeSineWave<T> ((NumericType) 100, (NumericType) 4800, (NumericType) 1);
auto&& sineBuffer2 = test_utils::makeSineWave<T> ((NumericType) 100, (NumericType) 4800, (NumericType) 1);
auto&& sineBuffer1 = test_utils::makeSineWave<T> ((NumericType) 100, (NumericType) 1024, (NumericType) 1);
auto&& sineBuffer2 = test_utils::makeSineWave<T> ((NumericType) 100, (NumericType) 1024, (NumericType) 1);

applyGain (sineBuffer1, (NumericType) 2);

Expand All @@ -203,8 +203,8 @@ TEMPLATE_TEST_CASE ("Buffer Math Test",
{
for (auto target : { (NumericType) 0, (NumericType) 1 })
{
auto&& sineBuffer1 = test_utils::makeSineWave<T> ((NumericType) 100, (NumericType) 4800, (NumericType) 1);
auto&& sineBuffer2 = test_utils::makeSineWave<T> ((NumericType) 100, (NumericType) 4800, (NumericType) 1);
auto&& sineBuffer1 = test_utils::makeSineWave<T> ((NumericType) 100, (NumericType) 1024, (NumericType) 1);
auto&& sineBuffer2 = test_utils::makeSineWave<T> ((NumericType) 100, (NumericType) 1024, (NumericType) 1);

juce::SmoothedValue<NumericType> sm1;
sm1.setCurrentAndTargetValue ((NumericType) 0);
Expand All @@ -231,8 +231,8 @@ TEMPLATE_TEST_CASE ("Buffer Math Test",
{
for (auto target : { (NumericType) 0, (NumericType) -1 })
{
auto&& sineBuffer1 = test_utils::makeSineWave<T> ((NumericType) 100, (NumericType) 4800, (NumericType) 1);
auto&& sineBuffer2 = test_utils::makeSineWave<T> ((NumericType) 100, (NumericType) 4800, (NumericType) 1);
auto&& sineBuffer1 = test_utils::makeSineWave<T> ((NumericType) 100, (NumericType) 1024, (NumericType) 1);
auto&& sineBuffer2 = test_utils::makeSineWave<T> ((NumericType) 100, (NumericType) 1024, (NumericType) 1);

chowdsp::SmoothedBufferValue<NumericType> sm1;
sm1.prepare ((NumericType) 48000, sineBuffer1.getNumSamples());
Expand Down

0 comments on commit a83ae29

Please sign in to comment.