Skip to content

Commit 42bd9db

Browse files
committed
Remove AudioDevice and ControlPanel from fixtures
1 parent d22bb88 commit 42bd9db

File tree

5 files changed

+26
-26
lines changed

5 files changed

+26
-26
lines changed

Plugins/LfpViewer/Tests/LfpDisplayNodeTests.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ TEST_F (LfpDisplayNodeTests, VisualIntegrityTest)
319319
Rectangle<int> canvasSnapshot (x, y, width, height);
320320
ExpectedImage expected (numChannels, sampleRate * 2); //2 seconds to match canvas timebase
321321

322-
tester->startAcquisition (false);
322+
processor->startAcquisition ();
323323
canvas->beginAnimation();
324324

325325
//Add 5 10Hz waves with +-125uV amplitude
@@ -367,16 +367,16 @@ TEST_F (LfpDisplayNodeTests, VisualIntegrityTest)
367367
missCount = getImageDifferencePixelCount (expectedImage, canvasImage);
368368
EXPECT_LE (float (missCount) / float (width * height), errorThreshold);
369369

370-
tester->stopAcquisition();
370+
processor->stopAcquisition();
371371
}
372372

373373
TEST_F (LfpDisplayNodeTests, DataIntegrityTest)
374374
{
375375
int numSamples = 100;
376-
tester->startAcquisition (false);
376+
processor->startAcquisition ();
377377

378378
auto inputBuffer = createBuffer (1000.0, 20.0, numChannels, numSamples);
379379
writeBlock (inputBuffer);
380380

381-
tester->stopAcquisition();
381+
processor->stopAcquisition();
382382
}

Tests/Processors/DataThreadTests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ class DataThreadTests : public testing::Test
115115

116116
TEST_F(DataThreadTests, DataIntegrity)
117117
{
118-
tester->startAcquisition(false);
118+
processor->startAcquisition();
119119

120120
int numSamples = 100;
121121
auto inputBuffer = createBuffer(1000.0, 20.0, 5, numSamples);
122122
writeBlock(inputBuffer);
123123

124-
tester->stopAcquisition();
124+
processor->stopAcquisition();
125125
}

Tests/Processors/RecordNodeTests.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -220,14 +220,14 @@ class RecordNodeTests : public testing::Test {
220220

221221
TEST_F(RecordNodeTests, TestInputOutput_Continuous_Single) {
222222
int numSamples = 100;
223-
tester->startAcquisition(true);
223+
processor->startAcquisition();
224224

225225
auto inputBuffer = createBuffer(1000.0, 20.0, numChannels, numSamples);
226226
writeBlock(inputBuffer);
227227

228228
// The record node always flushes its pending writes when stopping acquisition, so we don't need to sleep before
229229
// stopping.
230-
tester->stopAcquisition();
230+
processor->stopAcquisition();
231231

232232
std::vector<int16_t> persistedData;
233233
loadContinuousDatFile(&persistedData);
@@ -245,7 +245,7 @@ TEST_F(RecordNodeTests, TestInputOutput_Continuous_Single) {
245245
}
246246

247247
TEST_F(RecordNodeTests, TestInputOutput_Continuous_Multiple) {
248-
tester->startAcquisition(true);
248+
processor->startAcquisition();
249249

250250
int numSamplesPerBlock = 100;
251251
int numBlocks = 8;
@@ -256,7 +256,7 @@ TEST_F(RecordNodeTests, TestInputOutput_Continuous_Multiple) {
256256
inputBuffers.push_back(inputBuffer);
257257
}
258258

259-
tester->stopAcquisition();
259+
processor->stopAcquisition();
260260

261261
std::vector<int16_t> persistedData;
262262
loadContinuousDatFile(&persistedData);
@@ -277,8 +277,8 @@ TEST_F(RecordNodeTests, TestInputOutput_Continuous_Multiple) {
277277
}
278278

279279
TEST_F(RecordNodeTests, TestEmpty) {
280-
tester->startAcquisition(true);
281-
tester->stopAcquisition();
280+
processor->startAcquisition();
281+
processor->stopAcquisition();
282282

283283
std::vector<int16_t> persistedData;
284284
loadContinuousDatFile(&persistedData);
@@ -287,7 +287,7 @@ TEST_F(RecordNodeTests, TestEmpty) {
287287

288288
TEST_F(RecordNodeTests, TestClipsProperly) {
289289
int numSamples = 100;
290-
tester->startAcquisition(true);
290+
processor->startAcquisition();
291291

292292
// The min value is actually -32767, not -32768 like the "true" min
293293
std::vector<AudioBuffer<float>> inputBuffers;
@@ -301,7 +301,7 @@ TEST_F(RecordNodeTests, TestClipsProperly) {
301301
writeBlock(inputBuffer);
302302
inputBuffers.push_back(inputBuffer);
303303

304-
tester->stopAcquisition();
304+
processor->stopAcquisition();
305305

306306
std::vector<int16_t> persistedData;
307307
loadContinuousDatFile(&persistedData);
@@ -341,10 +341,10 @@ class CustomBitVolts_RecordNodeTests : public RecordNodeTests {
341341

342342
TEST_F(CustomBitVolts_RecordNodeTests, Test_RespectsBitVolts) {
343343
int numSamples = 100;
344-
tester->startAcquisition(true);
344+
processor->startAcquisition();
345345
auto inputBuffer = createBuffer(1000.0, 20.0, numChannels, numSamples);
346346
writeBlock(inputBuffer);
347-
tester->stopAcquisition();
347+
processor->stopAcquisition();
348348

349349
std::vector<int16_t> persistedData;
350350
loadContinuousDatFile(&persistedData);
@@ -370,7 +370,7 @@ TEST_F(CustomBitVolts_RecordNodeTests, Test_RespectsBitVolts) {
370370
}
371371

372372
TEST_F(RecordNodeTests, Test_PersistsSampleNumbersAndTimestamps) {
373-
tester->startAcquisition(true);
373+
processor->startAcquisition();
374374

375375
int numSamples = 5;
376376
for (int i = 0; i < 3; i++) {
@@ -417,7 +417,7 @@ TEST_F(RecordNodeTests, Test_PersistsSampleNumbersAndTimestamps) {
417417
}
418418

419419
TEST_F(RecordNodeTests, Test_PersistsStructureOeBin) {
420-
tester->startAcquisition(true);
420+
processor->startAcquisition();
421421

422422
int numSamples = 5;
423423
for (int i = 0; i < 3; i++) {
@@ -479,7 +479,7 @@ TEST_F(RecordNodeTests, Test_PersistsEvents) {
479479
processor->setRecordEvents(true);
480480
processor->updateSettings();
481481

482-
tester->startAcquisition(true);
482+
processor->startAcquisition();
483483
int numSamples = 5;
484484

485485
auto streamId = processor->getDataStreams()[0]->getStreamId();
@@ -492,7 +492,7 @@ TEST_F(RecordNodeTests, Test_PersistsEvents) {
492492
true);
493493
auto inputBuffer = createBuffer(1000.0, 20.0, numChannels, numSamples);
494494
writeBlock(inputBuffer, eventPtr.get());
495-
tester->stopAcquisition();
495+
processor->stopAcquisition();
496496

497497
std::filesystem::path sampleNumbersPath;
498498
ASSERT_TRUE(eventsPathFor("sample_numbers.npy", &sampleNumbersPath));

Tests/Processors/SourceNodeTests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,11 @@ This test verifies that given a Data Thread, the Source Node will perform this w
127127
*/
128128
TEST_F(SourceNodeTests, DataAcquisition)
129129
{
130-
tester->startAcquisition(false);
130+
tester->getSourceNode()->startAcquisition();
131131

132132
int numSamples = 100;
133133
auto inputBuffer = createBuffer(1000.0, 20.0, 5, numSamples);
134134
writeBlock(inputBuffer);
135135

136-
tester->stopAcquisition();
136+
tester->getSourceNode()->stopAcquisition();
137137
}

Tests/TestHelpers/include/TestFixtures.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ class ProcessorTester
7979
LookAndFeel::setDefaultLookAndFeel (customLookAndFeel.get());
8080

8181
// All of these sets the global state in AccessClass in their constructors
82-
audioComponent = std::make_unique<AudioComponent>();
82+
//audioComponent = std::make_unique<AudioComponent>();
8383
processorGraph = std::make_unique<ProcessorGraph> (true);
84-
controlPanel = std::make_unique<ControlPanel> (processorGraph.get(), audioComponent.get(), true);
84+
//controlPanel = std::make_unique<ControlPanel> (processorGraph.get(), audioComponent.get(), true);
8585

8686
SourceNode* snTemp = sourceNodeBuilder.buildSourceNode();
8787
sourceNodeId = nextProcessorId++;
@@ -97,12 +97,12 @@ class ProcessorTester
9797
sn->initialize (false);
9898
sn->setDestNode (nullptr);
9999

100-
controlPanel->updateRecordEngineList();
100+
//controlPanel->updateRecordEngineList();
101101

102102
// Refresh everything
103103
processorGraph->updateSettings (sn);
104104

105-
controlPanel->colourChanged();
105+
//controlPanel->colourChanged();
106106
}
107107

108108
virtual ~ProcessorTester()

0 commit comments

Comments
 (0)