#include <tstringlist.h>
#include <tbytevectorlist.h>
#include <apefile.h>
-#include <apetag.h>
-#include <apeitem.h>
-#include <tpropertymap.h>
#include "utils.h"
using namespace std;
CPPUNIT_TEST(testProperties399);
CPPUNIT_TEST(testProperties396);
CPPUNIT_TEST(testProperties390);
- CPPUNIT_TEST(testPropertyinterface);
CPPUNIT_TEST_SUITE_END();
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);
#include <tbytevectorlist.h>
#include <tpropertymap.h>
#include <apetag.h>
+#include <tdebug.h>
#include "utils.h"
using namespace std;
CPPUNIT_TEST_SUITE(TestAPETag);
CPPUNIT_TEST(testIsEmpty);
CPPUNIT_TEST(testIsEmpty2);
- CPPUNIT_TEST(testDict);
+ CPPUNIT_TEST(testPropertyInterface1);
+ CPPUNIT_TEST(testPropertyInterface2);
CPPUNIT_TEST_SUITE_END();
public:
CPPUNIT_ASSERT(!tag.isEmpty());
}
- void testDict()
+ void testPropertyInterface1()
{
APE::Tag tag;
PropertyMap dict = tag.properties();
CPPUNIT_ASSERT_EQUAL(17u, tag.track());
}
+ void testPropertyInterface2()
+ {
+ 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"));
+
+ APE::Item item3 = APE::Item("TRACKNUMBER", "29");
+ tag.setItem("TRACKNUMBER", item3);
+ properties = tag.properties();
+ CPPUNIT_ASSERT_EQUAL(2u, properties["TRACKNUMBER"].size());
+ CPPUNIT_ASSERT_EQUAL(String("17"), properties["TRACKNUMBER"][0]);
+ CPPUNIT_ASSERT_EQUAL(String("29"), properties["TRACKNUMBER"][1]);
+
+ }
+
};
CPPUNIT_TEST_SUITE_REGISTRATION(TestAPETag);
+
#include <cppunit/extensions/HelperMacros.h>
#include <modfile.h>
+#include <tpropertymap.h>
#include "utils.h"
using namespace std;
CPPUNIT_TEST_SUITE(TestMod);
CPPUNIT_TEST(testReadTags);
CPPUNIT_TEST(testWriteTags);
+ CPPUNIT_TEST(testPropertyInterface);
CPPUNIT_TEST_SUITE_END();
public:
TEST_FILE_PATH_C("changed.mod")));
}
+ void testPropertyInterface()
+ {
+ Mod::Tag t;
+ PropertyMap properties;
+ properties["BLA"] = String("bla");
+ properties["ARTIST"] = String("artist1");
+ properties["ARTIST"].append("artist2");
+ properties["TITLE"] = String("title");
+
+ PropertyMap unsupported = t.setProperties(properties);
+ CPPUNIT_ASSERT(unsupported.contains("BLA"));
+ CPPUNIT_ASSERT(unsupported.contains("ARTIST"));
+ CPPUNIT_ASSERT_EQUAL(properties["ARTIST"], unsupported["ARTIST"]);
+ CPPUNIT_ASSERT(!unsupported.contains("TITLE"));
+ }
+
private:
void testRead(FileName fileName, const String &title, const String &comment)
{