mirror of
https://github.com/taglib/taglib.git
synced 2025-07-19 05:24:25 -04:00
WavPack: A bit more accurate calculation of the stream length.
This commit is contained in:
BIN
tests/data/tagged.wv
Normal file
BIN
tests/data/tagged.wv
Normal file
Binary file not shown.
@ -14,6 +14,7 @@ class TestWavPack : public CppUnit::TestFixture
|
||||
CPPUNIT_TEST_SUITE(TestWavPack);
|
||||
CPPUNIT_TEST(testNoLengthProperties);
|
||||
CPPUNIT_TEST(testMultiChannelProperties);
|
||||
CPPUNIT_TEST(testTaggedProperties);
|
||||
CPPUNIT_TEST(testFuzzedFile);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
@ -51,6 +52,22 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(1031, f.audioProperties()->version());
|
||||
}
|
||||
|
||||
void testTaggedProperties()
|
||||
{
|
||||
WavPack::File f(TEST_FILE_PATH_C("tagged.wv"));
|
||||
CPPUNIT_ASSERT(f.audioProperties());
|
||||
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->length());
|
||||
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->lengthInSeconds());
|
||||
CPPUNIT_ASSERT_EQUAL(3550, f.audioProperties()->lengthInMilliseconds());
|
||||
CPPUNIT_ASSERT_EQUAL(172, f.audioProperties()->bitrate());
|
||||
CPPUNIT_ASSERT_EQUAL(2, f.audioProperties()->channels());
|
||||
CPPUNIT_ASSERT_EQUAL(16, f.audioProperties()->bitsPerSample());
|
||||
CPPUNIT_ASSERT_EQUAL(false, f.audioProperties()->isLossless());
|
||||
CPPUNIT_ASSERT_EQUAL(44100, f.audioProperties()->sampleRate());
|
||||
CPPUNIT_ASSERT_EQUAL(156556U, f.audioProperties()->sampleFrames());
|
||||
CPPUNIT_ASSERT_EQUAL(1031, f.audioProperties()->version());
|
||||
}
|
||||
|
||||
void testFuzzedFile()
|
||||
{
|
||||
WavPack::File f(TEST_FILE_PATH_C("infloop.wv"));
|
||||
|
Reference in New Issue
Block a user