summaryrefslogtreecommitdiff
path: root/test/domloadertest.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2018-06-20 19:21:48 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2018-08-12 11:11:45 +0200
commit6adb14a7027c8d54827093c83fc80694d71fb6a7 (patch)
treecc02ac1bdb548b0b317999d727a12fa5a9973594 /test/domloadertest.cc
parent1560674582102cd83197dccc79cb029fc843a48e (diff)
Fix missing finalization of instruments on load. Fix relative instrument filenames according to the drumkit file. Make drumkit creator create version 2.0 drumkits. Reduce missing refs file to a warning.
Diffstat (limited to 'test/domloadertest.cc')
-rw-r--r--test/domloadertest.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/domloadertest.cc b/test/domloadertest.cc
index 69b9821..55d49a7 100644
--- a/test/domloadertest.cc
+++ b/test/domloadertest.cc
@@ -34,6 +34,7 @@
#include <random.h>
#include "scopedfile.h"
+#include "path.h"
class DOMLoaderTest
: public DGUnit
@@ -99,13 +100,13 @@ public:
" <channel name=\"SnareBottom\"/>\n" \
" </channels>\n" \
" <instruments>\n" \
- " <instrument name=\"Snare1\" file=\"") + scoped_instrument_file1.filename() + std::string("\">\n" \
+ " <instrument name=\"Snare1\" file=\"") + getFile(scoped_instrument_file1.filename()) + std::string("\">\n" \
" <channelmap in=\"AmbLeft\" out=\"AmbLeft\" main=\"true\"/>\n" \
" <channelmap in=\"AmbRight\" out=\"AmbRight\" main=\"true\"/>\n" \
" <channelmap in=\"SnareTop\" out=\"SnareTop\"/>\n" \
" <channelmap in=\"SnareBottom\" out=\"SnareBottom\"/>\n" \
" </instrument>\n" \
- " <instrument name=\"Snare2\" file=\"") + scoped_instrument_file2.filename() + std::string("\">\n" \
+ " <instrument name=\"Snare2\" file=\"") + getFile(scoped_instrument_file2.filename()) + std::string("\">\n" \
" <channelmap in=\"AmbLeft2\" out=\"AmbLeft\" main=\"true\"/>\n" \
" <channelmap in=\"AmbRight2\" out=\"AmbRight\" main=\"true\"/>\n" \
" <channelmap in=\"SnareTop2\" out=\"SnareTop\"/>\n" \
@@ -119,14 +120,15 @@ public:
DrumkitDOM drumkitdom;
std::vector<InstrumentDOM> instrumentdoms;
DGUNIT_ASSERT(parseDrumkitFile(scoped_file.filename(), drumkitdom));
+ auto basepath = getPath(scoped_file.filename());
for(const auto& ref: drumkitdom.instruments)
{
instrumentdoms.emplace_back();
- DGUNIT_ASSERT(parseInstrumentFile(ref.file, instrumentdoms.back()));
+ DGUNIT_ASSERT(parseInstrumentFile(basepath + "/" + ref.file, instrumentdoms.back()));
}
DOMLoader domloader(settings, random);
- DGUNIT_ASSERT(domloader.loadDom(drumkitdom, instrumentdoms, drumkit));
+ DGUNIT_ASSERT(domloader.loadDom(basepath, drumkitdom, instrumentdoms, drumkit));
//
// Drumkit: