Hello community, here is the log from the commit of package taglib for openSUSE:Factory checked in at Sun Feb 27 13:36:25 CET 2011. -------- --- KDE/taglib/taglib.changes 2010-04-11 19:08:33.000000000 +0200 +++ taglib/taglib.changes 2011-02-26 20:24:57.000000000 +0100 @@ -1,0 +2,10 @@ +Sat Feb 26 14:24:48 UTC 2011 - toddrme2178@gmail.com + +- update to version 1.6.3 + * Fixed definitions of the TAGLIB_WITH_MP4 and TAGLIB_WITH_ASF macros. + * Fixed upgrading of ID3v2.3 genre frame with ID3v1 code 0 (Blues). + * New method `int String::toInt(bool *ok)` which can return whether the conversion to a number was successful. + * Fixed parsing of incorrectly written lengths in ID3v2 (affects mainly compressed frames). + + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- taglib-1.6.2.tar.bz2 New: ---- taglib-1.6.3.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ taglib.spec ++++++ --- /var/tmp/diff_new_pack.rwYNwa/_old 2011-02-27 13:31:47.000000000 +0100 +++ /var/tmp/diff_new_pack.rwYNwa/_new 2011-02-27 13:31:47.000000000 +0100 @@ -1,7 +1,7 @@ # -# spec file for package taglib (Version 1.6.2) +# spec file for package taglib # -# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -32,7 +32,7 @@ Obsoletes: taglib-64bit %endif # -Version: 1.6.2 +Version: 1.6.3 Release: 1 Source0: %name-%version.tar.bz2 Source1: %name.desktop ++++++ taglib-1.6.2.tar.bz2 -> taglib-1.6.3.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/taglib-1.6.2/CMakeLists.txt new/taglib-1.6.3/CMakeLists.txt --- old/taglib-1.6.2/CMakeLists.txt 2009-10-31 10:23:58.000000000 +0100 +++ new/taglib-1.6.3/CMakeLists.txt 2010-04-12 19:43:03.000000000 +0200 @@ -40,7 +40,7 @@ SET(TAGLIB_LIB_MAJOR_VERSION "1") SET(TAGLIB_LIB_MINOR_VERSION "6") -SET(TAGLIB_LIB_PATCH_VERSION "1") +SET(TAGLIB_LIB_PATCH_VERSION "3") SET(TAGLIB_LIB_VERSION_STRING "${TAGLIB_LIB_MAJOR_VERSION}.${TAGLIB_LIB_MINOR_VERSION}.${TAGLIB_LIB_PATCH_VERSION}") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/taglib-1.6.2/Makefile.am new/taglib-1.6.3/Makefile.am --- old/taglib-1.6.2/Makefile.am 2010-04-04 17:01:21.000000000 +0200 +++ new/taglib-1.6.3/Makefile.am 2010-04-12 19:43:03.000000000 +0200 @@ -38,7 +38,7 @@ fi; \ cp $(top_srcdir)/admin/Doxyfile.global taglib.doxyfile; \ echo "PROJECT_NAME = TagLib" >> taglib.doxyfile; \ - echo "PROJECT_NUMBER = \"Version 1.6.2\"" >> taglib.doxyfile; \ + echo "PROJECT_NUMBER = \"Version 1.6.3\"" >> taglib.doxyfile; \ echo "INPUT = $(srcdir)" >> taglib.doxyfile; \ echo "OUTPUT_DIRECTORY = doc/api" >> taglib.doxyfile; \ echo "HTML_OUTPUT = html" >> taglib.doxyfile; \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/taglib-1.6.2/Makefile.in new/taglib-1.6.3/Makefile.in --- old/taglib-1.6.2/Makefile.in 2010-04-09 11:36:02.000000000 +0200 +++ new/taglib-1.6.3/Makefile.in 2010-04-17 13:29:02.000000000 +0200 @@ -789,7 +789,7 @@ fi; \ cp $(top_srcdir)/admin/Doxyfile.global taglib.doxyfile; \ echo "PROJECT_NAME = TagLib" >> taglib.doxyfile; \ - echo "PROJECT_NUMBER = \"Version 1.6.2\"" >> taglib.doxyfile; \ + echo "PROJECT_NUMBER = \"Version 1.6.3\"" >> taglib.doxyfile; \ echo "INPUT = $(srcdir)" >> taglib.doxyfile; \ echo "OUTPUT_DIRECTORY = doc/api" >> taglib.doxyfile; \ echo "HTML_OUTPUT = html" >> taglib.doxyfile; \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/taglib-1.6.2/NEWS new/taglib-1.6.3/NEWS --- old/taglib-1.6.2/NEWS 2010-04-09 11:37:51.000000000 +0200 +++ new/taglib-1.6.3/NEWS 2010-04-17 13:31:35.000000000 +0200 @@ -1,3 +1,13 @@ +TagLib 1.6.3 (Apr 17, 2010) +=========================== + + * Fixed definitions of the TAGLIB_WITH_MP4 and TAGLIB_WITH_ASF macros. + * Fixed upgrading of ID3v2.3 genre frame with ID3v1 code 0 (Blues). + * New method `int String::toInt(bool *ok)` which can return whether the + conversion to a number was successfull. + * Fixed parsing of incorrectly written lengths in ID3v2 (affects mainly + compressed frames). (BUG:231075) + TagLib 1.6.2 (Apr 9, 2010) ========================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/taglib-1.6.2/admin/cvs.sh new/taglib-1.6.3/admin/cvs.sh --- old/taglib-1.6.2/admin/cvs.sh 2008-08-19 21:56:25.000000000 +0200 +++ new/taglib-1.6.3/admin/cvs.sh 2010-04-10 00:51:26.000000000 +0200 @@ -68,7 +68,7 @@ echo "*** KDE requires automake $required_automake_version" exit 1 ;; - automake*1.6.* | automake*1.7* | automake*1.8* | automake*1.9* | automake*1.10*) + automake*1.6.* | automake*1.7* | automake*1.8* | automake*1.9* | automake*1.10* | automake*1.11*) echo "*** $AUTOMAKE_STRING found." UNSERMAKE=no ;; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/taglib-1.6.2/bindings/c/taglib_c.pc.in new/taglib-1.6.3/bindings/c/taglib_c.pc.in --- old/taglib-1.6.2/bindings/c/taglib_c.pc.in 2010-04-04 17:01:21.000000000 +0200 +++ new/taglib-1.6.3/bindings/c/taglib_c.pc.in 2010-04-12 19:43:03.000000000 +0200 @@ -6,6 +6,6 @@ Name: TagLib C Bindings Description: Audio meta-data library (C bindings) Requires: taglib -Version: 1.6.2 +Version: 1.6.3 Libs: -L${libdir} -ltag_c Cflags: -I${includedir}/taglib diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/taglib-1.6.2/configure new/taglib-1.6.3/configure --- old/taglib-1.6.2/configure 2010-04-09 11:36:00.000000000 +0200 +++ new/taglib-1.6.3/configure 2010-04-17 13:28:59.000000000 +0200 @@ -2597,7 +2597,7 @@ # Define the identity of the package. PACKAGE=taglib - VERSION=1.6.2 + VERSION=1.6.3 cat >>confdefs.h <<_ACEOF diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/taglib-1.6.2/configure.in new/taglib-1.6.3/configure.in --- old/taglib-1.6.2/configure.in 2010-04-09 11:35:53.000000000 +0200 +++ new/taglib-1.6.3/configure.in 2010-04-17 13:28:53.000000000 +0200 @@ -42,7 +42,7 @@ AC_ARG_PROGRAM dnl Automake doc recommends to do this only here. (Janos) -AM_INIT_AUTOMAKE(taglib,1.6.2) +AM_INIT_AUTOMAKE(taglib,1.6.3) dnl almost the same like KDE_SET_PEFIX but the path is /usr/local dnl diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/taglib-1.6.2/configure.in.in new/taglib-1.6.3/configure.in.in --- old/taglib-1.6.2/configure.in.in 2010-04-04 17:01:21.000000000 +0200 +++ new/taglib-1.6.3/configure.in.in 2010-04-12 19:43:03.000000000 +0200 @@ -38,7 +38,7 @@ AC_ARG_PROGRAM dnl Automake doc recommends to do this only here. (Janos) -AM_INIT_AUTOMAKE(taglib,1.6.2) +AM_INIT_AUTOMAKE(taglib,1.6.3) dnl almost the same like KDE_SET_PEFIX but the path is /usr/local dnl diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/taglib-1.6.2/doc/api-header.html new/taglib-1.6.3/doc/api-header.html --- old/taglib-1.6.2/doc/api-header.html 2010-04-04 17:01:21.000000000 +0200 +++ new/taglib-1.6.3/doc/api-header.html 2010-04-12 19:43:03.000000000 +0200 @@ -17,7 +17,7 @@ <td> <div id="intro"> <table border="0" height="119" cellpadding="0" cellspacing="0" width="100%"> - <tr><td valign="top"><h1>TagLib 1.6.2 ($title)</h1></td></tr> + <tr><td valign="top"><h1>TagLib 1.6.3 ($title)</h1></td></tr> <tr> <td valign="bottom"> <div id="links"> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/taglib-1.6.2/taglib/Makefile.am new/taglib-1.6.3/taglib/Makefile.am --- old/taglib-1.6.2/taglib/Makefile.am 2010-04-04 17:31:23.000000000 +0200 +++ new/taglib-1.6.3/taglib/Makefile.am 2010-04-12 20:41:10.000000000 +0200 @@ -47,8 +47,9 @@ # 7:1:6 -- TagLib 1.6 # 8:0:7 -- TagLib 1.6.1 # 9:0:8 -- TagLib 1.6.2 +# 10:0:9 -- TagLib 1.6.3 -libtag_la_LDFLAGS = $(all_libraries) -no-undefined -version-info 9:0:8 +libtag_la_LDFLAGS = $(all_libraries) -no-undefined -version-info 10:0:9 libtag_la_LIBADD = ./mpeg/libmpeg.la ./ogg/libogg.la ./flac/libflac.la ./mpc/libmpc.la \ ./ape/libape.la ./toolkit/libtoolkit.la ./wavpack/libwavpack.la \ ./trueaudio/libtrueaudio.la ./riff/libriff.la \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/taglib-1.6.2/taglib/Makefile.in new/taglib-1.6.3/taglib/Makefile.in --- old/taglib-1.6.2/taglib/Makefile.in 2010-04-09 11:36:02.000000000 +0200 +++ new/taglib-1.6.3/taglib/Makefile.in 2010-04-17 13:29:02.000000000 +0200 @@ -306,7 +306,8 @@ # 7:1:6 -- TagLib 1.6 # 8:0:7 -- TagLib 1.6.1 # 9:0:8 -- TagLib 1.6.2 -libtag_la_LDFLAGS = $(all_libraries) -no-undefined -version-info 9:0:8 +# 10:0:9 -- TagLib 1.6.3 +libtag_la_LDFLAGS = $(all_libraries) -no-undefined -version-info 10:0:9 libtag_la_LIBADD = ./mpeg/libmpeg.la ./ogg/libogg.la ./flac/libflac.la ./mpc/libmpc.la \ ./ape/libape.la ./toolkit/libtoolkit.la ./wavpack/libwavpack.la \ ./trueaudio/libtrueaudio.la ./riff/libriff.la \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/taglib-1.6.2/taglib/mpeg/id3v2/id3v2framefactory.cpp new/taglib-1.6.3/taglib/mpeg/id3v2/id3v2framefactory.cpp --- old/taglib-1.6.2/taglib/mpeg/id3v2/id3v2framefactory.cpp 2010-04-03 18:58:03.000000000 +0200 +++ new/taglib-1.6.3/taglib/mpeg/id3v2/id3v2framefactory.cpp 2010-04-12 20:27:59.000000000 +0200 @@ -412,10 +412,11 @@ if(s.startsWith("(") && end > 0) { // "(12)Genre" String text = s.substr(end + 1); - int number = s.substr(1, end - 1).toInt(); - if (number > 0 && number <= 255 && !(ID3v1::genre(number) == text)) + bool ok; + int number = s.substr(1, end - 1).toInt(&ok); + if(ok && number >= 0 && number <= 255 && !(ID3v1::genre(number) == text)) newfields.append(s.substr(1, end - 1)); - if (!text.isEmpty()) + if(!text.isEmpty()) newfields.append(text); } else { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/taglib-1.6.2/taglib/mpeg/id3v2/id3v2synchdata.cpp new/taglib-1.6.3/taglib/mpeg/id3v2/id3v2synchdata.cpp --- old/taglib-1.6.2/taglib/mpeg/id3v2/id3v2synchdata.cpp 2009-12-01 13:01:43.000000000 +0100 +++ new/taglib-1.6.3/taglib/mpeg/id3v2/id3v2synchdata.cpp 2010-04-15 22:22:21.000000000 +0200 @@ -46,14 +46,10 @@ } if(notSynchSafe) { - /* - * Invalid data; assume this was created by some buggy software that just - * put normal integers here rather than syncsafe ones, and try it that - * way. - */ - sum = 0; - for(int i = 0; i <= last; i++) - sum |= data[i] << ((last - i) * 8); + // Invalid data; assume this was created by some buggy software that just + // put normal integers here rather than syncsafe ones, and try it that + // way. + sum = (data.size() > 4) ? data.mid(0, 4).toUInt() : data.toUInt(); } return sum; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/taglib-1.6.2/taglib/mpeg/id3v2/id3v2tag.cpp new/taglib-1.6.3/taglib/mpeg/id3v2/id3v2tag.cpp --- old/taglib-1.6.2/taglib/mpeg/id3v2/id3v2tag.cpp 2010-03-07 20:03:35.000000000 +0100 +++ new/taglib-1.6.3/taglib/mpeg/id3v2/id3v2tag.cpp 2010-04-12 20:27:59.000000000 +0200 @@ -164,19 +164,10 @@ if((*it).isEmpty()) continue; - bool isNumber = true; - - for(String::ConstIterator charIt = (*it).begin(); - isNumber && charIt != (*it).end(); - ++charIt) - { - isNumber = *charIt >= '0' && *charIt <= '9'; - } - - if(isNumber) { - int number = (*it).toInt(); - if(number >= 0 && number <= 255) - *it = ID3v1::genre(number); + bool ok; + int number = (*it).toInt(&ok); + if(ok && number >= 0 && number <= 255) { + *it = ID3v1::genre(number); } if(std::find(genres.begin(), genres.end(), *it) == genres.end()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/taglib-1.6.2/taglib/taglib.pro new/taglib-1.6.3/taglib/taglib.pro --- old/taglib-1.6.2/taglib/taglib.pro 2010-04-04 17:01:21.000000000 +0200 +++ new/taglib-1.6.3/taglib/taglib.pro 2010-04-12 20:32:04.000000000 +0200 @@ -6,10 +6,10 @@ CONFIG += lib_bundle staticlib CONFIG += x86 x86_64 ppc CONFIG -= qt -DEFINES += HAVE_ZLIB=1 NDEBUG WITH_ASF WITH_MP4 +DEFINES += HAVE_ZLIB=1 NDEBUG WITH_ASF WITH_MP4 TAGLIB_NO_CONFIG LIBS += -lz TARGET = TagLib -VERSION = 1.6.2 +VERSION = 1.6.3 DEPENDPATH += . \ ape \ asf \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/taglib-1.6.2/taglib/taglib_export.h new/taglib-1.6.3/taglib/taglib_export.h --- old/taglib-1.6.2/taglib/taglib_export.h 2010-03-07 20:03:35.000000000 +0100 +++ new/taglib-1.6.3/taglib/taglib_export.h 2010-04-12 20:32:04.000000000 +0200 @@ -38,7 +38,7 @@ #define TAGLIB_EXPORT #endif -#ifdef HAVE_CONFIG_H +#ifndef TAGLIB_NO_CONFIG #include "taglib_config.h" #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/taglib-1.6.2/taglib/toolkit/taglib.h new/taglib-1.6.3/taglib/toolkit/taglib.h --- old/taglib-1.6.2/taglib/toolkit/taglib.h 2009-09-03 20:05:58.000000000 +0200 +++ new/taglib-1.6.3/taglib/toolkit/taglib.h 2010-04-12 19:43:03.000000000 +0200 @@ -28,7 +28,7 @@ #define TAGLIB_MAJOR_VERSION 1 #define TAGLIB_MINOR_VERSION 6 -#define TAGLIB_PATCH_VERSION 0 +#define TAGLIB_PATCH_VERSION 3 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 1)) #define TAGLIB_IGNORE_MISSING_DESTRUCTOR _Pragma("GCC diagnostic ignored \"-Wnon-virtual-dtor\"") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/taglib-1.6.2/taglib/toolkit/tstring.cpp new/taglib-1.6.3/taglib/toolkit/tstring.cpp --- old/taglib-1.6.2/taglib/toolkit/tstring.cpp 2009-04-29 17:57:05.000000000 +0200 +++ new/taglib-1.6.3/taglib/toolkit/tstring.cpp 2010-04-12 20:27:59.000000000 +0200 @@ -432,17 +432,27 @@ int String::toInt() const { + return toInt(0); +} + +int String::toInt(bool *ok) const +{ int value = 0; - bool negative = d->data[0] == '-'; - uint i = negative ? 1 : 0; + uint size = d->data.size(); + bool negative = size > 0 && d->data[0] == '-'; + uint start = negative ? 1 : 0; + uint i = start; - for(; i < d->data.size() && d->data[i] >= '0' && d->data[i] <= '9'; i++) + for(; i < size && d->data[i] >= '0' && d->data[i] <= '9'; i++) value = value * 10 + (d->data[i] - '0'); if(negative) value = value * -1; + if(ok) + *ok = (size > start && i == size); + return value; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/taglib-1.6.2/taglib/toolkit/tstring.h new/taglib-1.6.3/taglib/toolkit/tstring.h --- old/taglib-1.6.2/taglib/toolkit/tstring.h 2009-07-02 22:54:32.000000000 +0200 +++ new/taglib-1.6.3/taglib/toolkit/tstring.h 2010-04-12 20:53:27.000000000 +0200 @@ -291,10 +291,23 @@ /*! * Convert the string to an integer. + * + * Returns the integer if the conversion was successfull or 0 if the + * string does not represent a number. */ + // BIC: merge with the method below int toInt() const; /*! + * Convert the string to an integer. + * + * If the conversion was successfull, it sets the value of \a *ok to + * true and returns the integer. Otherwise it sets \a *ok to false + * and the result is undefined. + */ + int toInt(bool *ok) const; + + /*! * Returns a string with the leading and trailing whitespace stripped. */ String stripWhiteSpace() const; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/taglib-1.6.2/taglib-config.cmake new/taglib-1.6.3/taglib-config.cmake --- old/taglib-1.6.2/taglib-config.cmake 2010-04-04 17:01:21.000000000 +0200 +++ new/taglib-1.6.3/taglib-config.cmake 2010-04-12 19:43:03.000000000 +0200 @@ -35,7 +35,7 @@ flags="$flags -I$includedir/taglib" ;; --version) - echo 1.6.2 + echo 1.6.3 ;; --prefix) echo $prefix diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/taglib-1.6.2/taglib-config.in new/taglib-1.6.3/taglib-config.in --- old/taglib-1.6.2/taglib-config.in 2010-04-04 17:01:21.000000000 +0200 +++ new/taglib-1.6.3/taglib-config.in 2010-04-12 19:43:03.000000000 +0200 @@ -35,7 +35,7 @@ flags="$flags -I$includedir/taglib" ;; --version) - echo 1.6.2 + echo 1.6.3 ;; --prefix) echo $prefix diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/taglib-1.6.2/taglib.pc.in new/taglib-1.6.3/taglib.pc.in --- old/taglib-1.6.2/taglib.pc.in 2009-09-03 20:05:58.000000000 +0200 +++ new/taglib-1.6.3/taglib.pc.in 2010-04-17 13:31:35.000000000 +0200 @@ -6,6 +6,6 @@ Name: TagLib Description: Audio meta-data library Requires: -Version: 1.6 +Version: 1.6.3 Libs: -L${libdir} -ltag Cflags: -I${includedir}/taglib Files old/taglib-1.6.2/tests/data/compressed_id3_frame.mp3 and new/taglib-1.6.3/tests/data/compressed_id3_frame.mp3 differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/taglib-1.6.2/tests/test_id3v2.cpp new/taglib-1.6.3/tests/test_id3v2.cpp --- old/taglib-1.6.2/tests/test_id3v2.cpp 2010-04-03 18:58:03.000000000 +0200 +++ new/taglib-1.6.3/tests/test_id3v2.cpp 2010-04-15 22:22:21.000000000 +0200 @@ -61,6 +61,7 @@ CPPUNIT_TEST(testUpdateGenre24); CPPUNIT_TEST(testUpdateDate22); // CPPUNIT_TEST(testUpdateFullDate22); TODO TYE+TDA should be upgraded to TDRC together + CPPUNIT_TEST(testCompressedFrameWithBrokenLength); CPPUNIT_TEST_SUITE_END(); public: @@ -455,6 +456,19 @@ CPPUNIT_ASSERT_EQUAL(String("2010-04-03"), f.ID3v2Tag()->frameListMap()["TDRC"].front()->toString()); } + void testCompressedFrameWithBrokenLength() + { + MPEG::File f("data/compressed_id3_frame.mp3", false); + CPPUNIT_ASSERT(f.ID3v2Tag()->frameListMap().contains("APIC")); + ID3v2::AttachedPictureFrame *frame = + static_castTagLib::ID3v2::AttachedPictureFrame*(f.ID3v2Tag()->frameListMap()["APIC"].front()); + CPPUNIT_ASSERT(frame); + CPPUNIT_ASSERT_EQUAL(String("image/bmp"), frame->mimeType()); + CPPUNIT_ASSERT_EQUAL(ID3v2::AttachedPictureFrame::Other, frame->type()); + CPPUNIT_ASSERT_EQUAL(String(""), frame->description()); + CPPUNIT_ASSERT_EQUAL(TagLib::uint(86414), frame->picture().size()); + } + }; CPPUNIT_TEST_SUITE_REGISTRATION(TestID3v2); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/taglib-1.6.2/tests/test_string.cpp new/taglib-1.6.3/tests/test_string.cpp --- old/taglib-1.6.2/tests/test_string.cpp 2009-04-29 17:57:05.000000000 +0200 +++ new/taglib-1.6.3/tests/test_string.cpp 2010-04-12 20:27:59.000000000 +0200 @@ -40,6 +40,7 @@ CPPUNIT_TEST(testUTF16DecodeEmptyWithBOM); CPPUNIT_TEST(testAppendCharDetach); CPPUNIT_TEST(testAppendStringDetach); + CPPUNIT_TEST(testToInt); CPPUNIT_TEST_SUITE_END(); public: @@ -165,6 +166,33 @@ CPPUNIT_ASSERT_EQUAL(3, String("foo.bar").rfind(".")); } + void testToInt() + { + bool ok; + CPPUNIT_ASSERT_EQUAL(String("123").toInt(&ok), 123); + CPPUNIT_ASSERT_EQUAL(ok, true); + + CPPUNIT_ASSERT_EQUAL(String("-123").toInt(&ok), -123); + CPPUNIT_ASSERT_EQUAL(ok, true); + + CPPUNIT_ASSERT_EQUAL(String("abc").toInt(&ok), 0); + CPPUNIT_ASSERT_EQUAL(ok, false); + + CPPUNIT_ASSERT_EQUAL(String("1x").toInt(&ok), 1); + CPPUNIT_ASSERT_EQUAL(ok, false); + + CPPUNIT_ASSERT_EQUAL(String("").toInt(&ok), 0); + CPPUNIT_ASSERT_EQUAL(ok, false); + + CPPUNIT_ASSERT_EQUAL(String("-").toInt(&ok), 0); + CPPUNIT_ASSERT_EQUAL(ok, false); + + CPPUNIT_ASSERT_EQUAL(String("123").toInt(), 123); + CPPUNIT_ASSERT_EQUAL(String("-123").toInt(), -123); + CPPUNIT_ASSERT_EQUAL(String("123aa").toInt(), 123); + CPPUNIT_ASSERT_EQUAL(String("-123aa").toInt(), -123); + } + }; CPPUNIT_TEST_SUITE_REGISTRATION(TestString); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/taglib-1.6.2/tests/test_synchdata.cpp new/taglib-1.6.3/tests/test_synchdata.cpp --- old/taglib-1.6.2/tests/test_synchdata.cpp 2008-02-11 23:50:46.000000000 +0100 +++ new/taglib-1.6.3/tests/test_synchdata.cpp 2010-04-15 22:22:21.000000000 +0200 @@ -34,6 +34,8 @@ CPPUNIT_TEST(test1); CPPUNIT_TEST(test2); CPPUNIT_TEST(test3); + CPPUNIT_TEST(testToUIntBroken); + CPPUNIT_TEST(testToUIntBrokenAndTooLarge); CPPUNIT_TEST(testDecode1); CPPUNIT_TEST(testDecode2); CPPUNIT_TEST_SUITE_END(); @@ -67,6 +69,23 @@ CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::fromUInt(129), v); } + void testToUIntBroken() + { + char data[] = { 0, 0, 0, -1 }; + char data2[] = { 0, 0, -1, -1 }; + + CPPUNIT_ASSERT_EQUAL(TagLib::uint(255), ID3v2::SynchData::toUInt(ByteVector(data, 4))); + CPPUNIT_ASSERT_EQUAL(TagLib::uint(65535), ID3v2::SynchData::toUInt(ByteVector(data2, 4))); + } + + void testToUIntBrokenAndTooLarge() + { + char data[] = { 0, 0, 0, -1, 0 }; + ByteVector v(data, 5); + + CPPUNIT_ASSERT_EQUAL(TagLib::uint(255), ID3v2::SynchData::toUInt(v)); + } + void testDecode1() { ByteVector a("\xff\x00\x00", 3); ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org