]> granicus.if.org Git - taglib/commitdiff
fixed tests
authorMichael Helmling <helmling@mathematik.uni-kl.de>
Wed, 15 Feb 2012 21:09:28 +0000 (22:09 +0100)
committerMichael Helmling <helmling@mathematik.uni-kl.de>
Wed, 15 Feb 2012 21:09:28 +0000 (22:09 +0100)
tests/test_apetag.cpp
tests/test_flac.cpp
tests/test_id3v2.cpp
tests/test_ogg.cpp

index fc38907f8b4e001e5d27cf201b455f925f7cffb5..8419d9cecbaa369118b0343a5fd3c829b60e1941 100644 (file)
@@ -4,6 +4,7 @@
 #include <tag.h>
 #include <tstringlist.h>
 #include <tbytevectorlist.h>
+#include <tpropertymap.h>
 #include <apetag.h>
 #include "utils.h"
 
@@ -39,12 +40,12 @@ public:
   void testDict()
   {
          APE::Tag tag;
-         TagDict dict = tag.toDict();
+         PropertyMap dict = tag.properties();
          CPPUNIT_ASSERT(dict.isEmpty());
          dict["ARTIST"] = String("artist 1");
          dict["ARTIST"].append("artist 2");
          dict["TRACKNUMBER"].append("17");
-         tag.fromDict(dict);
+         tag.setProperties(dict);
          CPPUNIT_ASSERT_EQUAL(String("17"), tag.itemListMap()["TRACK"].values()[0]);
          CPPUNIT_ASSERT_EQUAL(2u, tag.itemListMap()["ARTIST"].values().size());
          CPPUNIT_ASSERT_EQUAL(String("artist 1"), tag.artist());
index f9a0afa479998491c8de3595c1f9ca3d03970f9c..1bf6015a21366e06878d346476a35c118b6018e2 100644 (file)
@@ -4,6 +4,7 @@
 #include <tag.h>
 #include <tstringlist.h>
 #include <tbytevectorlist.h>
+#include <tpropertymap.h>
 #include <flacfile.h>
 #include <xiphcomment.h>
 #include "utils.h"
@@ -216,15 +217,15 @@ public:
     string newname = copy.fileName();
 
     FLAC::File *f = new FLAC::File(newname.c_str());
-    TagDict dict;
+    PropertyMap dict;
     dict["ARTIST"].append("artøst 1");
     dict["ARTIST"].append("artöst 2");
-    f->fromDict(dict);
+    f->setProperties(dict);
     f->save();
     delete f;
 
     f = new FLAC::File(newname.c_str());
-    dict = f->toDict();
+    dict = f->properties();
     CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), dict["ARTIST"].size());
     CPPUNIT_ASSERT_EQUAL(String("artøst 1"), dict["ARTIST"][0]);
     CPPUNIT_ASSERT_EQUAL(String("artöst 2"), dict["ARTIST"][1]);
index 1ac1de8cce48ed99807e2d95752415ccc4c156c0..ee304fbb8b74f9dc26ca5835e135f0368f89fa09 100644 (file)
@@ -15,6 +15,7 @@
 #include <popularimeterframe.h>
 #include <urllinkframe.h>
 #include <tdebug.h>
+#include <tpropertymap.h>
 #include "utils.h"
 
 using namespace std;
index de25d3ed614bc4e07a7f08e45a4a36da0ed97987..b5c6b55727f12717a19145c55ee6896f09aaaca1 100644 (file)
@@ -4,6 +4,7 @@
 #include <tag.h>
 #include <tstringlist.h>
 #include <tbytevectorlist.h>
+#include <tpropertymap.h>
 #include <oggfile.h>
 #include <vorbisfile.h>
 #include <oggpageheader.h>
@@ -60,15 +61,15 @@ public:
 
     Vorbis::File *f = new Vorbis::File(newname.c_str());
 
-    CPPUNIT_ASSERT_EQUAL(uint(0), f->tag()->toDict().size());
+    CPPUNIT_ASSERT_EQUAL(uint(0), f->tag()->properties().size());
 
-    TagDict newTags;
+    PropertyMap newTags;
     StringList values("value 1");
     values.append("value 2");
     newTags["ARTIST"] = values;
-    f->tag()->fromDict(newTags);
+    f->tag()->setProperties(newTags);
 
-    TagDict map = f->tag()->toDict();
+    PropertyMap map = f->tag()->properties();
     CPPUNIT_ASSERT_EQUAL(uint(1), map.size());
     CPPUNIT_ASSERT_EQUAL(uint(2), map["ARTIST"].size());
     CPPUNIT_ASSERT_EQUAL(String("value 1"), map["ARTIST"][0]);
@@ -82,7 +83,7 @@ public:
     string newname = copy.fileName();
 
     Vorbis::File *f = new Vorbis::File(newname.c_str());
-    TagDict tags = f->tag()->toDict();
+    PropertyMap tags = f->tag()->properties();
 
     CPPUNIT_ASSERT_EQUAL(uint(2), tags["UNUSUALTAG"].size());
     CPPUNIT_ASSERT_EQUAL(String("usual value"), tags["UNUSUALTAG"][0]);
@@ -91,9 +92,9 @@ public:
 
     tags["UNICODETAG"][0] = L"νεω ναλυε";
     tags.erase("UNUSUALTAG");
-    f->tag()->fromDict(tags);
-    CPPUNIT_ASSERT_EQUAL(String(L"νεω ναλυε"), f->tag()->toDict()["UNICODETAG"][0]);
-    CPPUNIT_ASSERT_EQUAL(false, f->tag()->toDict().contains("UNUSUALTAG"));
+    f->tag()->setProperties(tags);
+    CPPUNIT_ASSERT_EQUAL(String(L"νεω ναλυε"), f->tag()->properties()["UNICODETAG"][0]);
+    CPPUNIT_ASSERT_EQUAL(false, f->tag()->properties().contains("UNUSUALTAG"));
 
     delete f;
   }