Move some tests around

This commit is contained in:
Paul Ferrand 2019-12-17 12:40:25 +01:00
parent 03645bd54f
commit 89bf38e35e
2 changed files with 36 additions and 35 deletions

View file

@ -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;

View file

@ -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" );
}