Add a test for surge and clm wavetable files
This commit is contained in:
parent
d6b98d531d
commit
2eb12daf0c
3 changed files with 32 additions and 0 deletions
BIN
tests/TestFiles/wavetables/clm.wav
Normal file
BIN
tests/TestFiles/wavetables/clm.wav
Normal file
Binary file not shown.
BIN
tests/TestFiles/wavetables/surge.wav
Normal file
BIN
tests/TestFiles/wavetables/surge.wav
Normal file
Binary file not shown.
|
|
@ -5,6 +5,7 @@
|
|||
// If not, contact the sfizz maintainers at https://github.com/sfztools/sfizz
|
||||
|
||||
#include "sfizz/Wavetables.h"
|
||||
#include "sfizz/FileMetadata.h"
|
||||
#include "sfizz/MathHelpers.h"
|
||||
#include "catch2/catch.hpp"
|
||||
#include <algorithm>
|
||||
|
|
@ -54,3 +55,34 @@ TEST_CASE("[Wavetables] Octave number lookup")
|
|||
REQUIRE(oct == Approx(ref).margin(0.03f));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("[Wavetables] Wavetable sound files: Surge")
|
||||
{
|
||||
sfz::FileMetadataReader reader;
|
||||
sfz::WavetableInfo wt;
|
||||
|
||||
REQUIRE(reader.open("tests/TestFiles/wavetables/surge.wav"));
|
||||
REQUIRE(reader.extractWavetableInfo(wt));
|
||||
|
||||
REQUIRE(wt.tableSize == 256);
|
||||
}
|
||||
|
||||
TEST_CASE("[Wavetables] Wavetable sound files: Clm")
|
||||
{
|
||||
sfz::FileMetadataReader reader;
|
||||
sfz::WavetableInfo wt;
|
||||
|
||||
REQUIRE(reader.open("tests/TestFiles/wavetables/clm.wav"));
|
||||
REQUIRE(reader.extractWavetableInfo(wt));
|
||||
|
||||
REQUIRE(wt.tableSize == 256);
|
||||
}
|
||||
|
||||
TEST_CASE("[Wavetables] Non-wavetable sound files")
|
||||
{
|
||||
sfz::FileMetadataReader reader;
|
||||
sfz::WavetableInfo wt;
|
||||
|
||||
REQUIRE(reader.open("tests/TestFiles/snare.wav"));
|
||||
REQUIRE(!reader.extractWavetableInfo(wt));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue