summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vrátil <dvratil@kde.org>2016-09-08 15:57:42 (GMT)
committerDaniel Vrátil <dvratil@kde.org>2016-09-08 15:57:42 (GMT)
commitab1ddb2a848cea10599fa4dd322b5bb8e4415a7a (patch)
tree4d7d0ab662aef264f0f87c6857d4beb2e0af83c9
parent516defa9838ef2393fc125be8e028bacf0fdd5ac (diff)
PartStreamerTest: correctly verify older parts were removed
-rw-r--r--autotests/server/partstreamertest.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/autotests/server/partstreamertest.cpp b/autotests/server/partstreamertest.cpp
index 3e4e56c..4588125 100644
--- a/autotests/server/partstreamertest.cpp
+++ b/autotests/server/partstreamertest.cpp
@@ -220,8 +220,9 @@ private Q_SLOTS:
QCOMPARE(fileData, expectedFileData);
// Make sure no previous versions are left behind in file_db_data
- for (int i = 0; i < part.version(); ++i) {
- const QByteArray fileName = QByteArray::number(part.id()) + "_r" + QByteArray::number(part.version());
+ const int revision = data.mid(data.indexOf("_r") + 2).toInt();
+ for (int i = 0; i < revision; ++i) {
+ const QByteArray fileName = QByteArray::number(part.id()) + "_r" + QByteArray::number(i);
const QString filePath = ExternalPartStorage::resolveAbsolutePath(fileName);
QVERIFY(!QFile::exists(filePath));
}
@@ -229,8 +230,9 @@ private Q_SLOTS:
QCOMPARE(data, expectedPartData);
// Make sure nothing is left behind in file_db_data
- for (int i = 0; i <= part.version(); ++i) {
- const QByteArray fileName = QByteArray::number(part.id()) + "_r" + QByteArray::number(part.version());
+ // TODO: we have no way of knowing what is the last revision
+ for (int i = 0; i <= 100; ++i) {
+ const QByteArray fileName = QByteArray::number(part.id()) + "_r" + QByteArray::number(i);
const QString filePath = ExternalPartStorage::resolveAbsolutePath(fileName);
QVERIFY(!QFile::exists(filePath));
}