Commits

shuerhaaken committed 3824453

extend tests

Comments (0)

Files changed (12)

+commit 4f21707e613cebc8039a2b05fe39f17936b22ed6
+Author: Jörn Magens <shuerhaaken@googlemail.com>
+Date:   Thu Mar 21 13:59:31 2013 +0100
+
+    rename changed flag for dist str
+
 commit a56fa78dc0f597093461030e35dc151e2e9b725e
 Author: Jörn Magens <shuerhaaken@googlemail.com>
 Date:   Thu Mar 21 13:42:26 2013 +0100

libtaginfo/mp4info.cc

             if(changedflag & CHANGED_DATA_DISK_NUM) {
                 if(disk_amount < disk_number)
                     disk_amount = disk_number;
-                mp4_tag->itemListMap()["disk"] = TagLib::MP4::Item(disk_number, disk_amount); //ignore amount
+                mp4_tag->itemListMap()["disk"] = TagLib::MP4::Item(disk_number, disk_amount);
             }
             if(changedflag & CHANGED_IS_COMPILATION_TAG)
                 mp4_tag->itemListMap()["cpil"] = TagLib::MP4::Item(is_compilation);

tests/write_ape/main.cc

         info->set_title("titlöe");
         info->set_album_artist("äöé");
         info->set_is_compilation(true);
+        info->set_comments("Cömmmééèntß");
         info->write();
     }
     delete info;
         if(info->read()) {
             if(info->get_title() == "titlöe" &&
                info->get_album_artist() == "äöé" &&
-               info->get_is_compilation()) {
+               info->get_is_compilation() &&
+               info->get_comments() == "Cömmmééèntß") {
                 delete info;
                 if(remove(target.c_str()) != 0 )
                     return EXIT_FAILURE;

tests/write_flac/main.cc

         info->set_title(TESTNAME);
         info->set_album_artist("äää");
         info->set_is_compilation(true);
+        info->set_comments("Cömmmééèntß");
+        info->set_year(1978);
         info->write();
     }
     delete info;
         if( info->read() ) {
             if(info->get_title() == TESTNAME &&
                info->get_is_compilation() == true &&
-               info->get_album_artist() == "äää") {
+               info->get_year() == 1978 &&
+               info->get_album_artist() == "äää" &&
+               info->get_comments() == "Cömmmééèntß") {
                 delete info;
                 if(remove(target.c_str()) != 0 )
                     return EXIT_FAILURE;

tests/write_m4a/main.cc

         info->set_title(TESTNAME);
         info->set_album_artist("äöé");
         info->set_is_compilation(true);
+        info->set_comments("Cömmmééèntß");
+        info->set_year(1978);
         info->write();
     }
     delete info;
         if( info->read() ) {
             if(info->get_title() == TESTNAME &&
                info->get_album_artist() == "äöé" &&
+               info->get_year() == 1978 &&
+               info->get_comments() == "Cömmmééèntß" &&
                info->get_is_compilation()) {
                 delete info;
                 if(remove(target.c_str()) != 0 )

tests/write_mp3/main.cc

         info->set_album_artist("äöé");
         info->set_is_compilation(true);
         info->set_album_labels_list(labels);
+        info->set_artist_labels_list(labels);
+        info->set_track_labels_list(labels);
+        info->set_comments("Cömmmééèntß");
+        info->set_year(1978);
         info->write();
         //std::cout <<  "done writing mp3" << std::endl;
     }
         if( info->read() ) {
             if(info->get_title() == TESTNAME &&
                info->get_album_artist() == "äöé" &&
+               info->get_year() == 1978 &&
+               info->get_comments() == "Cömmmééèntß" &&
                info->get_is_compilation() == true &&
-               check_list_equal(info->get_album_labels_list(), labels) ) {
+               check_list_equal(info->get_artist_labels_list(), labels) &&
+               check_list_equal(info->get_album_labels_list(), labels) &&
+               check_list_equal(info->get_track_labels_list(), labels) ) {
                 delete info;
                 if(remove(target.c_str()) != 0 )
                     return EXIT_FAILURE;

tests/write_mpc/main.cc

         info->set_title(TESTNAME);
         info->set_album_artist("äöé");
         info->set_is_compilation(true);
+        info->set_comments("Cömmmééèntß");
+        info->set_year(1978);
         info->write();
     }
     delete info;
         if( info->read() ) {
             if(info->get_title() == TESTNAME &&
                info->get_album_artist() == "äöé" &&
+               info->get_comments() == "Cömmmééèntß" &&
+               info->get_year() == 1978 &&
                info->get_is_compilation()) {
                 delete info;
                 if(remove(target.c_str()) != 0 )

tests/write_ogg/main.cc

         info->set_album_artist("äöé");
         info->set_is_compilation(true);
         info->set_track_labels_list(labels);
+        info->set_comments("Cömmmééèntß");
+        info->set_year(1978);
         info->write();
     }
     delete info;
         if( info->read() ) {
             if(info->get_title() == TESTNAME &&
                info->get_album_artist() == "äöé" &&
+               info->get_year() == 1978 &&
+               info->get_comments() == "Cömmmééèntß" &&
                info->get_is_compilation() == true &&
                check_list_equal(info->get_track_labels_list(), labels) ) {
                 delete info;

tests/write_speex/main.cc

         info->set_title(TESTNAME);
         info->set_album_artist("äéö");
         info->set_is_compilation(true);
+        info->set_comments("Cömmmééèntß");
+        info->set_year(1978);
         info->write();
     }
     delete info;
         if( info->read() ) {
             if(info->get_title() == TESTNAME &&
                info->get_is_compilation() == true &&
-               info->get_album_artist() == "äéö") {
+               info->get_year() == 1978 &&
+               info->get_album_artist() == "äéö" &&
+               info->get_comments() == "Cömmmééèntß") {
                 delete info;
                 if(remove(target.c_str()) != 0 )
                     return EXIT_FAILURE;

tests/write_tta/main.cc

 
 
 int main( void ) {
-    Info * TagInfo;
+    Info * info;
     std::string val = TESTDIR "samples/sample.tta";
     //std::cout << std::endl << "val: " << val << std::endl;
 
     std::ofstream  dst(target.c_str());
     dst << src.rdbuf();
     
-    TagInfo = Info::create_tag_info(target);
-    if( TagInfo ) {
-        TagInfo->set_title(TESTNAME);
-        TagInfo->set_album_artist("äöé");
-        TagInfo->set_is_compilation(true);
-        TagInfo->write();
+    info = Info::create_tag_info(target);
+    if( info ) {
+        info->set_title(TESTNAME);
+        info->set_album_artist("äöé");
+        info->set_is_compilation(true);
+        info->set_comments("Cömmmééèntß");
+        info->set_year(1978);
+        info->write();
     }
-    delete TagInfo;
-    TagInfo = NULL;
+    delete info;
+    info = NULL;
     
-    TagInfo = Info::create_tag_info(target);
-    if( TagInfo ) {
-        if( TagInfo->read() ) {
-            if(TagInfo->get_title() == TESTNAME &&
-               TagInfo->get_album_artist() == "äöé" &&
-               TagInfo->get_is_compilation() == true) {
-                delete TagInfo;
+    info = Info::create_tag_info(target);
+    if( info ) {
+        if( info->read() ) {
+            if(info->get_title() == TESTNAME &&
+               info->get_album_artist() == "äöé" &&
+               info->get_year() == 1978 &&
+               info->get_comments() == "Cömmmééèntß" &&
+               info->get_is_compilation() == true) {
+                delete info;
                 if(remove(target.c_str()) != 0 )
                     return EXIT_FAILURE;
                 return EXIT_SUCCESS;
             }
         }
-        delete TagInfo;
+        delete info;
         if(remove(target.c_str()) != 0 )
             return EXIT_FAILURE;
         return EXIT_FAILURE;
     }
     else {
-        delete TagInfo;
+        delete info;
         if(remove(target.c_str()) != 0 )
             return EXIT_FAILURE;
         return EXIT_FAILURE;

tests/write_wav/main.cc

         info->set_title(TESTNAME);
         info->set_album_artist("äöé");
         info->set_is_compilation(true);
+        info->set_comments("Cömmmééèntß");
+        info->set_year(1978);
         info->write();
     }
     delete info;
         {
             if(info->get_title() == TESTNAME &&
                info->get_album_artist() == "äöé" &&
+               info->get_year() == 1978 &&
+               info->get_comments() == "Cömmmééèntß" &&
                info->get_is_compilation() == true) {
                 delete info;
                 if(remove(target.c_str()) != 0 )

tests/write_wma/main.cc

         info->set_title(TESTNAME);
         info->set_album_artist("äöé");
         info->set_is_compilation(true);
+        info->set_comments("Cömmmééèntß");
+        info->set_year(1978);
         info->write();
     }
     delete info;
         if( info->read() ) {
             if(info->get_title() == TESTNAME &&
                info->get_album_artist() == "äöé" &&
+               info->get_year() == 1978 &&
+               info->get_comments() == "Cömmmééèntß" &&
                info->get_is_compilation()) {
                 delete info;
                 if(remove(target.c_str()) != 0 )