From 7fbcf0548656bf24ba4fe62341f81ade4e34fca6 Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Sat, 4 Jan 2020 16:33:02 +0100 Subject: [PATCH] Added a test with bad/removed regions --- tests/FilesT.cpp | 9 +++++++++ tests/TestFiles/Regions/regions_bad.sfz | 4 ++++ 2 files changed, 13 insertions(+) create mode 100644 tests/TestFiles/Regions/regions_bad.sfz diff --git a/tests/FilesT.cpp b/tests/FilesT.cpp index 01a4ea2c..fb7db796 100644 --- a/tests/FilesT.cpp +++ b/tests/FilesT.cpp @@ -61,6 +61,15 @@ TEST_CASE("[Files] Underscore opcodes (underscore_opcodes.sfz)") REQUIRE(synth.getRegionView(0)->loopMode == SfzLoopMode::loop_sustain); } +TEST_CASE("[Files] (regions_bad.sfz)") +{ + sfz::Synth synth; + synth.loadSfzFile(fs::current_path() / "tests/TestFiles/Regions/regions_bad.sfz"); + REQUIRE(synth.getNumRegions() == 2); + REQUIRE(synth.getRegionView(0)->sample == "dummy.wav"); + REQUIRE(synth.getRegionView(1)->sample == "dummy.wav"); +} + TEST_CASE("[Files] Local include") { sfz::Synth synth; diff --git a/tests/TestFiles/Regions/regions_bad.sfz b/tests/TestFiles/Regions/regions_bad.sfz new file mode 100644 index 00000000..1084ddcc --- /dev/null +++ b/tests/TestFiles/Regions/regions_bad.sfz @@ -0,0 +1,4 @@ + sample=dummy.wav + sample=nonexistent.wav + sample=nonexistent.wav + sample=dummy.wav