[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9

Maximiliano Curia maxy at moszumanska.debian.org
Mon May 9 09:07:30 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=f9bdeb0

The following commit has been merged in the master branch:
commit f9bdeb060d756c48d68e969c739caa8caba7962a
Author: Vishesh Handa <handa.vish at gmail.com>
Date:   Thu Mar 15 21:11:27 2012 +0530

    Reset the Nepomuk Repository after each test
    
    We don't want any data to be lying around from the previous tests
---
 kpeople/nepomuk-feeder/tests/storage-test.cpp | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/kpeople/nepomuk-feeder/tests/storage-test.cpp b/kpeople/nepomuk-feeder/tests/storage-test.cpp
index 868505c..2975b11 100644
--- a/kpeople/nepomuk-feeder/tests/storage-test.cpp
+++ b/kpeople/nepomuk-feeder/tests/storage-test.cpp
@@ -39,6 +39,9 @@
 #include <Nepomuk/Vocabulary/PIMO>
 #include <Nepomuk/Thing>
 
+#include <Soprano/QueryResultIterator>
+#include <Soprano/Model>
+
 #include <qtest_kde.h>
 
 #include <TelepathyQt/AvatarData>
@@ -1437,6 +1440,20 @@ void StorageTest::cleanup()
         mLoop->exec();
         m_storage = 0;
     }
+
+    kDebug() << "Reseting the repository";
+    QTime timer;
+    timer.start();
+
+    QString query = "select distinct ?r where { ?r ?p ?o. FILTER(regex(str(?r), '^nepomuk:/(res)|(ctx)')) . }";
+    Soprano::Model * model = Nepomuk::ResourceManager::instance()->mainModel();
+
+    Soprano::QueryResultIterator it = model->executeQuery( query, Soprano::Query::QueryLanguageSparql );
+    while( it.next() ) {
+        model->removeAllStatements( it[0], Soprano::Node(), Soprano::Node() );
+    }
+
+    kDebug() << "Time Taken: " << timer.elapsed()/1000.0 << " seconds";
 }
 
 void StorageTest::cleanupTestCase()

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list