mirror of
https://github.com/taglib/taglib.git
synced 2025-07-19 05:24:25 -04:00
Support INFO tags of RIFF wave files.
This commit is contained in:
@ -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
45
tests/test_info.cpp
Normal 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);
|
Reference in New Issue
Block a user