From 0d0298b1bedbfca1672c20ad8d27a021d34bc216 Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Tue, 17 Dec 2019 14:07:26 +0100 Subject: [PATCH] Added a test for set_cc, with extended CCs --- tests/FilesT.cpp | 11 +++++++++++ tests/TestFiles/set_cc.sfz | 3 +++ 2 files changed, 14 insertions(+) create mode 100644 tests/TestFiles/set_cc.sfz diff --git a/tests/FilesT.cpp b/tests/FilesT.cpp index 4c3ea2da..59a4522e 100644 --- a/tests/FilesT.cpp +++ b/tests/FilesT.cpp @@ -352,4 +352,15 @@ TEST_CASE("[Files] Default path is ignored for generators") synth.loadSfzFile(fs::current_path() / "tests/TestFiles/default_path_generator.sfz"); REQUIRE(synth.getNumRegions() == 1); REQUIRE(synth.getRegionView(0)->sample == R"(*sine)"); +} + + +TEST_CASE("[Files] Set CC applies properly to all channels") +{ + sfz::Synth synth; + synth.loadSfzFile(fs::current_path() / "tests/TestFiles/set_cc.sfz"); + for (int channel = 0; channel < 16; channel++) { + REQUIRE(synth.getMidiState().getCCValue(channel, 142) == 63); + REQUIRE(synth.getMidiState().getCCValue(channel, 61) == 122); + } } \ No newline at end of file diff --git a/tests/TestFiles/set_cc.sfz b/tests/TestFiles/set_cc.sfz new file mode 100644 index 00000000..8e162f9f --- /dev/null +++ b/tests/TestFiles/set_cc.sfz @@ -0,0 +1,3 @@ + set_cc61=122 + set_cc142=63 + sample=snare.wav \ No newline at end of file