aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vrátil <dvratil@kde.org>2016-10-02 08:26:38 (GMT)
committerDaniel Vrátil <dvratil@kde.org>2016-10-02 08:26:38 (GMT)
commit6055f43757d5d028b5fba63041ee95465ca19260 (patch)
tree1ea97510177850fb10f42474f38b0cf2c9a4c1d4
parent9178715877dcb12c451c8ed9e0e38199aa89fa06 (diff)
Fix DbInitializerTest
-rw-r--r--autotests/server/dbinitializertest.cpp5
-rw-r--r--src/server/storage/dbinitializer.cpp2
2 files changed, 6 insertions, 1 deletions
diff --git a/autotests/server/dbinitializertest.cpp b/autotests/server/dbinitializertest.cpp
index 0ff047e..82ea175 100644
--- a/autotests/server/dbinitializertest.cpp
+++ b/autotests/server/dbinitializertest.cpp
@@ -24,7 +24,10 @@
#include <QtCore/QDebug>
#include <QtCore/QVariant>
-#include "storage/dbinitializer.h"
+#define DBINITIALIZER_UNITTEST
+#include "storage/dbinitializer.cpp"
+#undef DBINITIALIZER_UNITTEST
+
#include <shared/aktest.h>
#define QL1S(x) QLatin1String(x)
diff --git a/src/server/storage/dbinitializer.cpp b/src/server/storage/dbinitializer.cpp
index f2d840a..7babe28 100644
--- a/src/server/storage/dbinitializer.cpp
+++ b/src/server/storage/dbinitializer.cpp
@@ -92,6 +92,7 @@ bool DbInitializer::run()
}
}
+#ifndef DBINITIALIZER_UNITTEST
// Now finally check and set the generation identifier if necessary
SchemaVersion version = SchemaVersion::retrieveAll().first();
if (version.generation() == 0) {
@@ -100,6 +101,7 @@ bool DbInitializer::run()
qCDebug(AKONADISERVER_LOG) << "Generation:" << version.generation();
}
+#endif
qCDebug(AKONADISERVER_LOG) << "DbInitializer::run() done";
return true;