Skip to content

Commit

Permalink
Add tests for oscillator_multi
Browse files Browse the repository at this point in the history
  • Loading branch information
jpcima committed Apr 4, 2020
1 parent db35210 commit 0dca7db
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
37 changes: 37 additions & 0 deletions tests/FilesT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,43 @@ TEST_CASE("[Files] Channels (channels.sfz)")
REQUIRE(synth.getRegionView(1)->isStereo());
}

TEST_CASE("[Files] Channels (channels_multi.sfz)")
{
sfz::Synth synth;
synth.loadSfzFile(fs::current_path() / "tests/TestFiles/channels_multi.sfz");
REQUIRE(synth.getNumRegions() == 6);

REQUIRE(synth.getRegionView(0)->sample == "*sine");
REQUIRE(!synth.getRegionView(0)->isStereo());
REQUIRE(synth.getRegionView(0)->isGenerator());
REQUIRE(!synth.getRegionView(0)->oscillator);

REQUIRE(synth.getRegionView(1)->sample == "*sine");
REQUIRE(synth.getRegionView(1)->isStereo());
REQUIRE(synth.getRegionView(1)->isGenerator());
REQUIRE(!synth.getRegionView(1)->oscillator);

REQUIRE(synth.getRegionView(2)->sample == "ramp_wave.wav");
REQUIRE(!synth.getRegionView(2)->isStereo());
REQUIRE(!synth.getRegionView(2)->isGenerator());
REQUIRE(synth.getRegionView(2)->oscillator);

REQUIRE(synth.getRegionView(3)->sample == "ramp_wave.wav");
REQUIRE(synth.getRegionView(3)->isStereo());
REQUIRE(!synth.getRegionView(3)->isGenerator());
REQUIRE(synth.getRegionView(3)->oscillator);

REQUIRE(synth.getRegionView(4)->sample == "*sine");
REQUIRE(!synth.getRegionView(4)->isStereo());
REQUIRE(synth.getRegionView(4)->isGenerator());
REQUIRE(!synth.getRegionView(4)->oscillator);

REQUIRE(synth.getRegionView(5)->sample == "*sine");
REQUIRE(!synth.getRegionView(5)->isStereo());
REQUIRE(synth.getRegionView(5)->isGenerator());
REQUIRE(!synth.getRegionView(5)->oscillator);
}

TEST_CASE("[Files] sw_default")
{
sfz::Synth synth;
Expand Down
6 changes: 6 additions & 0 deletions tests/TestFiles/channels_multi.sfz
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<region> sample=*sine
<region> sample=*sine oscillator_multi=3
<region> sample=ramp_wave.wav oscillator=on
<region> sample=ramp_wave.wav oscillator=on oscillator_multi=3
<region> sample=*sine oscillator_multi=1
<region> sample=*sine oscillator_multi=2
Binary file added tests/TestFiles/ramp_wave.wav
Binary file not shown.

0 comments on commit 0dca7db

Please sign in to comment.