diff options
author | Urs Fleisch <ufleisch@users.sourceforge.net> | 2020-12-27 19:53:05 +0100 |
---|---|---|
committer | Urs Fleisch <ufleisch@users.sourceforge.net> | 2020-12-27 19:53:11 +0100 |
commit | ae867cbd8c3bd20c6a257ba98578aabcdc2c321c (patch) | |
tree | 8a83d6a8b5a5c608f9c8a287aed2460a9fa676e7 /tests | |
parent | e5ad041e42caa0fc3a18d60713135cb146190202 (diff) |
ID3v1: Improve compatibility by mapping renamed genre names to codes
Also added a test to check if the renamed genre names are used and
check if using the old names still works.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_id3v1.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_id3v1.cpp b/tests/test_id3v1.cpp index 3358aead..c50c3428 100644 --- a/tests/test_id3v1.cpp +++ b/tests/test_id3v1.cpp @@ -40,6 +40,7 @@ class TestID3v1 : public CppUnit::TestFixture CPPUNIT_TEST_SUITE(TestID3v1); CPPUNIT_TEST(testStripWhiteSpace); CPPUNIT_TEST(testGenres); + CPPUNIT_TEST(testRenamedGenres); CPPUNIT_TEST_SUITE_END(); public: @@ -68,6 +69,18 @@ public: CPPUNIT_ASSERT_EQUAL(100, ID3v1::genreIndex("Humour")); } + void testRenamedGenres() + { + CPPUNIT_ASSERT_EQUAL(String("Bebop"), ID3v1::genre(85)); + CPPUNIT_ASSERT_EQUAL(85, ID3v1::genreIndex("Bebop")); + CPPUNIT_ASSERT_EQUAL(85, ID3v1::genreIndex("Bebob")); + + ID3v1::Tag tag; + tag.setGenre("Hardcore"); + CPPUNIT_ASSERT_EQUAL(String("Hardcore Techno"), tag.genre()); + CPPUNIT_ASSERT_EQUAL(129U, tag.genreNumber()); + } + }; CPPUNIT_TEST_SUITE_REGISTRATION(TestID3v1); |