[neon/extras/tellico/Neon/release] debian: fix the code of an unit test

Pino Toscano null at kde.org
Thu Sep 8 17:48:55 BST 2022


Git commit 611d7cf6756dbf8d63002e6c064dd4d0e0edc3f7 by Pino Toscano.
Committed on 03/01/2022 at 12:42.
Pushed by jriddell into branch 'Neon/release'.

fix the code of an unit test

backport upstream commit 46400b75b4c39ab2eb713bec04f02416c3c1e52b

M  +3    -0    debian/changelog
M  +1    -0    debian/patches/series
A  +55   -0    debian/patches/upstream_Update-unit-test-for-collection-appending-and-mergin.patch

https://invent.kde.org/neon/extras/tellico/commit/611d7cf6756dbf8d63002e6c064dd4d0e0edc3f7

diff --git a/debian/changelog b/debian/changelog
index 738c8d3..8c9d30a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,9 @@ tellico (3.4.3-0r1) UNRELEASED; urgency=medium
 
   [ Pino Toscano ]
   * New upstream release.
+  * Backport upstream commit 46400b75b4c39ab2eb713bec04f02416c3c1e52b to fix
+    the code of an unit test; patch
+    upstream_Update-unit-test-for-collection-appending-and-mergin.patch.
 
  -- Debian KDE Extras Team <pkg-kde-extras at lists.alioth.debian.org>  Mon, 03 Jan 2022 13:06:16 +0100
 
diff --git a/debian/patches/series b/debian/patches/series
index 15de621..2b82c39 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
+upstream_Update-unit-test-for-collection-appending-and-mergin.patch
 tests-disable-fetchertest.diff
diff --git a/debian/patches/upstream_Update-unit-test-for-collection-appending-and-mergin.patch b/debian/patches/upstream_Update-unit-test-for-collection-appending-and-mergin.patch
new file mode 100644
index 0000000..9321bd1
--- /dev/null
+++ b/debian/patches/upstream_Update-unit-test-for-collection-appending-and-mergin.patch
@@ -0,0 +1,55 @@
+From 46400b75b4c39ab2eb713bec04f02416c3c1e52b Mon Sep 17 00:00:00 2001
+From: Robby Stephenson <robby at periapsis.org>
+Date: Sun, 2 Jan 2022 21:50:15 -0500
+Subject: [PATCH] Update unit test for collection appending and merging
+
+---
+ src/tests/collectiontest.cpp | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/src/tests/collectiontest.cpp b/src/tests/collectiontest.cpp
+index ae58ee53..5362b19a 100644
+--- a/src/tests/collectiontest.cpp
++++ b/src/tests/collectiontest.cpp
+@@ -594,7 +594,9 @@ void CollectionTest::testAppendCollection() {
+   coll2->addEntries(entry2);
+ 
+   // append coll1 into coll2
+-  Tellico::Data::Document::appendCollection(coll2, coll1);
++  bool structuralChange;
++  Tellico::Data::Document::appendCollection(coll2, coll1, &structuralChange);
++  QVERIFY(structuralChange);
+   // verify that the test field was added
+   QVERIFY(coll2->hasField(QStringLiteral("test")));
+   // verified that the modified field was merged
+@@ -635,7 +637,9 @@ void CollectionTest::testMergeCollection() {
+   // second item is a pair of entries that had their table field modified
+   // typedef QVector< QPair<EntryPtr, QString> > PairVector;
+   // typedef QPair<Data::EntryList, PairVector> MergePair;
+-  Tellico::Data::MergePair mergePair = Tellico::Data::Document::mergeCollection(coll1, coll2);
++  bool structuralChange;
++  Tellico::Data::MergePair mergePair = Tellico::Data::Document::mergeCollection(coll1, coll2, &structuralChange);
++  QCOMPARE(structuralChange, false);
+ 
+   // one new entry was added
+   QCOMPARE(mergePair.first.count(), 1);
+@@ -681,6 +685,7 @@ void CollectionTest::testBookMatch() {
+ void CollectionTest::testMergeBenchmark() {
+   QUrl url = QUrl::fromLocalFile(QFINDTESTDATA("data/movies-many.tc"));
+ 
++  bool structuralChange;
+   Tellico::Data::EntryList entriesToAdd;
+   QBENCHMARK {
+     Tellico::Import::TellicoImporter importer1(url, false /* load all images */);
+@@ -700,7 +705,7 @@ void CollectionTest::testMergeBenchmark() {
+     }
+     coll2->addEntries(entriesToAdd);
+ 
+-    Tellico::Data::Document::mergeCollection(coll1, coll2);
++    Tellico::Data::Document::mergeCollection(coll1, coll2, &structuralChange);
+   }
+ }
+ 
+-- 
+2.34.1
+



More information about the Neon-commits mailing list