Commits

shuerhaaken  committed a09de8f

add some lyrics tests

  • Participants
  • Parent commits 6a175d4

Comments (0)

Files changed (15)

+commit 6a175d4f823ce070df59376649c817839deb2070
+Author: Jörn Magens <shuerhaaken@googlemail.com>
+Date:   Thu Apr 4 20:50:16 2013 +0200
+
+    add fallback to mp4
+
 commit 63a40b166a1a0805305f00601693d4fbc9cbcb77
 Author: Jörn Magens <shuerhaaken@googlemail.com>
 Date:   Thu Apr 4 18:20:38 2013 +0200

File libtaginfo/aiffinfo.cc

 
 
 bool AiffInfo::can_handle_lyrics(void) const {
-    return false;
+    return true;
 }
 
 
 String AiffInfo::get_lyrics(void) const {
+    if(taglib_tagId3v2)
+        return get_id3v2_lyrics(taglib_tagId3v2);
+    
     return "";
 }
 
 
 bool AiffInfo::set_lyrics(const String &lyrics) {
+    if(taglib_tagId3v2) {
+        set_id3v2_lyrics(taglib_tagId3v2, lyrics);
+        return true;
+    }
     return false;
 }
 

File libtaginfo/apeinfo.cc

 #define APE_TAG_DISKNO              "DISCNUMBER"
 #define APE_TAG_COMPILATION         "COMPILATION"
 #define APE_TAG_ALBUMARTIST         "ALBUM ARTIST" 
-#define APE_TAG_TRACK               "Track"
+#define APE_TAG_TRACK               "TRACK"
 #define APE_TAG_COMPOSER            "COMPOSER" 
-#define APE_TAG_COMMENT             "Comment" 
-#define APE_TAG_FILE                "File" 
-#define APE_TAG_FILE_URL            "File URL" 
-#define APE_TAG_YEAR                "Year" 
-#define APE_TAG_MEDIA               "Media" 
-#define APE_TAG_INDEX               "Index" 
-#define APE_TAG_COVER_ART_FRONT     "Cover Art (front)" 
-#define APE_TAG_COVER_ART_OTHER     "Cover Art (other)" 
-#define APE_TAG_NOTES               "Notes" 
-#define APE_TAG_LYRICS              "Lyrics" 
+#define APE_TAG_COMMENT             "COMMENT" 
+#define APE_TAG_FILE                "FILE" 
+#define APE_TAG_FILE_URL            "FILE URL" 
+#define APE_TAG_YEAR                "YEAR" 
+#define APE_TAG_MEDIA               "MEDIA" 
+#define APE_TAG_INDEX               "INDEX" 
+#define APE_TAG_COVER_ART_FRONT     "COVER ART (FRONT)" 
+#define APE_TAG_COVER_ART_OTHER     "COVER ART (OTHER)" 
+#define APE_TAG_NOTES               "NOTES" 
+#define APE_TAG_LYRICS              "LYRICS" 
 #define APE_TAG_RATING              "RATING"
 #define APE_TAG_PLAYCNT             "PLAY_COUNTER"
 

File libtaginfo/mp4info.cc

 
 
 String Mp4Info::get_lyrics(void) const {
-    return get_mp4_lyrics(((TagLib::MP4::File *) taglib_fileref->file())->tag());
+    return get_mp4_lyrics(mp4_tag);
 }
 
 
 bool Mp4Info::set_lyrics(const String &lyrics) {
-    return set_mp4_lyrics(((TagLib::MP4::File *) taglib_fileref->file())->tag(), lyrics);
+    return set_mp4_lyrics(mp4_tag, lyrics);
 }
 
 

File libtaginfo/mpcinfo.cc

 #include "taginfo.h"
 #include "taginfo_internal.h"
 
+#define TAG_DISKNO              "DISCNUMBER"
+#define TAG_COMPILATION         "COMPILATION"
+#define TAG_ALBUMARTIST         "ALBUM ARTIST"
+#define TAG_TRACK               "TRACK"
+#define TAG_COMPOSER            "COMPOSER"
+#define TAG_COMMENT             "COMMENT" 
+#define TAG_FILE                "FILE" 
+#define TAG_FILE_URL            "FILE URL" 
+#define TAG_YEAR                "YEAR" 
+#define TAG_MEDIA               "MEDIA" 
+#define TAG_INDEX               "INDEX" 
+#define TAG_COVER_ART_FRONT     "COVER ART (FRONT)" 
+#define TAG_COVER_ART_OTHER     "COVER ART (OTHER)" 
 #define COVER_ART_FRONT         "COVER ART (FRONT)"
 #define COVER_ART_OTHER         "COVER ART (OTHER)"
+#define TAG_NOTES               "NOTES" 
+#define TAG_LYRICS              "LYRICS" 
+#define TAG_RATING              "RATING"
+#define TAG_PLAYCNT             "PLAY_COUNTER"
+
 
 
 using namespace TagInfo;
 
 
 String MpcInfo::get_lyrics(void) const {
-    if(taglib_apetag && taglib_apetag->itemListMap().contains("Lyrics")) {
-        return taglib_apetag->itemListMap()["Lyrics"].toStringList().front();
+    if(taglib_apetag && taglib_apetag->itemListMap().contains(TAG_LYRICS)) {
+        return taglib_apetag->itemListMap()[TAG_LYRICS].toStringList().front();
     }
     return "";
 }
 
 bool MpcInfo::set_lyrics(const String &lyrics) {
     if(taglib_apetag) {
-        taglib_apetag->addValue("Lyrics", lyrics);
+        taglib_apetag->addValue(TAG_LYRICS, lyrics);
         return true;
     }
     return false;
         if(taglib_apetag && !taglib_apetag->isEmpty()) {
             if(!taglib_tag)
                 read_virtual_tags((TagLib::Tag *)taglib_apetag);
-            if(taglib_apetag->itemListMap().contains("COMPOSER")) {
-                composer = taglib_apetag->itemListMap()["COMPOSER"].toStringList().front();
+            if(taglib_apetag->itemListMap().contains(TAG_COMPOSER)) {
+                composer = taglib_apetag->itemListMap()[TAG_COMPOSER].toStringList().front();
             }
-            if(taglib_apetag->itemListMap().contains("DISCNUMBER")) {
+            if(taglib_apetag->itemListMap().contains(TAG_DISKNO)) {
                 disk_number = 
-                    atol(taglib_apetag->itemListMap()["DISCNUMBER"].toStringList().front().toCString(false));
+                    atol(taglib_apetag->itemListMap()[TAG_DISKNO].toStringList().front().toCString(false));
                 if(disk_number <= 0)
                     disk_number = 1;
             }
-            if(taglib_apetag->itemListMap().contains("COMPILATION")) {
+            if(taglib_apetag->itemListMap().contains(TAG_COMPILATION)) {
                 is_compilation = 
-                    taglib_apetag->itemListMap()["COMPILATION"].toStringList().front() == String("1");
+                    taglib_apetag->itemListMap()[TAG_COMPILATION].toStringList().front() == String("1");
             }
-            if(taglib_apetag->itemListMap().contains("ALBUM ARTIST")) {
-                album_artist = taglib_apetag->itemListMap()["ALBUM ARTIST"].toStringList().front();
+            if(taglib_apetag->itemListMap().contains(TAG_ALBUMARTIST)) {
+                album_artist = taglib_apetag->itemListMap()[TAG_ALBUMARTIST].toStringList().front();
             }
             else if(taglib_apetag->itemListMap().contains("ALBUMARTIST")) {
                 album_artist = taglib_apetag->itemListMap()["ALBUMARTIST"].toStringList().front();
             }
             // Rating
-            if(taglib_apetag->itemListMap().contains("RATING")) {
-                long rat = atol(taglib_apetag->itemListMap()["RATING"].toStringList().front().toCString(true));
+            if(taglib_apetag->itemListMap().contains(TAG_RATING)) {
+                long rat = atol(taglib_apetag->itemListMap()[TAG_RATING].toStringList().front().toCString(true));
                 if(rat) {
                     if(rat > 5) {
                         rating = popularity_to_rating(rat);
                     }
                 }
             }
-            if(taglib_apetag->itemListMap().contains("PLAY_COUNTER")) {
-                playcount = atol(taglib_apetag->itemListMap()["PLAY_COUNTER"].toStringList().front().toCString(true));
+            if(taglib_apetag->itemListMap().contains(TAG_PLAYCNT)) {
+                playcount = atol(taglib_apetag->itemListMap()[TAG_PLAYCNT].toStringList().front().toCString(true));
                 if(playcount < 0)
                     playcount = 0;
             }
     if(taglib_apetag) {
         if(changedflag) {
             if(changedflag & CHANGED_COMPOSER_TAG)
-                taglib_apetag->addValue("COMPOSER", composer);
+                taglib_apetag->addValue(TAG_COMPOSER, composer);
             if(changedflag & CHANGED_DATA_DISK_NUM)
-                taglib_apetag->addValue("DISCNUMBER", format("%u", disk_number));
+                taglib_apetag->addValue(TAG_DISKNO, format("%u", disk_number));
             
             if(changedflag & CHANGED_IS_COMPILATION_TAG) {
                 if(is_compilation) {
-                    taglib_apetag->addValue("COMPILATION", "1");
+                    taglib_apetag->addValue(TAG_COMPILATION, "1");
                 }
                 else {
-                    taglib_apetag->addValue("COMPILATION", "0");
+                    taglib_apetag->addValue(TAG_COMPILATION, "0");
                 }
             }
             if(changedflag & CHANGED_DATA_ALBUMARTIST)
-                taglib_apetag->addValue("ALBUM ARTIST", album_artist);
+                taglib_apetag->addValue(TAG_ALBUMARTIST, album_artist);
             
             if(changedflag & CHANGED_DATA_RATING) {
-                taglib_apetag->addValue("RATING", format("%u", rating_to_popularity(rating))); // TODO
+                taglib_apetag->addValue(TAG_RATING, format("%u", rating_to_popularity(rating)));
             }
             if(changedflag & CHANGED_DATA_PLAYCOUNT) {
-                taglib_apetag->addValue("PLAY_COUNTER", format("%u", playcount));
+                taglib_apetag->addValue(TAG_PLAYCNT, format("%u", playcount));
             }
             // Labels
             if(changedflag & CHANGED_TRACK_LABELS)

File tests/Makefile.am

 
 check_PROGRAMS = \
     basic/test \
+    lyrics_ape/test \
+    lyrics_aif/test \
+    lyrics_asf/test \
+    lyrics_flac/test \
+    lyrics_m4a/test \
+    lyrics_mp3/test \
+    lyrics_mpc/test \
+    lyrics_ogg/test \
+    lyrics_speex/test \
     read_aif/test \
     read_ape/test \
     read_flac/test \
 basic_test_SOURCES              = basic/main.cc
 basic_test_LDADD                = $(taginfo_ldadd)
 
+lyrics_aif_test_SOURCES         = lyrics_aif/main.cc
+lyrics_aif_test_LDADD           = $(taginfo_ldadd)
+
+lyrics_ape_test_SOURCES         = lyrics_ape/main.cc
+lyrics_ape_test_LDADD           = $(taginfo_ldadd)
+
+lyrics_asf_test_SOURCES         = lyrics_asf/main.cc
+lyrics_asf_test_LDADD           = $(taginfo_ldadd)
+
+lyrics_flac_test_SOURCES        = lyrics_flac/main.cc
+lyrics_flac_test_LDADD          = $(taginfo_ldadd)
+
+lyrics_m4a_test_SOURCES         = lyrics_m4a/main.cc
+lyrics_m4a_test_LDADD           = $(taginfo_ldadd)
+
+lyrics_mp3_test_SOURCES         = lyrics_mp3/main.cc
+lyrics_mp3_test_LDADD           = $(taginfo_ldadd)
+
+lyrics_mpc_test_SOURCES         = lyrics_mpc/main.cc
+lyrics_mpc_test_LDADD           = $(taginfo_ldadd)
+
+lyrics_ogg_test_SOURCES         = lyrics_ogg/main.cc
+lyrics_ogg_test_LDADD           = $(taginfo_ldadd)
+
+lyrics_speex_test_SOURCES       = lyrics_speex/main.cc
+lyrics_speex_test_LDADD         = $(taginfo_ldadd)
+
 read_aif_test_SOURCES           = read_aif/main.cc
 read_aif_test_LDADD             = $(taginfo_ldadd)
 

File tests/lyrics_aif/main.cc

+#include "taginfo.h"
+#include <stdio.h>
+#include <iostream>
+#include <fstream>
+#include <sys/mman.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+using namespace TagInfo;
+//using namespace std;
+
+
+int main( void ) {
+    Info * info;
+    std::string val   = TESTDIR "samples/sample.aif";
+    
+    //std::cout << std::endl << "val: " << val << std::endl;
+    std::string target = "/tmp/out_01.aif";
+    
+    std::ifstream  src(val.c_str());
+    std::ofstream  dst(target.c_str());
+    dst << src.rdbuf();
+    
+    char* data;
+    int data_length;
+    
+    struct stat filestatus;
+    
+    
+    std::string lyrics = "these are lyrics öäüß\n ldskjfslkd\n öäüß";
+    
+    info = Info::create_tag_info(target);
+    if(info) {
+        if(!info->set_lyrics(lyrics.c_str())) {
+            delete info;
+            return EXIT_FAILURE;
+        }
+        info->write();
+    }
+    delete info;
+    info = NULL;
+    
+    info = Info::create_tag_info(target);
+    char* read;
+    if(info) {
+        if(info->read()) {
+            const char* res = info->get_lyrics().toCString(false);
+            //std::cout << "##6" << res << std::endl;
+            if(strcmp(lyrics.c_str(), res) != 0) {
+                delete info;
+                if(remove(target.c_str()) != 0 ) {
+                    return EXIT_FAILURE;
+                }
+            }
+            if(remove(target.c_str()) != 0 )
+                return EXIT_FAILURE;
+            return EXIT_SUCCESS;
+        }
+        delete info;
+        if(remove(target.c_str()) != 0 )
+            return EXIT_FAILURE;
+        return EXIT_FAILURE;
+    }
+    else {
+        delete info;
+        if(remove(target.c_str()) != 0 )
+            return EXIT_FAILURE;
+        return EXIT_FAILURE;
+    }
+    return EXIT_FAILURE;
+}
+

File tests/lyrics_ape/main.cc

+#include "taginfo.h"
+#include <stdio.h>
+#include <iostream>
+#include <fstream>
+#include <sys/mman.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+using namespace TagInfo;
+//using namespace std;
+
+
+int main( void ) {
+    Info * info;
+    std::string val   = TESTDIR "samples/sample.ape";
+    
+    //std::cout << std::endl << "val: " << val << std::endl;
+    std::string target = "/tmp/out_01.ape";
+    
+    std::ifstream  src(val.c_str());
+    std::ofstream  dst(target.c_str());
+    dst << src.rdbuf();
+    
+    char* data;
+    int data_length;
+    
+    struct stat filestatus;
+    
+    
+    std::string lyrics = "these are lyrics öäüß\n ldskjfslkd\n öäüß";
+    
+    info = Info::create_tag_info(target);
+    if(info) {
+        if(!info->set_lyrics(lyrics.c_str())) {
+            delete info;
+            return EXIT_FAILURE;
+        }
+        info->write();
+    }
+    delete info;
+    info = NULL;
+    
+    info = Info::create_tag_info(target);
+    char* read;
+    if(info) {
+        if(info->read()) {
+            const char* res = info->get_lyrics().toCString(false);
+            //std::cout << "##6" << res << std::endl;
+            if(strcmp(lyrics.c_str(), res) != 0) {
+                delete info;
+                if(remove(target.c_str()) != 0 ) {
+                    return EXIT_FAILURE;
+                }
+            }
+            if(remove(target.c_str()) != 0 )
+                return EXIT_FAILURE;
+            return EXIT_SUCCESS;
+        }
+        delete info;
+        if(remove(target.c_str()) != 0 )
+            return EXIT_FAILURE;
+        return EXIT_FAILURE;
+    }
+    else {
+        delete info;
+        if(remove(target.c_str()) != 0 )
+            return EXIT_FAILURE;
+        return EXIT_FAILURE;
+    }
+    return EXIT_FAILURE;
+}
+

File tests/lyrics_asf/main.cc

+#include "taginfo.h"
+#include <stdio.h>
+#include <iostream>
+#include <fstream>
+#include <sys/mman.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+using namespace TagInfo;
+//using namespace std;
+
+
+int main( void ) {
+    Info * info;
+    std::string val   = TESTDIR "samples/sample.wma";
+    
+    //std::cout << std::endl << "val: " << val << std::endl;
+    std::string target = "/tmp/out_01.wma";
+    
+    std::ifstream  src(val.c_str());
+    std::ofstream  dst(target.c_str());
+    dst << src.rdbuf();
+    
+    char* data;
+    int data_length;
+    
+    struct stat filestatus;
+    
+    
+    std::string lyrics = "these are lyrics öäüß\n ldskjfslkd\n öäüß";
+    
+    info = Info::create_tag_info(target);
+    if(info) {
+        if(!info->set_lyrics(lyrics.c_str())) {
+            delete info;
+            return EXIT_FAILURE;
+        }
+        info->write();
+    }
+    delete info;
+    info = NULL;
+    
+    info = Info::create_tag_info(target);
+    char* read;
+    if(info) {
+        if(info->read()) {
+            const char* res = info->get_lyrics().toCString(false);
+            if(strcmp(lyrics.c_str(), res) != 0) {
+                delete info;
+                if(remove(target.c_str()) != 0 ) {
+                    return EXIT_FAILURE;
+                }
+            }
+            if(remove(target.c_str()) != 0 )
+                return EXIT_FAILURE;
+            return EXIT_SUCCESS;
+        }
+        delete info;
+        if(remove(target.c_str()) != 0 )
+            return EXIT_FAILURE;
+        return EXIT_FAILURE;
+    }
+    else {
+        delete info;
+        if(remove(target.c_str()) != 0 )
+            return EXIT_FAILURE;
+        return EXIT_FAILURE;
+    }
+    return EXIT_FAILURE;
+}
+

File tests/lyrics_flac/main.cc

+#include "taginfo.h"
+#include <stdio.h>
+#include <iostream>
+#include <fstream>
+#include <sys/mman.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+using namespace TagInfo;
+//using namespace std;
+
+
+int main( void ) {
+    Info * info;
+    std::string val   = TESTDIR "samples/sample.flac";
+    
+    //std::cout << std::endl << "val: " << val << std::endl;
+    std::string target = "/tmp/out_01.flac";
+    
+    std::ifstream  src(val.c_str());
+    std::ofstream  dst(target.c_str());
+    dst << src.rdbuf();
+    
+    char* data;
+    int data_length;
+    
+    struct stat filestatus;
+    
+    
+    std::string lyrics = "these are lyrics öäüß\n ldskjfslkd\n öäüß";
+    
+    info = Info::create_tag_info(target);
+    if(info) {
+        if(!info->set_lyrics(lyrics.c_str())) {
+            delete info;
+            return EXIT_FAILURE;
+        }
+        info->write();
+    }
+    delete info;
+    info = NULL;
+    
+    info = Info::create_tag_info(target);
+    char* read;
+    if(info) {
+        if(info->read()) {
+            const char* res = info->get_lyrics().toCString(false);
+            if(strcmp(lyrics.c_str(), res) != 0) {
+                delete info;
+                if(remove(target.c_str()) != 0 ) {
+                    return EXIT_FAILURE;
+                }
+            }
+            if(remove(target.c_str()) != 0 )
+                return EXIT_FAILURE;
+            return EXIT_SUCCESS;
+        }
+        delete info;
+        if(remove(target.c_str()) != 0 )
+            return EXIT_FAILURE;
+        return EXIT_FAILURE;
+    }
+    else {
+        delete info;
+        if(remove(target.c_str()) != 0 )
+            return EXIT_FAILURE;
+        return EXIT_FAILURE;
+    }
+    return EXIT_FAILURE;
+}
+

File tests/lyrics_m4a/main.cc

+#include "taginfo.h"
+#include <stdio.h>
+#include <iostream>
+#include <fstream>
+#include <sys/mman.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+using namespace TagInfo;
+//using namespace std;
+
+
+int main( void ) {
+    Info * info;
+    std::string val   = TESTDIR "samples/sample.m4a";
+    
+    //std::cout << std::endl << "val: " << val << std::endl;
+    std::string target = "/tmp/out_01.m4a";
+    
+    std::ifstream  src(val.c_str());
+    std::ofstream  dst(target.c_str());
+    dst << src.rdbuf();
+    
+    char* data;
+    int data_length;
+    
+    struct stat filestatus;
+    
+    
+    std::string lyrics = "these are lyrics öäüß\n ldskjfslkd\n öäüß";
+    
+    info = Info::create_tag_info(target);
+    if(info) {
+        if(!info->set_lyrics(lyrics.c_str())) {
+            delete info;
+            return EXIT_FAILURE;
+        }
+        info->write();
+    }
+    delete info;
+    info = NULL;
+    
+    info = Info::create_tag_info(target);
+    char* read;
+    if(info) {
+        if(info->read()) {
+            const char* res = info->get_lyrics().toCString(false);
+            //std::cout << "##6" << res << std::endl;
+            if(strcmp(lyrics.c_str(), res) != 0) {
+                delete info;
+                if(remove(target.c_str()) != 0 ) {
+                    return EXIT_FAILURE;
+                }
+            }
+            if(remove(target.c_str()) != 0 )
+                return EXIT_FAILURE;
+            return EXIT_SUCCESS;
+        }
+        delete info;
+        if(remove(target.c_str()) != 0 )
+            return EXIT_FAILURE;
+        return EXIT_FAILURE;
+    }
+    else {
+        delete info;
+        if(remove(target.c_str()) != 0 )
+            return EXIT_FAILURE;
+        return EXIT_FAILURE;
+    }
+    return EXIT_FAILURE;
+}
+

File tests/lyrics_mp3/main.cc

+#include "taginfo.h"
+#include <stdio.h>
+#include <iostream>
+#include <fstream>
+#include <sys/mman.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+using namespace TagInfo;
+//using namespace std;
+
+
+int main( void ) {
+    Info * info;
+    std::string val   = TESTDIR "samples/sample_v2_only.mp3";
+    
+    //std::cout << std::endl << "val: " << val << std::endl;
+    std::string target = "/tmp/out_01.mp3";
+    
+    std::ifstream  src(val.c_str());
+    std::ofstream  dst(target.c_str());
+    dst << src.rdbuf();
+    
+    char* data;
+    int data_length;
+    
+    struct stat filestatus;
+    
+    
+    std::string lyrics = "these are lyrics öäüß\n ldskjfslkd\n öäüß";
+    
+    info = Info::create_tag_info(target);
+    if(info) {
+        if(!info->set_lyrics(lyrics.c_str())) {
+            delete info;
+            return EXIT_FAILURE;
+        }
+        info->write();
+    }
+    delete info;
+    info = NULL;
+    
+    info = Info::create_tag_info(target);
+    char* read;
+    if(info) {
+        if(info->read()) {
+            const char* res = info->get_lyrics().toCString(false);
+            if(strcmp(lyrics.c_str(), res) != 0) {
+                delete info;
+                if(remove(target.c_str()) != 0 ) {
+                    return EXIT_FAILURE;
+                }
+            }
+            if(remove(target.c_str()) != 0 )
+                return EXIT_FAILURE;
+            return EXIT_SUCCESS;
+        }
+        delete info;
+        if(remove(target.c_str()) != 0 )
+            return EXIT_FAILURE;
+        return EXIT_FAILURE;
+    }
+    else {
+        delete info;
+        if(remove(target.c_str()) != 0 )
+            return EXIT_FAILURE;
+        return EXIT_FAILURE;
+    }
+    return EXIT_FAILURE;
+}
+

File tests/lyrics_mpc/main.cc

+#include "taginfo.h"
+#include <stdio.h>
+#include <iostream>
+#include <fstream>
+#include <sys/mman.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+using namespace TagInfo;
+//using namespace std;
+
+
+int main( void ) {
+    Info * info;
+    std::string val   = TESTDIR "samples/sample.mpc";
+    
+    //std::cout << std::endl << "val: " << val << std::endl;
+    std::string target = "/tmp/out_01.mpc";
+    
+    std::ifstream  src(val.c_str());
+    std::ofstream  dst(target.c_str());
+    dst << src.rdbuf();
+    
+    char* data;
+    int data_length;
+    
+    struct stat filestatus;
+    
+    
+    std::string lyrics = "these are lyrics öäüß\n ldskjfslkd\n öäüß";
+    
+    info = Info::create_tag_info(target);
+    if(info) {
+        if(!info->set_lyrics(lyrics.c_str())) {
+            delete info;
+            return EXIT_FAILURE;
+        }
+        info->write();
+    }
+    delete info;
+    info = NULL;
+    
+    info = Info::create_tag_info(target);
+    char* read;
+    if(info) {
+        if(info->read()) {
+            const char* res = info->get_lyrics().toCString(false);
+            //std::cout << "##6" << res << std::endl;
+            if(strcmp(lyrics.c_str(), res) != 0) {
+                delete info;
+                if(remove(target.c_str()) != 0 ) {
+                    return EXIT_FAILURE;
+                }
+            }
+            if(remove(target.c_str()) != 0 )
+                return EXIT_FAILURE;
+            return EXIT_SUCCESS;
+        }
+        delete info;
+        if(remove(target.c_str()) != 0 )
+            return EXIT_FAILURE;
+        return EXIT_FAILURE;
+    }
+    else {
+        delete info;
+        if(remove(target.c_str()) != 0 )
+            return EXIT_FAILURE;
+        return EXIT_FAILURE;
+    }
+    return EXIT_FAILURE;
+}
+

File tests/lyrics_ogg/main.cc

+#include "taginfo.h"
+#include <stdio.h>
+#include <iostream>
+#include <fstream>
+#include <sys/mman.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+using namespace TagInfo;
+//using namespace std;
+
+
+int main( void ) {
+    Info * info;
+    std::string val   = TESTDIR "samples/sample.ogg";
+    
+    //std::cout << std::endl << "val: " << val << std::endl;
+    std::string target = "/tmp/out_01.ogg";
+    
+    std::ifstream  src(val.c_str());
+    std::ofstream  dst(target.c_str());
+    dst << src.rdbuf();
+    
+    char* data;
+    int data_length;
+    
+    struct stat filestatus;
+    
+    
+    std::string lyrics = "these are lyrics öäüß\n ldskjfslkd\n öäüß";
+    
+    info = Info::create_tag_info(target);
+    if(info) {
+        if(!info->set_lyrics(lyrics.c_str())) {
+            delete info;
+            return EXIT_FAILURE;
+        }
+        info->write();
+    }
+    delete info;
+    info = NULL;
+    
+    info = Info::create_tag_info(target);
+    char* read;
+    if(info) {
+        if(info->read()) {
+            const char* res = info->get_lyrics().toCString(false);
+            if(strcmp(lyrics.c_str(), res) != 0) {
+                delete info;
+                if(remove(target.c_str()) != 0 ) {
+                    return EXIT_FAILURE;
+                }
+            }
+            if(remove(target.c_str()) != 0 )
+                return EXIT_FAILURE;
+            return EXIT_SUCCESS;
+        }
+        delete info;
+        if(remove(target.c_str()) != 0 )
+            return EXIT_FAILURE;
+        return EXIT_FAILURE;
+    }
+    else {
+        delete info;
+        if(remove(target.c_str()) != 0 )
+            return EXIT_FAILURE;
+        return EXIT_FAILURE;
+    }
+    return EXIT_FAILURE;
+}
+

File tests/lyrics_speex/main.cc

+#include "taginfo.h"
+#include <stdio.h>
+#include <iostream>
+#include <fstream>
+#include <sys/mman.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+using namespace TagInfo;
+//using namespace std;
+
+
+int main( void ) {
+    Info * info;
+    std::string val   = TESTDIR "samples/sample_empty.spx";
+    
+    //std::cout << std::endl << "val: " << val << std::endl;
+    std::string target = "/tmp/out_01.spx";
+    
+    std::ifstream  src(val.c_str());
+    std::ofstream  dst(target.c_str());
+    dst << src.rdbuf();
+    
+    char* data;
+    int data_length;
+    
+    struct stat filestatus;
+    
+    
+    std::string lyrics = "these are lyrics öäüß\n ldskjfslkd\n öäüß";
+    
+    info = Info::create_tag_info(target);
+    if(info) {
+        if(!info->set_lyrics(lyrics.c_str())) {
+            delete info;
+            return EXIT_FAILURE;
+        }
+        info->write();
+    }
+    delete info;
+    info = NULL;
+    
+    info = Info::create_tag_info(target);
+    char* read;
+    if(info) {
+        if(info->read()) {
+            const char* res = info->get_lyrics().toCString(false);
+            if(strcmp(lyrics.c_str(), res) != 0) {
+                delete info;
+                if(remove(target.c_str()) != 0 ) {
+                    return EXIT_FAILURE;
+                }
+            }
+            if(remove(target.c_str()) != 0 )
+                return EXIT_FAILURE;
+            return EXIT_SUCCESS;
+        }
+        delete info;
+        if(remove(target.c_str()) != 0 )
+            return EXIT_FAILURE;
+        return EXIT_FAILURE;
+    }
+    else {
+        delete info;
+        if(remove(target.c_str()) != 0 )
+            return EXIT_FAILURE;
+        return EXIT_FAILURE;
+    }
+    return EXIT_FAILURE;
+}
+