summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2016-05-22 16:44:30 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2016-05-22 16:44:30 +0200
commit42445dfea6991bd791ee5aaec06a069f5dc30b83 (patch)
treecbe9eb4174c8ec3e943a010be4b1861b221316be /test
parent624d25b8c3e9bd1648fdadbe28e1859cecab494f (diff)
We don't support nullptr engines.
Diffstat (limited to 'test')
-rw-r--r--test/engine.cc38
1 files 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 <drumgizmo.h>
#include <unistd.h>
+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<event_t>& 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: