From 89bf38e35ed8731019b4819d71e658d43e9131ce Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Tue, 17 Dec 2019 12:40:25 +0100 Subject: [PATCH] Move some tests around --- tests/FilesT.cpp | 35 ----------------------------------- tests/SynthT.cpp | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 35 deletions(-) diff --git a/tests/FilesT.cpp b/tests/FilesT.cpp index 74308b3f..4c3ea2da 100644 --- a/tests/FilesT.cpp +++ b/tests/FilesT.cpp @@ -325,41 +325,6 @@ TEST_CASE("[Files] Specific bug: relative path with backslashes") REQUIRE(synth.getRegionView(0)->sample == R"(Xylo/Subfolder/closedhat.wav)"); } -TEST_CASE("[Synth] Testing channel 1") -{ - sfz::Synth synth; - synth.setNumVoices(1); - synth.loadSfzFile(fs::current_path() / "tests/TestFiles/midi_channels.sfz"); - synth.noteOn(0, 0, 60, 63); - const auto* region = synth.getVoiceView(0)->getRegion(); - REQUIRE( region != nullptr ); - REQUIRE( region->sample == "dummy1.wav" ); -} - -TEST_CASE("[Synth] Testing channel 2") -{ - sfz::Synth synth; - synth.setNumVoices(1); - synth.loadSfzFile(fs::current_path() / "tests/TestFiles/midi_channels.sfz"); - synth.noteOn(0, 1, 60, 63); - const auto* region = synth.getVoiceView(0)->getRegion(); - REQUIRE( region != nullptr ); - REQUIRE( region->sample == "dummy2.wav" ); -} - - - -TEST_CASE("[Synth] Testing channel 16") -{ - sfz::Synth synth; - synth.setNumVoices(1); - synth.loadSfzFile(fs::current_path() / "tests/TestFiles/midi_channels.sfz"); - synth.noteOn(0, 15, 60, 63); - const auto* region = synth.getVoiceView(0)->getRegion(); - REQUIRE( region != nullptr ); - REQUIRE( region->sample == "dummy16.wav" ); -} - TEST_CASE("[Files] Default path") { sfz::Synth synth; diff --git a/tests/SynthT.cpp b/tests/SynthT.cpp index f5dadec0..f77b7b1c 100644 --- a/tests/SynthT.cpp +++ b/tests/SynthT.cpp @@ -120,3 +120,39 @@ TEST_CASE("[Synth] Check that we can change the oversampling factor before and a synth.setOversamplingFactor(sfz::x2); synth.renderBlock(buffer); } + + +TEST_CASE("[Synth] Testing channel 1") +{ + sfz::Synth synth; + synth.setNumVoices(1); + synth.loadSfzFile(fs::current_path() / "tests/TestFiles/midi_channels.sfz"); + synth.noteOn(0, 0, 60, 63); + const auto* region = synth.getVoiceView(0)->getRegion(); + REQUIRE( region != nullptr ); + REQUIRE( region->sample == "dummy1.wav" ); +} + +TEST_CASE("[Synth] Testing channel 2") +{ + sfz::Synth synth; + synth.setNumVoices(1); + synth.loadSfzFile(fs::current_path() / "tests/TestFiles/midi_channels.sfz"); + synth.noteOn(0, 1, 60, 63); + const auto* region = synth.getVoiceView(0)->getRegion(); + REQUIRE( region != nullptr ); + REQUIRE( region->sample == "dummy2.wav" ); +} + + + +TEST_CASE("[Synth] Testing channel 16") +{ + sfz::Synth synth; + synth.setNumVoices(1); + synth.loadSfzFile(fs::current_path() / "tests/TestFiles/midi_channels.sfz"); + synth.noteOn(0, 15, 60, 63); + const auto* region = synth.getVoiceView(0)->getRegion(); + REQUIRE( region != nullptr ); + REQUIRE( region->sample == "dummy16.wav" ); +} \ No newline at end of file