diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-03-03 09:01:05 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-03-03 09:01:05 +0100 |
commit | 4d9746c828558c9f872e0aed52442863affb25d5 (patch) | |
tree | 507d7c2ba67f47d3cbbcf01a722236ff1b48426b /tests/modelinteractivitytest.cpp | |
parent | 9cea920b7dd51867a0be0fed2f461b6be73c103e (diff) | |
download | sink-4d9746c828558c9f872e0aed52442863affb25d5.tar.gz sink-4d9746c828558c9f872e0aed52442863affb25d5.zip |
Fromatted the whole codebase with clang-format.
clang-format -i */**{.cpp,.h}
Diffstat (limited to 'tests/modelinteractivitytest.cpp')
-rw-r--r-- | tests/modelinteractivitytest.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/tests/modelinteractivitytest.cpp b/tests/modelinteractivitytest.cpp index ad23e0f..d0a0920 100644 --- a/tests/modelinteractivitytest.cpp +++ b/tests/modelinteractivitytest.cpp | |||
@@ -16,20 +16,23 @@ static int blockingTime; | |||
16 | class TimeMeasuringApplication : public QCoreApplication | 16 | class TimeMeasuringApplication : public QCoreApplication |
17 | { | 17 | { |
18 | QElapsedTimer t; | 18 | QElapsedTimer t; |
19 | |||
19 | public: | 20 | public: |
20 | TimeMeasuringApplication(int& argc, char ** argv) : QCoreApplication(argc, argv) { } | 21 | TimeMeasuringApplication(int &argc, char **argv) : QCoreApplication(argc, argv) |
21 | virtual ~TimeMeasuringApplication() { } | 22 | { |
23 | } | ||
24 | virtual ~TimeMeasuringApplication() | ||
25 | { | ||
26 | } | ||
22 | 27 | ||
23 | virtual bool notify(QObject* receiver, QEvent* event) | 28 | virtual bool notify(QObject *receiver, QEvent *event) |
24 | { | 29 | { |
25 | t.start(); | 30 | t.start(); |
26 | const bool ret = QCoreApplication::notify(receiver, event); | 31 | const bool ret = QCoreApplication::notify(receiver, event); |
27 | if(t.elapsed() > 1) | 32 | if (t.elapsed() > 1) |
28 | std::cout << QString("processing event type %1 for object %2 took %3ms") | 33 | std::cout |
29 | .arg((int)event->type()) | 34 | << QString("processing event type %1 for object %2 took %3ms").arg((int)event->type()).arg("" /* receiver->objectName().toLocal8Bit().data()*/).arg((int)t.elapsed()).toStdString() |
30 | .arg(""/* receiver->objectName().toLocal8Bit().data()*/) | 35 | << std::endl; |
31 | .arg((int)t.elapsed()) | ||
32 | .toStdString() << std::endl; | ||
33 | blockingTime += t.elapsed(); | 36 | blockingTime += t.elapsed(); |
34 | return ret; | 37 | return ret; |
35 | } | 38 | } |
@@ -62,7 +65,7 @@ private slots: | |||
62 | 65 | ||
63 | void testSingle() | 66 | void testSingle() |
64 | { | 67 | { |
65 | //Setup | 68 | // Setup |
66 | { | 69 | { |
67 | Sink::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); | 70 | Sink::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); |
68 | for (int i = 0; i < 1000; i++) { | 71 | for (int i = 0; i < 1000; i++) { |
@@ -76,13 +79,13 @@ private slots: | |||
76 | 79 | ||
77 | Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); | 80 | Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); |
78 | 81 | ||
79 | //Test | 82 | // Test |
80 | QTime time; | 83 | QTime time; |
81 | time.start(); | 84 | time.start(); |
82 | auto model = Sink::Store::loadModel<Sink::ApplicationDomain::Mail>(query); | 85 | auto model = Sink::Store::loadModel<Sink::ApplicationDomain::Mail>(query); |
83 | blockingTime += time.elapsed(); | 86 | blockingTime += time.elapsed(); |
84 | QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); | 87 | QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); |
85 | //Never block longer than 10 ms | 88 | // Never block longer than 10 ms |
86 | QVERIFY2(blockingTime < 10, QString("Total blocking time: %1").arg(blockingTime).toLatin1().data()); | 89 | QVERIFY2(blockingTime < 10, QString("Total blocking time: %1").arg(blockingTime).toLatin1().data()); |
87 | } | 90 | } |
88 | }; | 91 | }; |