From 9cdb03ed685901b477db46be98b6e272c299b821 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sat, 24 Oct 2015 12:23:51 +0200 Subject: Documentation on what tests are supposed to test. --- tests/clientapitest.cpp | 6 ++++++ tests/domainadaptortest.cpp | 3 +++ tests/dummyresourcetest.cpp | 5 +++++ tests/genericfacadetest.cpp | 5 +++++ tests/genericresourcetest.cpp | 6 ++++++ tests/indextest.cpp | 3 +++ tests/messagequeuetest.cpp | 3 +++ tests/pipelinetest.cpp | 3 +++ tests/resourcecommunicationtest.cpp | 3 +++ tests/storagetest.cpp | 4 +++- 10 files changed, 40 insertions(+), 1 deletion(-) diff --git a/tests/clientapitest.cpp b/tests/clientapitest.cpp index 231e773..665d29b 100644 --- a/tests/clientapitest.cpp +++ b/tests/clientapitest.cpp @@ -28,6 +28,11 @@ public: QWeakPointer > capturedResultProvider; }; +/** + * Test of the client api implementation. + * + * This test works with injected dummy facades and thus doesn't write to storage. + */ class ClientAPITest : public QObject { Q_OBJECT @@ -85,6 +90,7 @@ private Q_SLOTS: QTRY_VERIFY(!facade->capturedResultProvider); } + //TODO: This test doesn't belong to this testsuite void resourceManagement() { ResourceConfig::clear(); diff --git a/tests/domainadaptortest.cpp b/tests/domainadaptortest.cpp index ccf9a3c..f2300cb 100644 --- a/tests/domainadaptortest.cpp +++ b/tests/domainadaptortest.cpp @@ -22,6 +22,9 @@ public: } }; +/** + * Test of domain adaptor, that it can read and write buffers. + */ class DomainAdaptorTest : public QObject { Q_OBJECT diff --git a/tests/dummyresourcetest.cpp b/tests/dummyresourcetest.cpp index 48bb7b0..ae71912 100644 --- a/tests/dummyresourcetest.cpp +++ b/tests/dummyresourcetest.cpp @@ -11,6 +11,11 @@ #include "pipeline.h" #include "log.h" +/** + * Test of complete system using the dummy resource. + * + * This test requires the dummy resource installed. + */ class DummyResourceTest : public QObject { Q_OBJECT diff --git a/tests/genericfacadetest.cpp b/tests/genericfacadetest.cpp index 183a62a..67320c3 100644 --- a/tests/genericfacadetest.cpp +++ b/tests/genericfacadetest.cpp @@ -13,6 +13,11 @@ #include "event_generated.h" +/** + * Test for the generic facade implementation. + * + * This test doesn't use the actual storage and thus only tests the update logic of the facade. + */ class GenericFacadeTest : public QObject { Q_OBJECT diff --git a/tests/genericresourcetest.cpp b/tests/genericresourcetest.cpp index 60b1dab..6dd4108 100644 --- a/tests/genericresourcetest.cpp +++ b/tests/genericresourcetest.cpp @@ -20,6 +20,11 @@ static void removeFromDisk(const QString &name) store.removeFromDisk(); } +/** + * Test of the generic resource implementation. + * + * This test relies on a working pipeline implementation, and writes to storage. + */ class GenericResourceTest : public QObject { Q_OBJECT @@ -33,6 +38,7 @@ private Q_SLOTS: Akonadi2::Log::setDebugOutputLevel(Akonadi2::Log::Trace); } + ///Ensure the resource can process messages void testProcessCommand() { flatbuffers::FlatBufferBuilder eventFbb; diff --git a/tests/indextest.cpp b/tests/indextest.cpp index e3eabcc..edaf907 100644 --- a/tests/indextest.cpp +++ b/tests/indextest.cpp @@ -7,6 +7,9 @@ #include "storage.h" #include "index.h" +/** + * Test of the index implementation + */ class IndexTest : public QObject { Q_OBJECT diff --git a/tests/messagequeuetest.cpp b/tests/messagequeuetest.cpp index 22ce161..7d406ed 100644 --- a/tests/messagequeuetest.cpp +++ b/tests/messagequeuetest.cpp @@ -8,6 +8,9 @@ #include "messagequeue.h" #include "log.h" +/** + * Test of the messagequeue implementation. + */ class MessageQueueTest : public QObject { Q_OBJECT diff --git a/tests/pipelinetest.cpp b/tests/pipelinetest.cpp index 9aa7024..7efba13 100644 --- a/tests/pipelinetest.cpp +++ b/tests/pipelinetest.cpp @@ -139,6 +139,9 @@ QByteArray deleteEntityCommand(const QByteArray &uid, qint64 revision) return command; } +/** + * Test of the pipeline implementation to ensure new revisions are created correctly in the database. + */ class PipelineTest : public QObject { Q_OBJECT diff --git a/tests/resourcecommunicationtest.cpp b/tests/resourcecommunicationtest.cpp index 1ab516a..fa2b5a1 100644 --- a/tests/resourcecommunicationtest.cpp +++ b/tests/resourcecommunicationtest.cpp @@ -5,6 +5,9 @@ #include "commands.h" #include "handshake_generated.h" +/** + * Test that resourceaccess and listener work together. + */ class ResourceCommunicationTest : public QObject { Q_OBJECT diff --git a/tests/storagetest.cpp b/tests/storagetest.cpp index 8e841cb..bef8755 100644 --- a/tests/storagetest.cpp +++ b/tests/storagetest.cpp @@ -8,11 +8,13 @@ #include "common/storage.h" +/** + * Test of the storage implementation to ensure it can do the low level operations as expected. + */ class StorageTest : public QObject { Q_OBJECT private: - //This should point to a directory on disk and not a ramdisk (since we're measuring performance) QString testDataPath; QString dbName; const char *keyPrefix = "key"; -- cgit v1.2.3