From 328c0f65939f66bf0c7153d7f1e304bccbf8cf7f Mon Sep 17 00:00:00 2001 From: hogliux Date: Tue, 7 Nov 2017 14:41:25 +0000 Subject: [PATCH] DSP: Add "DSP" UnitTest category to dsp module UnitTests --- modules/juce_dsp/frequency/juce_FFT_test.cpp | 2 +- modules/juce_dsp/maths/juce_Matrix_test.cpp | 2 +- .../juce_dsp/processors/juce_FIRFilter_test.cpp | 15 +++++++++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/modules/juce_dsp/frequency/juce_FFT_test.cpp b/modules/juce_dsp/frequency/juce_FFT_test.cpp index 9082384019..653102f0eb 100644 --- a/modules/juce_dsp/frequency/juce_FFT_test.cpp +++ b/modules/juce_dsp/frequency/juce_FFT_test.cpp @@ -31,7 +31,7 @@ namespace dsp struct FFTUnitTest : public UnitTest { - FFTUnitTest() : UnitTest("FFT") {} + FFTUnitTest() : UnitTest ("FFT", "DSP") {} static void fillRandom (Random& random, Complex* buffer, size_t n) { diff --git a/modules/juce_dsp/maths/juce_Matrix_test.cpp b/modules/juce_dsp/maths/juce_Matrix_test.cpp index e9f3357f63..9577682e3e 100644 --- a/modules/juce_dsp/maths/juce_Matrix_test.cpp +++ b/modules/juce_dsp/maths/juce_Matrix_test.cpp @@ -31,7 +31,7 @@ namespace dsp struct LinearAlgebraUnitTest : public UnitTest { - LinearAlgebraUnitTest() : UnitTest("Linear Algebra UnitTests") {} + LinearAlgebraUnitTest() : UnitTest ("Linear Algebra UnitTests", "DSP") {} struct AdditionTest { diff --git a/modules/juce_dsp/processors/juce_FIRFilter_test.cpp b/modules/juce_dsp/processors/juce_FIRFilter_test.cpp index 437611ceac..f182ba5179 100644 --- a/modules/juce_dsp/processors/juce_FIRFilter_test.cpp +++ b/modules/juce_dsp/processors/juce_FIRFilter_test.cpp @@ -50,6 +50,7 @@ class FIRFilterTest : public UnitTest } }; + #if JUCE_USE_SIMD template struct Helpers> { @@ -65,6 +66,7 @@ class FIRFilterTest : public UnitTest n * SIMDRegister::size()); } }; + #endif template static void fillRandom (Random& random, Type* buffer, size_t n) { Helpers::fillRandom (random, buffer, n); } @@ -85,8 +87,15 @@ class FIRFilterTest : public UnitTest } HeapBlock scratchBuffer (numCoefficients - + (SIMDRegister::SIMDRegisterSize / sizeof (SampleType))); + #if JUCE_USE_SIMD + + (SIMDRegister::SIMDRegisterSize / sizeof (SampleType)) + #endif + ); + #if JUCE_USE_SIMD SampleType* buffer = reinterpret_cast (SIMDRegister::getNextSIMDAlignedPtr (reinterpret_cast (scratchBuffer.getData()))); + #else + SampleType* buffer = scratchBuffer.getData(); + #endif zeromem (buffer, sizeof (SampleType) * numCoefficients); @@ -188,13 +197,15 @@ class FIRFilterTest : public UnitTest runTestForType (); runTestForType(); + #if JUCE_USE_SIMD runTestForType, float> (); runTestForType, double>(); + #endif } public: - FIRFilterTest() : UnitTest ("FIR Filter") {} + FIRFilterTest() : UnitTest ("FIR Filter", "DSP") {} void runTest() override {