add test for WavPack DSD (issue #962)

This commit is contained in:
David Bryant
2020-07-01 08:35:20 -07:00
parent 872cafb0b9
commit ec9c49b964
2 changed files with 16 additions and 0 deletions

BIN
tests/data/dsd_stereo.wv Normal file

Binary file not shown.

View File

@ -41,6 +41,7 @@ class TestWavPack : public CppUnit::TestFixture
CPPUNIT_TEST_SUITE(TestWavPack);
CPPUNIT_TEST(testNoLengthProperties);
CPPUNIT_TEST(testMultiChannelProperties);
CPPUNIT_TEST(testDsdStereoProperties);
CPPUNIT_TEST(testTaggedProperties);
CPPUNIT_TEST(testFuzzedFile);
CPPUNIT_TEST(testStripAndProperties);
@ -79,6 +80,21 @@ public:
CPPUNIT_ASSERT_EQUAL(1031, f.audioProperties()->version());
}
void testDsdStereoProperties()
{
WavPack::File f(TEST_FILE_PATH_C("dsd_stereo.wv"));
CPPUNIT_ASSERT(f.audioProperties());
CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(200, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(2096, f.audioProperties()->bitrate());
CPPUNIT_ASSERT_EQUAL(2, f.audioProperties()->channels());
CPPUNIT_ASSERT_EQUAL(8, f.audioProperties()->bitsPerSample());
CPPUNIT_ASSERT_EQUAL(true, f.audioProperties()->isLossless());
CPPUNIT_ASSERT_EQUAL(352800, f.audioProperties()->sampleRate());
CPPUNIT_ASSERT_EQUAL(70560U, f.audioProperties()->sampleFrames());
CPPUNIT_ASSERT_EQUAL(1040, f.audioProperties()->version());
}
void testTaggedProperties()
{
WavPack::File f(TEST_FILE_PATH_C("tagged.wv"));