[packages/libmygpo-qt] - upstream patch to fix broken test - rel 3

baggins baggins at pld-linux.org
Tue Feb 28 07:51:56 CET 2017


commit c9981a6cd2528b61e171681340173c7586a5010a
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Tue Feb 28 07:51:35 2017 +0100

    - upstream patch to fix broken test
    - rel 3

 fix-test.patch   | 41 +++++++++++++++++++++++++++++++++++++++++
 libmygpo-qt.spec |  4 +++-
 2 files changed, 44 insertions(+), 1 deletion(-)
---
diff --git a/libmygpo-qt.spec b/libmygpo-qt.spec
index d0aa553..092acba 100644
--- a/libmygpo-qt.spec
+++ b/libmygpo-qt.spec
@@ -5,12 +5,13 @@
 Summary:	Qt Library that wraps the gpodder.net Web API
 Name:		libmygpo-qt
 Version:	1.0.8
-Release:	2
+Release:	3
 License:	LGPL v2+
 Source0:	http://stefan.derkits.at/files/libmygpo-qt/%{name}.%{version}.tar.gz
 # Source0-md5:	cb67c86919171d6d2356dfb59c3b9571
 Patch0:		https://github.com/gpodder/libmygpo-qt/compare/1.0.8...master.patch
 # Patch0-md5:	cf716711e999823c9941861a18c19fc2
+Patch1:		fix-test.patch
 Group:		Libraries
 URL:		http://wiki.gpodder.org/wiki/Libmygpo-qt
 BuildRequires:	QtCore-devel
@@ -41,6 +42,7 @@ libmygpo-qt is a Qt Library that wraps the gpodder.net Web API,
 %prep
 %setup -q -n %{name}.%{version}
 %patch0 -p1
+%patch1 -p1
 
 grep '^From ' %{PATCH0}
 
diff --git a/fix-test.patch b/fix-test.patch
new file mode 100644
index 0000000..c457d59
--- /dev/null
+++ b/fix-test.patch
@@ -0,0 +1,41 @@
+From ebe2323727f8d646590245b0bf06dbc92b5808d6 Mon Sep 17 00:00:00 2001
+From: Golubev Alexander <fatzer2 at gmail.com>
+Date: Tue, 20 Sep 2016 15:33:30 +0400
+Subject: [PATCH] JsonCreatorTest failed due to extra space
+
+JsonCreatorTest failed with next message:
+```
+********* Start testing of mygpo::JsonCreatorTest *********
+Config: Using QTest library 4.8.6, Qt 4.8.6
+PASS   : mygpo::JsonCreatorTest::initTestCase()
+PASS   : mygpo::JsonCreatorTest::testAddRemoveSubsToJSON()
+PASS   : mygpo::JsonCreatorTest::testSaveSettingsToJSON()
+FAIL!  : mygpo::JsonCreatorTest::testEpisodeActionListToJSON() Compared values are not the same
+   Actual (outString2): [{"action":"download","device":"device1","episode":"http://episode.url","podcast":"http://podcast.url","timestamp":"1998-01-01T00:01:02"},{"action":"delete","device":"device3","episode":"http://episode2.url","podcast":"http://podcast2.url","timestamp":"1920-01-01T12:01:02"},{"action":"new","device":"foodev","episode":"http://www.podtrac.com","podcast":"http://leo.am","timestamp":"1998-01-01T00:01:02"},{"action":"play","device":"foodev","episode":"http://www.podtrac.com","podcast":"http://leo.am","timestamp":"1920-01-01T12:01:02"},{"action":"play","device":"foodev","episode":"http://www.podtrac.com","podcast":"http://leo.am","position":123,"started":10,"timestamp":"1998-01-01T00:01:02","total":321},{"action":"play","device":"foodev","episode":"http://www.podtrac.com","podcast":"http://leo.am","position":10,"timestamp":"1998-01-01T00:01:02"}]
+   Expected (expected2): [{"action":"download","device":"device1","episode":"http://episode.url","podcast":"http:
+   Loc: [/var/tmp/portage/media-libs/libmygpo-qt-1.0.9-r1/work/libmygpo-qt-1.0.9/tests/JsonCreatorTest.cpp(138)]
+PASS   : mygpo::JsonCreatorTest::testRenameDeviceStringToJSON()
+PASS   : mygpo::JsonCreatorTest::testDeviceSynchronizationListsToJSON()
+PASS   : mygpo::JsonCreatorTest::cleanupTestCase()
+Totals: 6 passed, 1 failed, 0 skipped
+********* Finished testing of mygpo::JsonCreatorTest *********
+```
+
+This was caused by extra space in the expected string.
+---
+ tests/JsonCreatorTest.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/JsonCreatorTest.cpp b/tests/JsonCreatorTest.cpp
+index b15b006..feb03d5 100644
+--- a/tests/JsonCreatorTest.cpp
++++ b/tests/JsonCreatorTest.cpp
+@@ -133,7 +133,7 @@ void JsonCreatorTest::testEpisodeActionListToJSON()
+ 
+   output = JsonCreator::episodeActionListToJSON(episodeActions);
+   QString outString2 = QString::fromLatin1( output ).replace( QLatin1String(" "), QLatin1String("") );
+-  QString expected2( QLatin1String( "[{\"action\":\"download\",\"device\":\"device1\",\"episode\":\"http://episode.url\",\"podcast\":\"http://podcast.url\",\"timestamp\":\"1998-01-01T00:01:02\"},{\"action\":\"delete\",\"device\":\"device3\",\"episode\":\"http://episode2.url\",\"podcast\":\"http://podcast2.url\",\"timestamp\":\"1920-01-01T12:01:02\"},{\"action\":\"new\",\"device\":\"foodev\",\"episode\":\"http://www.podtrac.com\",\"podcast\":\"http://leo.am\",\"timestamp\":\"1998-01-01T00:01:02\"},{\"action\":\"play\",\"device\":\"foodev\",\"episode\":\"http://www.podtrac.com\",\"podcast\":\"http://leo.am\",\"timestamp\":\"1920-01-01T12:01:02\" },{\"action\":\"play\",\"device\":\"foodev\",\"episode\":\"http://www.podtrac.com\",\"podcast\":\"http://leo.am\",\"position\":123,\"started\":10,\"timestamp\":\"1998-01-01T00:01:02\",\"total\":321},{\"action\":\"play\",\"device\":\"foodev\",\"episode\":\"http://www.podtrac.com\",\"podcast\":\"http://leo.am\",\"position\":10,\"timestamp\":\"1998-01-01T00:01:02\"}]" ) );
++  QString expected2( QLatin1String( "[{\"action\":\"download\",\"device\":\"device1\",\"episode\":\"http://episode.url\",\"podcast\":\"http://podcast.url\",\"timestamp\":\"1998-01-01T00:01:02\"},{\"action\":\"delete\",\"device\":\"device3\",\"episode\":\"http://episode2.url\",\"podcast\":\"http://podcast2.url\",\"timestamp\":\"1920-01-01T12:01:02\"},{\"action\":\"new\",\"device\":\"foodev\",\"episode\":\"http://www.podtrac.com\",\"podcast\":\"http://leo.am\",\"timestamp\":\"1998-01-01T00:01:02\"},{\"action\":\"play\",\"device\":\"foodev\",\"episode\":\"http://www.podtrac.com\",\"podcast\":\"http://leo.am\",\"timestamp\":\"1920-01-01T12:01:02\"},{\"action\":\"play\",\"device\":\"foodev\",\"episode\":\"http://www.podtrac.com\",\"podcast\":\"http://leo.am\",\"position\":123,\"started\":10,\"timestamp\":\"1998-01-01T00:01:02\",\"total\":321},{\"action\":\"play\",\"device\":\"foodev\",\"episode\":\"http://www.podtrac.com\",\"podcast\":\"http://leo.am\",\"position\":10,\"timestamp\":\"1998-01-01T00:01:02\"}]" ) );
+ 
+   QCOMPARE(outString2, expected2 );
+ }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libmygpo-qt.git/commitdiff/c9981a6cd2528b61e171681340173c7586a5010a



More information about the pld-cvs-commit mailing list