summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2016-05-08 15:57:15 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2016-05-08 15:57:15 +0200
commitae96f2a5d8e4bd0597a411fc6a5b66bb2b741af9 (patch)
treebddff84c662696a01ef7efb8f05f985f9bf0b418 /test
parentbd029a86ab41bb9061b7fd3a954abc4d2f20d2d5 (diff)
Fix engine unit test.
Diffstat (limited to 'test')
-rw-r--r--test/engine.cc57
1 files changed, 30 insertions, 27 deletions
diff --git a/test/engine.cc b/test/engine.cc
index 89c0158..c9d99cd 100644
--- a/test/engine.cc
+++ b/test/engine.cc
@@ -31,7 +31,7 @@
class test_engine : public CppUnit::TestFixture
{
- CPPUNIT_TEST_SUITE(test_engine);
+ CPPUNIT_TEST_SUITE(test_engine);
CPPUNIT_TEST(loading);
CPPUNIT_TEST_SUITE_END();
@@ -39,37 +39,40 @@ public:
void setUp() {}
void tearDown() {}
- void loading() {
- Settings settings;
- AudioOutputEngine *oe = NULL;
- AudioInputEngine *ie = NULL;
- DrumGizmo dg(settings, oe, ie);
- dg.setFrameSize(100);
+ void loading()
+ {
+ Settings settings;
+ AudioOutputEngine *oe = NULL;
+ AudioInputEngine *ie = NULL;
+ DrumGizmo dg(settings, oe, ie);
+ dg.setFrameSize(100);
- // Switch kits emmidiately with giving the loader time to work:
- for(int i = 0; i < 100; i++) {
- dg.loadkit("kit/kit1.xml");
- dg.loadkit("kit/kit2.xml");
- }
+ // Switch kits emmidiately without giving the loader time to work:
+ for(int i = 0; i < 100; ++i)
+ {
+ settings.drumkit_file.store("kit/kit1.xml");
+ settings.drumkit_file.store("kit/kit2.xml");
+ }
- // Switch kits with delay with giving the loader time to work a little:
- for(int i = 0; i < 100; i++) {
- dg.loadkit("kit/kit1.xml");
- usleep(100);
- dg.loadkit("kit/kit2.xml");
- usleep(100);
- }
+ // Switch kits with small delay giving the loader time to work a little:
+ for(int i = 0; i < 100; ++i)
+ {
+ settings.drumkit_file.store("kit/kit1.xml");
+ usleep(100);
+ settings.drumkit_file.store("kit/kit2.xml");
+ usleep(100);
+ }
- // Switch kits with more delay with giving the loader time to finish
- for(int i = 0; i < 100; i++) {
- dg.loadkit("kit/kit1.xml");
- usleep(10000);
- dg.loadkit("kit/kit2.xml");
- usleep(10000);
- }
+ // Switch kits with bigger delay giving the loader time to finish
+ for(int i = 0; i < 100; ++i)
+ {
+ settings.drumkit_file.store("kit/kit1.xml");
+ usleep(10000);
+ settings.drumkit_file.store("kit/kit2.xml");
+ usleep(10000);
+ }
}
};
// Registers the fixture into the 'registry'
CPPUNIT_TEST_SUITE_REGISTRATION(test_engine);
-