From 42445dfea6991bd791ee5aaec06a069f5dc30b83 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sun, 22 May 2016 16:44:30 +0200 Subject: We don't support nullptr engines. --- test/engine.cc | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/test/engine.cc b/test/engine.cc index c9d99cd..8f417e0 100644 --- a/test/engine.cc +++ b/test/engine.cc @@ -29,6 +29,38 @@ #include #include +class AudioOutputEngineDummy + : public AudioOutputEngine +{ +public: + bool init(const Channels& channels) { return true; } + + void setParm(const std::string& parm, const std::string& value) {} + + bool start() { return true; } + void stop() {} + + void pre(size_t nsamples) {} + void run(int ch, sample_t *samples, size_t nsamples) {} + void post(size_t nsamples) {} +}; + +class AudioInputEngineDummy + : public AudioInputEngine +{ +public: + bool init(const Instruments& instruments) { return true; } + + void setParm(const std::string& parm, const std::string& value) {} + + bool start() { return true; } + void stop() {} + + void pre() {} + void run(size_t pos, size_t len, std::vector& events) {} + void post() {} +}; + class test_engine : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(test_engine); @@ -42,9 +74,9 @@ public: void loading() { Settings settings; - AudioOutputEngine *oe = NULL; - AudioInputEngine *ie = NULL; - DrumGizmo dg(settings, oe, ie); + AudioOutputEngineDummy oe; + AudioInputEngineDummy ie; + DrumGizmo dg(settings, &oe, &ie); dg.setFrameSize(100); // Switch kits emmidiately without giving the loader time to work: -- cgit v1.2.3