From e08314f2c8b68d5a07324b60a3645d22961118b4 Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Mon, 10 Aug 2020 00:57:27 +0200 Subject: [PATCH] Fix pathnames such that tests can run from the project root --- tests/PolyphonyT.cpp | 22 +++++++++++----------- tests/SynthT.cpp | 38 +++++++++++++++++++------------------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/tests/PolyphonyT.cpp b/tests/PolyphonyT.cpp index 15173915..0fa3aa01 100644 --- a/tests/PolyphonyT.cpp +++ b/tests/PolyphonyT.cpp @@ -17,7 +17,7 @@ constexpr int blockSize { 256 }; TEST_CASE("[Polyphony] Polyphony in hierarchy") { sfz::Synth synth; - synth.loadSfzString(fs::current_path(), R"( + synth.loadSfzString(fs::current_path() / "tests/TestFiles/polyphony.sfz", R"( key=61 sample=*sine polyphony=2 polyphony=2 key=62 sample=*sine @@ -44,7 +44,7 @@ TEST_CASE("[Polyphony] Polyphony in hierarchy") TEST_CASE("[Polyphony] Polyphony groups") { sfz::Synth synth; - synth.loadSfzString(fs::current_path(), R"( + synth.loadSfzString(fs::current_path() / "tests/TestFiles/polyphony.sfz", R"( polyphony=2 key=62 sample=*sine group=1 polyphony=3 @@ -71,7 +71,7 @@ TEST_CASE("[Polyphony] Polyphony groups") TEST_CASE("[Polyphony] group polyphony limits") { sfz::Synth synth; - synth.loadSfzString(fs::current_path(), R"( + synth.loadSfzString(fs::current_path() / "tests/TestFiles/polyphony.sfz", R"( group=1 polyphony=2 sample=*sine key=65 )"); @@ -84,7 +84,7 @@ TEST_CASE("[Polyphony] group polyphony limits") TEST_CASE("[Polyphony] Hierarchy polyphony limits") { sfz::Synth synth; - synth.loadSfzString(fs::current_path(), R"( + synth.loadSfzString(fs::current_path() / "tests/TestFiles/polyphony.sfz", R"( polyphony=2 sample=*sine key=65 )"); @@ -97,7 +97,7 @@ TEST_CASE("[Polyphony] Hierarchy polyphony limits") TEST_CASE("[Polyphony] Hierarchy polyphony limits (group)") { sfz::Synth synth; - synth.loadSfzString(fs::current_path(), R"( + synth.loadSfzString(fs::current_path() / "tests/TestFiles/polyphony.sfz", R"( polyphony=2 sample=*sine key=65 )"); @@ -110,7 +110,7 @@ TEST_CASE("[Polyphony] Hierarchy polyphony limits (group)") TEST_CASE("[Polyphony] Hierarchy polyphony limits (master)") { sfz::Synth synth; - synth.loadSfzString(fs::current_path(), R"( + synth.loadSfzString(fs::current_path() / "tests/TestFiles/polyphony.sfz", R"( polyphony=2 polyphony=5 sample=*sine key=65 @@ -124,7 +124,7 @@ TEST_CASE("[Polyphony] Hierarchy polyphony limits (master)") TEST_CASE("[Polyphony] Hierarchy polyphony limits (limit in another master)") { sfz::Synth synth; - synth.loadSfzString(fs::current_path(), R"( + synth.loadSfzString(fs::current_path() / "tests/TestFiles/polyphony.sfz", R"( polyphony=2 sample=*saw key=65 @@ -143,7 +143,7 @@ TEST_CASE("[Polyphony] Hierarchy polyphony limits (limit in another master)") TEST_CASE("[Polyphony] Hierarchy polyphony limits (global)") { sfz::Synth synth; - synth.loadSfzString(fs::current_path(), R"( + synth.loadSfzString(fs::current_path() / "tests/TestFiles/polyphony.sfz", R"( polyphony=2 polyphony=5 sample=*sine key=65 @@ -159,7 +159,7 @@ TEST_CASE("[Polyphony] Polyphony in master") sfz::Synth synth; synth.setSamplesPerBlock(blockSize); sfz::AudioBuffer buffer { 2, blockSize }; - synth.loadSfzString(fs::current_path(), R"( + synth.loadSfzString(fs::current_path() / "tests/TestFiles/polyphony.sfz", R"( polyphony=2 group=2 sample=*sine key=65 @@ -192,7 +192,7 @@ TEST_CASE("[Polyphony] Polyphony in master") TEST_CASE("[Polyphony] Self-masking") { sfz::Synth synth; - synth.loadSfzString(fs::current_path(), R"( + synth.loadSfzString(fs::current_path() / "tests/TestFiles/polyphony.sfz", R"( sample=*sine key=64 note_polyphony=2 )"); synth.noteOn(0, 64, 63); @@ -210,7 +210,7 @@ TEST_CASE("[Polyphony] Self-masking") TEST_CASE("[Polyphony] Not self-masking") { sfz::Synth synth; - synth.loadSfzString(fs::current_path(), R"( + synth.loadSfzString(fs::current_path() / "tests/TestFiles/polyphony.sfz", R"( sample=*sine key=66 note_polyphony=2 note_selfmask=off )"); synth.noteOn(0, 66, 63); diff --git a/tests/SynthT.cpp b/tests/SynthT.cpp index ef63db86..a6ec1aa2 100644 --- a/tests/SynthT.cpp +++ b/tests/SynthT.cpp @@ -540,7 +540,7 @@ TEST_CASE("[Synth] sample quality") TEST_CASE("[Synth] Sister voices") { sfz::Synth synth; - synth.loadSfzString(fs::current_path(), R"( + synth.loadSfzString(fs::current_path() / "tests/TestFiles/sister_voices.sfz", R"( key=61 sample=*sine key=62 sample=*sine key=62 sample=*sine @@ -577,7 +577,7 @@ TEST_CASE("[Synth] Apply function on sisters") { sfz::Synth synth; sfz::AudioBuffer buffer { 2, 256 }; - synth.loadSfzString(fs::current_path(), R"( + synth.loadSfzString(fs::current_path() / "tests/TestFiles/sister_voices.sfz", R"( key=63 sample=*saw key=63 sample=*saw key=63 sample=*saw @@ -595,7 +595,7 @@ TEST_CASE("[Synth] Sisters and off-by") { sfz::Synth synth; sfz::AudioBuffer buffer { 2, 256 }; - synth.loadSfzString(fs::current_path(), R"( + synth.loadSfzString(fs::current_path() / "tests/TestFiles/sister_voices.sfz", R"( key=62 sample=*sine group=1 off_by=2 key=62 sample=*sine group=2 key=63 sample=*saw @@ -615,7 +615,7 @@ TEST_CASE("[Synth] Sisters and off-by") TEST_CASE("[Synth] Release key") { sfz::Synth synth; - synth.loadSfzString(fs::current_path(), R"( + synth.loadSfzString(fs::current_path() / "tests/TestFiles/release.sfz", R"( key=62 sample=*sine trigger=release_key )"); synth.noteOn(0, 62, 85); @@ -627,7 +627,7 @@ TEST_CASE("[Synth] Release key") TEST_CASE("[Synth] Release") { sfz::Synth synth; - synth.loadSfzString(fs::current_path(), R"( + synth.loadSfzString(fs::current_path() / "tests/TestFiles/release.sfz", R"( key=62 sample=*silence key=62 sample=*sine trigger=release )"); @@ -642,7 +642,7 @@ TEST_CASE("[Synth] Release") TEST_CASE("[Synth] Release (pedal was already down)") { sfz::Synth synth; - synth.loadSfzString(fs::current_path(), R"( + synth.loadSfzString(fs::current_path() / "tests/TestFiles/release.sfz", R"( key=62 sample=*silence key=62 sample=*sine trigger=release )"); @@ -659,7 +659,7 @@ TEST_CASE("[Synth] Release (pedal was already down)") TEST_CASE("[Synth] Release samples don't play unless there is another playing region that matches") { sfz::Synth synth; - synth.loadSfzString(fs::current_path(), R"( + synth.loadSfzString(fs::current_path() / "tests/TestFiles/release.sfz", R"( key=62 sample=*sine trigger=release )"); synth.noteOn(0, 62, 85); @@ -675,7 +675,7 @@ TEST_CASE("[Synth] Release samples don't play unless there is another playing re TEST_CASE("[Synth] Release key (Different sustain CC)") { sfz::Synth synth; - synth.loadSfzString(fs::current_path(), R"( + synth.loadSfzString(fs::current_path() / "tests/TestFiles/release.sfz", R"( sustain_cc=54 key=62 sample=*sine trigger=release_key )"); @@ -688,7 +688,7 @@ TEST_CASE("[Synth] Release key (Different sustain CC)") TEST_CASE("[Synth] Release (Different sustain CC)") { sfz::Synth synth; - synth.loadSfzString(fs::current_path(), R"( + synth.loadSfzString(fs::current_path() / "tests/TestFiles/release.sfz", R"( sustain_cc=54 key=62 sample=*silence key=62 sample=*sine trigger=release @@ -704,7 +704,7 @@ TEST_CASE("[Synth] Release (Different sustain CC)") TEST_CASE("[Synth] Sustain threshold default") { sfz::Synth synth; - synth.loadSfzString(fs::current_path(), R"( + synth.loadSfzString(fs::current_path() / "tests/TestFiles/release.sfz", R"( key=62 sample=*sine trigger=release )"); synth.noteOn(0, 62, 85); @@ -716,7 +716,7 @@ TEST_CASE("[Synth] Sustain threshold default") TEST_CASE("[Synth] Sustain threshold") { sfz::Synth synth; - synth.loadSfzString(fs::current_path(), R"( + synth.loadSfzString(fs::current_path() / "tests/TestFiles/release.sfz", R"( sustain_lo=63 key=62 sample=*silence key=62 sample=*sine trigger=release @@ -762,7 +762,7 @@ const std::vector getActiveVoices(const sfz::Synth& synth) TEST_CASE("[Synth] Release (Multiple notes, release_key ignores the pedal)") { sfz::Synth synth; - synth.loadSfzString(fs::current_path(), R"( + synth.loadSfzString(fs::current_path() / "tests/TestFiles/release.sfz", R"( lokey=62 hikey=64 sample=*sine trigger=release_key )"); synth.noteOn(0, 62, 85); @@ -786,7 +786,7 @@ TEST_CASE("[Synth] Release (Multiple notes, release_key ignores the pedal)") TEST_CASE("[Synth] Release (Multiple notes, release, cleared the delayed voices after)") { sfz::Synth synth; - synth.loadSfzString(fs::current_path(), R"( + synth.loadSfzString(fs::current_path() / "tests/TestFiles/release.sfz", R"( lokey=62 hikey=64 sample=*silence lokey=62 hikey=64 sample=*sine trigger=release loopmode=one_shot ampeg_attack=0.02 ampeg_release=0.1 @@ -816,7 +816,7 @@ TEST_CASE("[Synth] Release (Multiple notes, release, cleared the delayed voices TEST_CASE("[Synth] Release (Multiple notes after pedal is down, release, cleared the delayed voices after)") { sfz::Synth synth; - synth.loadSfzString(fs::current_path(), R"( + synth.loadSfzString(fs::current_path() / "tests/TestFiles/release.sfz", R"( lokey=62 hikey=64 sample=*silence lokey=62 hikey=64 sample=*sine trigger=release loopmode=one_shot ampeg_attack=0.02 ampeg_release=0.1 @@ -846,7 +846,7 @@ TEST_CASE("[Synth] Release (Multiple notes after pedal is down, release, cleared TEST_CASE("[Synth] Release (Multiple note ons during pedal down)") { sfz::Synth synth; - synth.loadSfzString(fs::current_path(), R"( + synth.loadSfzString(fs::current_path() / "tests/TestFiles/release.sfz", R"( lokey=62 hikey=64 sample=*silence lokey=62 hikey=64 sample=*sine trigger=release loopmode=one_shot ampeg_attack=0.02 ampeg_release=0.1 @@ -876,8 +876,8 @@ TEST_CASE("[Synth] No release sample after the main sample stopped sounding by d synth.setSamplesPerBlock(4096); sfz::AudioBuffer buffer { 2, 4096 }; - synth.loadSfzString(fs::current_path(), R"( - lokey=62 hikey=64 sample=tests/TestFiles/closedhat.wav loop_mode=one_shot + synth.loadSfzString(fs::current_path() / "tests/TestFiles/release.sfz", R"( + lokey=62 hikey=64 sample=closedhat.wav loop_mode=one_shot lokey=62 hikey=64 sample=*sine trigger=release loopmode=one_shot ampeg_attack=0.02 ampeg_release=0.1 )"); @@ -911,8 +911,8 @@ TEST_CASE("[Synth] If rt_dead is active the release sample can sound after the a synth.setSamplesPerBlock(4096); sfz::AudioBuffer buffer { 2, 4096 }; - synth.loadSfzString(fs::current_path(), R"( - lokey=62 hikey=64 sample=tests/TestFiles/closedhat.wav loop_mode=one_shot + synth.loadSfzString(fs::current_path() / "tests/TestFiles/release.sfz", R"( + lokey=62 hikey=64 sample=closedhat.wav loop_mode=one_shot lokey=62 hikey=64 sample=*sine trigger=release loopmode=one_shot ampeg_attack=0.02 ampeg_release=0.1 )");