mirror of
https://github.com/taglib/taglib.git
synced 2025-06-04 01:28:21 -04:00
added APE tag PropertyMap test
This commit is contained in:
parent
d28cc83fb4
commit
05b5e06928
@ -5,6 +5,9 @@
|
||||
#include <tstringlist.h>
|
||||
#include <tbytevectorlist.h>
|
||||
#include <apefile.h>
|
||||
#include <apetag.h>
|
||||
#include <apeitem.h>
|
||||
#include <tpropertymap.h>
|
||||
#include "utils.h"
|
||||
|
||||
using namespace std;
|
||||
@ -16,6 +19,7 @@ class TestAPE : public CppUnit::TestFixture
|
||||
CPPUNIT_TEST(testProperties399);
|
||||
CPPUNIT_TEST(testProperties396);
|
||||
CPPUNIT_TEST(testProperties390);
|
||||
CPPUNIT_TEST(testPropertyinterface);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
@ -47,6 +51,27 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(44100, f.audioProperties()->sampleRate());
|
||||
}
|
||||
|
||||
void testPropertyinterface()
|
||||
{
|
||||
APE::Tag tag;
|
||||
APE::Item item1 = APE::Item("TRACK", "17");
|
||||
tag.setItem("TRACK", item1);
|
||||
|
||||
APE::Item item2 = APE::Item();
|
||||
item2.setType(APE::Item::Binary);
|
||||
tag.setItem("TESTBINARY", item2);
|
||||
|
||||
PropertyMap properties = tag.properties();
|
||||
CPPUNIT_ASSERT_EQUAL(1u, properties.unsupportedData().size());
|
||||
CPPUNIT_ASSERT(properties.contains("TRACKNUMBER"));
|
||||
CPPUNIT_ASSERT(!properties.contains("TRACK"));
|
||||
CPPUNIT_ASSERT(tag.itemListMap().contains("TESTBINARY"));
|
||||
|
||||
tag.removeUnsupportedProperties(properties.unsupportedData());
|
||||
CPPUNIT_ASSERT(!tag.itemListMap().contains("TESTBINARY"));
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(TestAPE);
|
||||
|
Loading…
x
Reference in New Issue
Block a user