[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [baloo/extractor_protocol] src/file/autotest/scheduler: adapt the test to the new realities
From: Aaron Seigo <aseigo () kde ! org>
Date: 2014-09-30 12:31:23
Message-ID: E1XYwaR-0004S6-Mi () scm ! kde ! org
[Download RAW message or body]
Git commit 77c88af937c9419a7b743e202d0bce0de7ce906f by Aaron Seigo.
Committed on 30/09/2014 at 12:19.
Pushed by aseigo into branch 'extractor_protocol'.
adapt the test to the new realities
this includes that folders being moved to phase 2 happens on the
worker side, that the queue may not be empty when suspended as
previously could be expected, etc.
M +5 -10 src/file/autotest/scheduler/schedulertest.cpp
http://commits.kde.org/baloo/77c88af937c9419a7b743e202d0bce0de7ce906f
diff --git a/src/file/autotest/scheduler/schedulertest.cpp \
b/src/file/autotest/scheduler/schedulertest.cpp index f00fb2c..b91a481 100644
--- a/src/file/autotest/scheduler/schedulertest.cpp
+++ b/src/file/autotest/scheduler/schedulertest.cpp
@@ -61,7 +61,6 @@ SchedulerTest::IndexingData \
SchedulerTest::fetchIndexingData(Database& db) query.first();
data.failed = query.value(0).toInt();
- qDebug() << "FOOOO";
return data;
}
@@ -72,7 +71,7 @@ void SchedulerTest::test()
db.setPath(dbDir.path());
db.init();
- uint numFiles = 20;
+ const uint numFiles = 20;
QTemporaryDir fileDir;
// The -1 is because the folder which contains all these files will also
// be indexed, and will count as a file
@@ -149,7 +148,7 @@ void SchedulerTest::testBatterySuspend()
db.setPath(dbDir.path());
db.init();
- uint numFiles = 10;
+ const uint numFiles = 10;
QTemporaryDir fileDir;
// The -1 is because the folder which contains all these files will also
// be indexed, and will count as a file
@@ -183,23 +182,19 @@ void SchedulerTest::testBatterySuspend()
QVERIFY(scheduler.m_basicIQ->isEmpty());
IndexingData data = fetchIndexingData(db);
- QCOMPARE(data.phaseOne, 0);
+ QCOMPARE(data.phaseOne, (int)numFiles);
QCOMPARE(data.phaseTwo, 0);
QCOMPARE(data.failed, 0);
- // The changes have still not been committed, so the fileIQ will be empty
- QVERIFY(scheduler.m_fileIQ->isEmpty());
QVERIFY(!scheduler.m_fileIQ->isSuspended());
scheduler.m_commitQ->commit();
- QVERIFY(!scheduler.m_fileIQ->isEmpty());
QVERIFY(!scheduler.m_fileIQ->isSuspended());
QCOMPARE(scheduler.m_fileIQ->delay(), 500);
data = fetchIndexingData(db);
- // Folders automatically go to phase2
- QCOMPARE(data.phaseOne, (int)numFiles-1);
- QCOMPARE(data.phaseTwo, 1);
+ QCOMPARE(data.phaseOne, (int)numFiles);
+ QCOMPARE(data.phaseTwo, 0);
QCOMPARE(data.failed, 0);
// Conserve resources
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic