diff options
Diffstat (limited to 'media-libs/lastfmlib/files')
-rw-r--r-- | media-libs/lastfmlib/files/lastfmlib-0.4.0-autotools-tests.patch | 31 | ||||
-rw-r--r-- | media-libs/lastfmlib/files/lastfmlib-0.4.0-out-of-bounds-trim.patch | 24 |
2 files changed, 55 insertions, 0 deletions
diff --git a/media-libs/lastfmlib/files/lastfmlib-0.4.0-autotools-tests.patch b/media-libs/lastfmlib/files/lastfmlib-0.4.0-autotools-tests.patch new file mode 100644 index 000000000000..506d5a37693b --- /dev/null +++ b/media-libs/lastfmlib/files/lastfmlib-0.4.0-autotools-tests.patch @@ -0,0 +1,31 @@ +* Run the tests as part of 'make check' (not just building testrunner). +* Use pkg-config to find gtest, not the now-removed gtest-config. +--- a/Makefile.am ++++ b/Makefile.am +@@ -59,6 +59,7 @@ pkgconfig_DATA = liblastfmlib.pc + + if ENABLE_UNITTEST + check_PROGRAMS = testrunner ++TESTS = $(check_PROGRAMS) + endif + + testrunner_SOURCES = lastfmlib/unittest/testrunner.cpp \ +--- a/configure.ac ++++ b/configure.ac +@@ -51,13 +51,10 @@ AC_ARG_ENABLE(unittests, + [ --enable-unittests Enables build of unittests ], + ENABLE_UNITTEST=$enableval) + +-if test "$ENABLE_UNITTEST" = "yes"; then +- AC_CHECK_HEADERS( +- [gtest/gtest.h],, +- [AC_MSG_ERROR([Missing gtest library, install the google unittest framework])]) +- UNITTEST_LIBS="$(gtest-config --libs)" ++AS_IF([test "$ENABLE_UNITTEST" = "yes"], [ ++ PKG_CHECK_MODULES([UNITTEST], [gtest], [], [AC_MSG_ERROR([Missing gtest library, install the google unittest framework])]) + AC_SUBST(UNITTEST_LIBS) +-fi ++]) + AM_CONDITIONAL(ENABLE_UNITTEST, test "$enable_unittests" = "yes") + + AC_SUBST([pkgconfigdir]) diff --git a/media-libs/lastfmlib/files/lastfmlib-0.4.0-out-of-bounds-trim.patch b/media-libs/lastfmlib/files/lastfmlib-0.4.0-out-of-bounds-trim.patch new file mode 100644 index 000000000000..6c01a59269d4 --- /dev/null +++ b/media-libs/lastfmlib/files/lastfmlib-0.4.0-out-of-bounds-trim.patch @@ -0,0 +1,24 @@ +Fix out of bounds assertion with -D_GLIBCXX_ASSERTIONS on empty string in testsuite. +--- a/lastfmlib/utils/stringoperations.cpp ++++ b/lastfmlib/utils/stringoperations.cpp +@@ -40,7 +40,7 @@ void trim(std::string& aString) + { + size_t begin = 0; + size_t end = aString.size() - 1; +- ++ + while ( aString[begin] == ' ' || aString[begin] == '\t' + || aString[begin] == '\r' || aString[begin] == '\n') + { +@@ -50,8 +50,10 @@ void trim(std::string& aString) + break; + } + +- if (begin == aString.size()) ++ if (begin == aString.size()) { + aString = ""; ++ return; ++ } + + while ( aString[end] == ' ' || aString[end] == '\t' + || aString[end] == '\r' || aString[end] == '\n') |