Add a test for surge and clm wavetable files

This commit is contained in:
Jean Pierre Cimalando 2020-08-09 22:36:57 +02:00
parent d6b98d531d
commit 2eb12daf0c
3 changed files with 32 additions and 0 deletions

Binary file not shown.

Binary file not shown.

View file

@ -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));
}