Add some tests for M4V files.

This commit is contained in:
Tsuda Kageyu 2015-11-30 17:18:50 +09:00
parent d1ceffd1f0
commit 59088096e6
3 changed files with 21 additions and 0 deletions

BIN
tests/data/blank_video.m4v Normal file

Binary file not shown.

View File

@ -153,6 +153,11 @@ public:
fileRefSave("no-tags", ".3g2");
}
void testMP4_4()
{
fileRefSave("blank_video", ".m4v");
}
void testWav()
{
fileRefSave("empty", ".wav");

View File

@ -17,6 +17,7 @@ class TestMP4 : public CppUnit::TestFixture
CPPUNIT_TEST_SUITE(TestMP4);
CPPUNIT_TEST(testPropertiesAAC);
CPPUNIT_TEST(testPropertiesALAC);
CPPUNIT_TEST(testPropertiesM4V);
CPPUNIT_TEST(testFreeForm);
CPPUNIT_TEST(testCheckValid);
CPPUNIT_TEST(testHasTag);
@ -64,6 +65,21 @@ public:
CPPUNIT_ASSERT_EQUAL(MP4::Properties::ALAC, f.audioProperties()->codec());
}
void testPropertiesM4V()
{
MP4::File f(TEST_FILE_PATH_C("blank_video.m4v"));
CPPUNIT_ASSERT(f.audioProperties());
CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(975, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(96, f.audioProperties()->bitrate());
CPPUNIT_ASSERT_EQUAL(2, f.audioProperties()->channels());
CPPUNIT_ASSERT_EQUAL(44100, f.audioProperties()->sampleRate());
CPPUNIT_ASSERT_EQUAL(16, f.audioProperties()->bitsPerSample());
CPPUNIT_ASSERT_EQUAL(false, f.audioProperties()->isEncrypted());
CPPUNIT_ASSERT_EQUAL(MP4::Properties::AAC, f.audioProperties()->codec());
}
void testCheckValid()
{
MP4::File f(TEST_FILE_PATH_C("empty.aiff"));