@@ -134,7 +134,12 @@ struct EditorWhilstProcessingTest : public PluginTest
134134 if (instance.hasEditor ())
135135 {
136136 instance.releaseResources ();
137- instance.prepareToPlay (44100.0 , 512 );
137+
138+ const std::vector<double >& sampleRates = ut.getOptions ().sampleRates ;
139+ const std::vector<int >& blockSizes = ut.getOptions ().blockSizes ;
140+
141+ jassert (sampleRates.size ()>0 && blockSizes.size ()>0 );
142+ instance.prepareToPlay (sampleRates[0 ], blockSizes[0 ]);
138143
139144 const int numChannelsRequired = jmax (instance.getTotalNumInputChannels (), instance.getTotalNumOutputChannels ());
140145 AudioBuffer<float > ab (numChannelsRequired, instance.getBlockSize ());
@@ -183,8 +188,13 @@ struct AudioProcessingTest : public PluginTest
183188 bool callReleaseResourcesBeforeSampleRateChange)
184189 {
185190 const bool isPluginInstrument = instance.getPluginDescription ().isInstrument ;
186- const double sampleRates[] = { 44100.0 , 48000.0 , 96000.0 };
187- const int blockSizes[] = { 64 , 128 , 256 , 512 , 1024 };
191+
192+ const std::vector<double >& sampleRates = ut.getOptions ().sampleRates ;
193+ const std::vector<int >& blockSizes = ut.getOptions ().blockSizes ;
194+
195+ jassert (sampleRates.size ()>0 && blockSizes.size ()>0 );
196+ instance.prepareToPlay (sampleRates[0 ], blockSizes[0 ]);
197+
188198 const int numBlocks = 10 ;
189199 auto r = ut.getRandom ();
190200
@@ -193,8 +203,8 @@ struct AudioProcessingTest : public PluginTest
193203 for (auto bs : blockSizes)
194204 {
195205 ut.logMessage (String (" Testing with sample rate [SR] and block size [BS]" )
196- .replace (" SR" , String (sr, 0 ) , false )
197- .replace (" BS" , String (bs), false ));
206+ .replace (" SR" , String (sr,0 ) , false )
207+ .replace (" BS" , String (bs), false ));
198208
199209 if (callReleaseResourcesBeforeSampleRateChange)
200210 instance.releaseResources ();
@@ -344,8 +354,13 @@ struct AutomationTest : public PluginTest
344354 {
345355 const bool subnormalsAreErrors = ut.getOptions ().strictnessLevel > 5 ;
346356 const bool isPluginInstrument = instance.getPluginDescription ().isInstrument ;
347- const double sampleRates[] = { 44100.0 , 48000.0 , 96000.0 };
348- const int blockSizes[] = { 64 , 128 , 256 , 512 , 1024 };
357+
358+ const std::vector<double >& sampleRates = ut.getOptions ().sampleRates ;
359+ const std::vector<int >& blockSizes = ut.getOptions ().blockSizes ;
360+
361+ jassert (sampleRates.size ()>0 && blockSizes.size ()>0 );
362+ instance.prepareToPlay (sampleRates[0 ], blockSizes[0 ]);
363+
349364 auto r = ut.getRandom ();
350365
351366 for (auto sr : sampleRates)
@@ -354,8 +369,8 @@ struct AutomationTest : public PluginTest
354369 {
355370 const int subBlockSize = 32 ;
356371 ut.logMessage (String (" Testing with sample rate [SR] and block size [BS] and sub-block size [SB]" )
357- .replace (" SR" , String (sr, 0 ), false )
358- .replace (" BS" , String (bs), false )
372+ .replace (" SR" , String (sr,0 ), false )
373+ .replace (" BS" , String (bs), false )
359374 .replace (" SB" , String (subBlockSize), false ));
360375
361376 instance.releaseResources ();
0 commit comments