From 3dd90236e7927028ff5c98635f8075189c9869c2 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Mon, 15 Dec 2014 19:28:05 +0100 Subject: namespace everything in libs with Akonadi2 --- tests/dummyresourcefacadetest.cpp | 6 +++--- tests/hawd/dataset.cpp | 6 +++--- tests/hawd/dataset.h | 2 +- tests/storagebenchmark.cpp | 14 +++++++------- tests/storagetest.cpp | 22 +++++++++++----------- 5 files changed, 25 insertions(+), 25 deletions(-) (limited to 'tests') diff --git a/tests/dummyresourcefacadetest.cpp b/tests/dummyresourcefacadetest.cpp index 26daa23..d815e9b 100644 --- a/tests/dummyresourcefacadetest.cpp +++ b/tests/dummyresourcefacadetest.cpp @@ -19,7 +19,7 @@ private: void populate(int count) { - Storage storage(testDataPath, dbName, Storage::ReadWrite); + Akonadi2::Storage storage(testDataPath, dbName, Akonadi2::Storage::ReadWrite); for (int i = 0; i < count; i++) { storage.write(keyPrefix + std::to_string(i), keyPrefix + std::to_string(i)); } @@ -38,7 +38,7 @@ private Q_SLOTS: void cleanupTestCase() { - Storage storage(testDataPath, dbName); + Akonadi2::Storage storage(testDataPath, dbName); storage.removeFromDisk(); } @@ -63,7 +63,7 @@ private Q_SLOTS: QTRY_VERIFY(complete); QCOMPARE(results.size(), 1); - Storage storage(testDataPath, dbName); + Akonadi2::Storage storage(testDataPath, dbName); storage.removeFromDisk(); } diff --git a/tests/hawd/dataset.cpp b/tests/hawd/dataset.cpp index a5328e4..6e73c5c 100644 --- a/tests/hawd/dataset.cpp +++ b/tests/hawd/dataset.cpp @@ -207,7 +207,7 @@ QString Dataset::Row::toString(const QStringList &cols, int standardCols, const Dataset::Dataset(const QString &name, const State &state) : m_definition(state.datasetDefinition(name)), - m_storage(state.resultsPath(), name, Storage::ReadWrite), + m_storage(state.resultsPath(), name, Akonadi2::Storage::ReadWrite), m_commitHash(state.commitHash()) { m_storage.startTransaction(); @@ -264,7 +264,7 @@ void Dataset::eachRow(const std::function &resultHandler) resultHandler(row); return true; }, - Storage::basicErrorHandler()); + Akonadi2::Storage::basicErrorHandler()); } Dataset::Row Dataset::row(qint64 key) @@ -282,7 +282,7 @@ Dataset::Row Dataset::row(qint64 key) row.fromBinary(array); return true; }, - Storage::basicErrorHandler() + Akonadi2::Storage::basicErrorHandler() ); return row; } diff --git a/tests/hawd/dataset.h b/tests/hawd/dataset.h index 09a5828..dd1d6f2 100644 --- a/tests/hawd/dataset.h +++ b/tests/hawd/dataset.h @@ -83,7 +83,7 @@ public: private: DatasetDefinition m_definition; - Storage m_storage; + Akonadi2::Storage m_storage; QString m_commitHash; }; diff --git a/tests/storagebenchmark.cpp b/tests/storagebenchmark.cpp index 130753f..9cf9a71 100644 --- a/tests/storagebenchmark.cpp +++ b/tests/storagebenchmark.cpp @@ -62,7 +62,7 @@ private Q_SLOTS: void cleanupTestCase() { - Storage store(testDataPath, dbName); + Akonadi2::Storage store(testDataPath, dbName); store.removeFromDisk(); } @@ -80,9 +80,9 @@ private Q_SLOTS: QFETCH(bool, useDb); QFETCH(int, count); - QScopedPointer store; + QScopedPointer store; if (useDb) { - store.reset(new Storage(testDataPath, dbName, Storage::ReadWrite)); + store.reset(new Akonadi2::Storage(testDataPath, dbName, Akonadi2::Storage::ReadWrite)); } std::ofstream myfile; @@ -143,10 +143,10 @@ private Q_SLOTS: qDebug() << "File reading is not implemented."; } } - + void testScan() { - QScopedPointer store(new Storage(testDataPath, dbName, Storage::ReadOnly)); + QScopedPointer store(new Akonadi2::Storage(testDataPath, dbName, Akonadi2::Storage::ReadOnly)); QBENCHMARK { int hit = 0; @@ -163,7 +163,7 @@ private Q_SLOTS: void testKeyLookup() { - QScopedPointer store(new Storage(testDataPath, dbName, Storage::ReadOnly)); + QScopedPointer store(new Akonadi2::Storage(testDataPath, dbName, Akonadi2::Storage::ReadOnly)); QBENCHMARK { int hit = 0; @@ -203,7 +203,7 @@ private Q_SLOTS: void testSizes() { - Storage store(testDataPath, dbName); + Akonadi2::Storage store(testDataPath, dbName); qDebug() << "Database size [kb]: " << store.diskUsage()/1024; QFileInfo fileInfo(filePath); diff --git a/tests/storagetest.cpp b/tests/storagetest.cpp index 3c20135..a771042 100644 --- a/tests/storagetest.cpp +++ b/tests/storagetest.cpp @@ -19,7 +19,7 @@ private: void populate(int count) { - Storage storage(testDataPath, dbName, Storage::ReadWrite); + Akonadi2::Storage storage(testDataPath, dbName, Akonadi2::Storage::ReadWrite); for (int i = 0; i < count; i++) { //This should perhaps become an implementation detail of the db? if (i % 10000 == 0) { @@ -33,7 +33,7 @@ private: storage.commitTransaction(); } - bool verify(Storage &storage, int i) + bool verify(Akonadi2::Storage &storage, int i) { bool success = true; bool keyMatch = true; @@ -46,7 +46,7 @@ private: } return keyMatch; }, - [&success](const Storage::Error &) { success = false; } + [&success](const Akonadi2::Storage::Error &) { success = false; } ); return success && keyMatch; } @@ -60,7 +60,7 @@ private Q_SLOTS: void cleanupTestCase() { - Storage storage(testDataPath, dbName); + Akonadi2::Storage storage(testDataPath, dbName); storage.removeFromDisk(); } @@ -72,13 +72,13 @@ private Q_SLOTS: //ensure we can read everything back correctly { - Storage storage(testDataPath, dbName); + Akonadi2::Storage storage(testDataPath, dbName); for (int i = 0; i < count; i++) { QVERIFY(verify(storage, i)); } } - Storage storage(testDataPath, dbName); + Akonadi2::Storage storage(testDataPath, dbName); storage.removeFromDisk(); } @@ -90,7 +90,7 @@ private Q_SLOTS: //ensure we can scan for values { int hit = 0; - Storage store(testDataPath, dbName); + Akonadi2::Storage store(testDataPath, dbName); store.scan("", [&](void *keyValue, int keySize, void *dataValue, int dataSize) -> bool { if (std::string(static_cast(keyValue), keySize) == "key50") { hit++; @@ -104,7 +104,7 @@ private Q_SLOTS: { int hit = 0; bool foundInvalidValue = false; - Storage store(testDataPath, dbName); + Akonadi2::Storage store(testDataPath, dbName); store.scan("key50", [&](void *keyValue, int keySize, void *dataValue, int dataSize) -> bool { if (std::string(static_cast(keyValue), keySize) != "key50") { foundInvalidValue = true; @@ -116,7 +116,7 @@ private Q_SLOTS: QCOMPARE(hit, 1); } - Storage storage(testDataPath, dbName); + Akonadi2::Storage storage(testDataPath, dbName); storage.removeFromDisk(); } @@ -132,7 +132,7 @@ private Q_SLOTS: const int concurrencyLevel = 10; for (int num = 0; num < concurrencyLevel; num++) { futures << QtConcurrent::run([this, count, &error](){ - Storage storage(testDataPath, dbName); + Akonadi2::Storage storage(testDataPath, dbName); for (int i = 0; i < count; i++) { if (!verify(storage, i)) { error = true; @@ -146,7 +146,7 @@ private Q_SLOTS: } QVERIFY(!error); - Storage storage(testDataPath, dbName); + Akonadi2::Storage storage(testDataPath, dbName); storage.removeFromDisk(); } }; -- cgit v1.2.3