Support INFO tags of RIFF wave files.

This commit is contained in:
Tsuda Kageyu
2012-08-26 10:12:40 +09:00
parent aa34afda79
commit 9c8c215c30
8 changed files with 682 additions and 47 deletions

View File

@ -29,6 +29,7 @@ class TestFileRef : public CppUnit::TestFixture
CPPUNIT_TEST(testMP4_3);
CPPUNIT_TEST(testTrueAudio);
CPPUNIT_TEST(testAPE);
CPPUNIT_TEST(testWav);
CPPUNIT_TEST_SUITE_END();
public:
@ -127,6 +128,11 @@ public:
fileRefSave("no-tags", ".3g2");
}
void testWav()
{
fileRefSave("empty", ".wav");
}
void testOGA_FLAC()
{
FileRef *f = new FileRef(TEST_FILE_PATH_C("empty_flac.oga"));
@ -143,7 +149,7 @@ public:
void testAPE()
{
fileRefSave("mac-399.ape", ".ape");
fileRefSave("mac-399", ".ape");
}
};

45
tests/test_info.cpp Normal file
View File

@ -0,0 +1,45 @@
#include <cppunit/extensions/HelperMacros.h>
#include <string>
#include <stdio.h>
#include <infotag.h>
#include <tpropertymap.h>
#include <tdebug.h>
#include "utils.h"
using namespace std;
using namespace TagLib;
class TestInfoTag : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE(TestInfoTag);
CPPUNIT_TEST(testTitle);
CPPUNIT_TEST(testNumericFields);
CPPUNIT_TEST_SUITE_END();
public:
void testTitle()
{
RIFF::Info::Tag tag;
CPPUNIT_ASSERT_EQUAL(String(""), tag.title());
tag.setTitle("Test title 1");
CPPUNIT_ASSERT_EQUAL(String("Test title 1"), tag.title());
}
void testNumericFields()
{
RIFF::Info::Tag tag;
CPPUNIT_ASSERT_EQUAL((uint)0, tag.track());
tag.setTrack(1234);
CPPUNIT_ASSERT_EQUAL((uint)1234, tag.track());
CPPUNIT_ASSERT_EQUAL(String("1234"), tag.fieldText("IPRT"));
CPPUNIT_ASSERT_EQUAL((uint)0, tag.year());
tag.setYear(1234);
CPPUNIT_ASSERT_EQUAL((uint)1234, tag.year());
CPPUNIT_ASSERT_EQUAL(String("1234"), tag.fieldText("ICRD"));
}
};
CPPUNIT_TEST_SUITE_REGISTRATION(TestInfoTag);