diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-06-16 22:17:54 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-06-16 22:17:54 +0200 |
commit | 3ae86373f2238bcd771392f329b52d7b8923d003 (patch) | |
tree | 03a9648d64081de0457d9ec94e41774ca662cf00 /tests/mailsynctest.h | |
parent | 9d727c366ed709fd15d2358800f57e927fd18ed2 (diff) | |
download | sink-3ae86373f2238bcd771392f329b52d7b8923d003.tar.gz sink-3ae86373f2238bcd771392f329b52d7b8923d003.zip |
Central place for test macros
Diffstat (limited to 'tests/mailsynctest.h')
-rw-r--r-- | tests/mailsynctest.h | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/tests/mailsynctest.h b/tests/mailsynctest.h index ec40f33..a21335b 100644 --- a/tests/mailsynctest.h +++ b/tests/mailsynctest.h | |||
@@ -22,26 +22,7 @@ | |||
22 | #include <QByteArray> | 22 | #include <QByteArray> |
23 | 23 | ||
24 | #include <applicationdomaintype.h> | 24 | #include <applicationdomaintype.h> |
25 | 25 | #include "testutils.h" | |
26 | #define ASYNCCOMPARE(actual, expected) \ | ||
27 | do {\ | ||
28 | if (!QTest::qCompare(actual, expected, #actual, #expected, __FILE__, __LINE__))\ | ||
29 | return KAsync::error<void>(1, "Comparison failed.");\ | ||
30 | } while (0) | ||
31 | |||
32 | #define ASYNCVERIFY(statement) \ | ||
33 | do {\ | ||
34 | if (!QTest::qVerify((statement), #statement, "", __FILE__, __LINE__))\ | ||
35 | return KAsync::error<void>(1, "Verify failed.");\ | ||
36 | } while (0) | ||
37 | |||
38 | #define VERIFYEXEC(statement) \ | ||
39 | do {\ | ||
40 | auto result = statement.exec(); \ | ||
41 | result.waitForFinished(); \ | ||
42 | if (!QTest::qVerify(!result.errorCode(), #statement, "", __FILE__, __LINE__))\ | ||
43 | return;\ | ||
44 | } while (0) | ||
45 | 26 | ||
46 | namespace Sink { | 27 | namespace Sink { |
47 | 28 | ||