aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorUrs Fleisch <ufleisch@users.sourceforge.net>2020-12-21 15:41:57 +0100
committerUrs Fleisch <ufleisch@users.sourceforge.net>2020-12-21 15:42:13 +0100
commit1332d44ff6d5b769d21a63c156e501f735e5ca5b (patch)
tree665272dbde19fa942b726387f4e654b19521b81a /tests
parentbad2cea1225d38e2c836e58771f9470760f61b70 (diff)
WAV: Test properties of file with WAVE_FORMAT_EXTENSIBLE
uint8we.wav: http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Samples/AFsp/M1F1-uint8WE-AFsp.wav
Diffstat (limited to 'tests')
-rw-r--r--tests/data/uint8we.wavbin0 -> 47240 bytes
-rw-r--r--tests/test_wav.cpp15
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/data/uint8we.wav b/tests/data/uint8we.wav
new file mode 100644
index 00000000..9623db22
--- /dev/null
+++ b/tests/data/uint8we.wav
Binary files differ
diff --git a/tests/test_wav.cpp b/tests/test_wav.cpp
index fd0c04f7..e94864ba 100644
--- a/tests/test_wav.cpp
+++ b/tests/test_wav.cpp
@@ -52,6 +52,7 @@ class TestWAV : public CppUnit::TestFixture
CPPUNIT_TEST(testFuzzedFile2);
CPPUNIT_TEST(testStripAndProperties);
CPPUNIT_TEST(testPCMWithFactChunk);
+ CPPUNIT_TEST(testWaveFormatExtensible);
CPPUNIT_TEST_SUITE_END();
public:
@@ -305,6 +306,20 @@ public:
CPPUNIT_ASSERT_EQUAL(1, f.audioProperties()->format());
}
+ void testWaveFormatExtensible()
+ {
+ RIFF::WAV::File f(TEST_FILE_PATH_C("uint8we.wav"));
+ CPPUNIT_ASSERT(f.audioProperties());
+ CPPUNIT_ASSERT_EQUAL(2, f.audioProperties()->lengthInSeconds());
+ CPPUNIT_ASSERT_EQUAL(2937, f.audioProperties()->lengthInMilliseconds());
+ CPPUNIT_ASSERT_EQUAL(128, f.audioProperties()->bitrate());
+ CPPUNIT_ASSERT_EQUAL(2, f.audioProperties()->channels());
+ CPPUNIT_ASSERT_EQUAL(8000, f.audioProperties()->sampleRate());
+ CPPUNIT_ASSERT_EQUAL(8, f.audioProperties()->bitsPerSample());
+ CPPUNIT_ASSERT_EQUAL(23493U, f.audioProperties()->sampleFrames());
+ CPPUNIT_ASSERT_EQUAL(1, f.audioProperties()->format());
+ }
+
};
CPPUNIT_TEST_SUITE_REGISTRATION(TestWAV);