mirror of
https://github.com/taglib/taglib.git
synced 2025-07-18 21:14:23 -04:00
Efficient lookup for the MP4/ASF field name and ID3v1 genre tables.
Linear lookup is much faster and memory efficient when an array is very small.
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
#include <tstring.h>
|
||||
#include <mpegfile.h>
|
||||
#include <id3v1tag.h>
|
||||
#include <id3v1genres.h>
|
||||
#include <cppunit/extensions/HelperMacros.h>
|
||||
#include "utils.h"
|
||||
|
||||
@ -13,6 +14,7 @@ class TestID3v1 : public CppUnit::TestFixture
|
||||
{
|
||||
CPPUNIT_TEST_SUITE(TestID3v1);
|
||||
CPPUNIT_TEST(testStripWhiteSpace);
|
||||
CPPUNIT_TEST(testGenres);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
@ -27,7 +29,7 @@ public:
|
||||
f.ID3v1Tag(true)->setArtist("Artist ");
|
||||
f.save();
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
MPEG::File f(newname.c_str());
|
||||
CPPUNIT_ASSERT(f.ID3v1Tag(false));
|
||||
@ -35,6 +37,12 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void testGenres()
|
||||
{
|
||||
CPPUNIT_ASSERT_EQUAL(String("Darkwave"), ID3v1::genre(50));
|
||||
CPPUNIT_ASSERT_EQUAL(100, ID3v1::genreIndex("Humour"));
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(TestID3v1);
|
||||
|
Reference in New Issue
Block a user