Added a test for the default path
This commit is contained in:
parent
a0a6ab1d65
commit
55f1fa2c42
4 changed files with 22 additions and 1 deletions
|
|
@ -322,7 +322,7 @@ TEST_CASE("[Files] Specific bug: relative path with backslashes")
|
|||
sfz::Synth synth;
|
||||
synth.loadSfzFile(fs::current_path() / "tests/TestFiles/SpecificBugs/win_backslashes.sfz");
|
||||
REQUIRE(synth.getNumRegions() == 1);
|
||||
REQUIRE(synth.getRegionView(0)->sample == R"(closedhat.wav)");
|
||||
REQUIRE(synth.getRegionView(0)->sample == R"(Xylo/Subfolder/closedhat.wav)");
|
||||
}
|
||||
|
||||
TEST_CASE("[Synth] Testing channel 1")
|
||||
|
|
@ -360,3 +360,14 @@ TEST_CASE("[Synth] Testing channel 16")
|
|||
REQUIRE( region != nullptr );
|
||||
REQUIRE( region->sample == "dummy16.wav" );
|
||||
}
|
||||
|
||||
TEST_CASE("[Files] Default path")
|
||||
{
|
||||
sfz::Synth synth;
|
||||
synth.loadSfzFile(fs::current_path() / "tests/TestFiles/default_path.sfz");
|
||||
REQUIRE(synth.getNumRegions() == 4);
|
||||
REQUIRE(synth.getRegionView(0)->sample == R"(DefaultPath/SubPath1/sample1.wav)");
|
||||
REQUIRE(synth.getRegionView(1)->sample == R"(DefaultPath/SubPath2/sample2.wav)");
|
||||
REQUIRE(synth.getRegionView(2)->sample == R"(DefaultPath/SubPath1/sample1.wav)");
|
||||
REQUIRE(synth.getRegionView(3)->sample == R"(DefaultPath/SubPath2/sample2.wav)");
|
||||
}
|
||||
BIN
tests/TestFiles/DefaultPath/SubPath1/sample1.wav
Executable file
BIN
tests/TestFiles/DefaultPath/SubPath1/sample1.wav
Executable file
Binary file not shown.
BIN
tests/TestFiles/DefaultPath/SubPath2/sample2.wav
Executable file
BIN
tests/TestFiles/DefaultPath/SubPath2/sample2.wav
Executable file
Binary file not shown.
10
tests/TestFiles/default_path.sfz
Normal file
10
tests/TestFiles/default_path.sfz
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<region> sample=DefaultPath/SubPath1/sample1.wav
|
||||
|
||||
<control> default_path=DefaultPath\SubPath2
|
||||
<region> sample=sample2.wav
|
||||
|
||||
<control> default_path=DefaultPath/SubPath1
|
||||
<region> sample=sample1.wav
|
||||
|
||||
<control> default_path=DefaultPath/SubPath2/
|
||||
<region> sample=sample2.wav
|
||||
Loading…
Add table
Reference in a new issue