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 /examples/imapresource/tests/imapserverproxytest.cpp | |
parent | 9d727c366ed709fd15d2358800f57e927fd18ed2 (diff) | |
download | sink-3ae86373f2238bcd771392f329b52d7b8923d003.tar.gz sink-3ae86373f2238bcd771392f329b52d7b8923d003.zip |
Central place for test macros
Diffstat (limited to 'examples/imapresource/tests/imapserverproxytest.cpp')
-rw-r--r-- | examples/imapresource/tests/imapserverproxytest.cpp | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/examples/imapresource/tests/imapserverproxytest.cpp b/examples/imapresource/tests/imapserverproxytest.cpp index 3761dac..e32298c 100644 --- a/examples/imapresource/tests/imapserverproxytest.cpp +++ b/examples/imapresource/tests/imapserverproxytest.cpp | |||
@@ -7,34 +7,7 @@ | |||
7 | 7 | ||
8 | #include "log.h" | 8 | #include "log.h" |
9 | #include "test.h" | 9 | #include "test.h" |
10 | 10 | #include "tests/testutils.h" | |
11 | #define ASYNCCOMPARE(actual, expected) \ | ||
12 | do {\ | ||
13 | if (!QTest::qCompare(actual, expected, #actual, #expected, __FILE__, __LINE__))\ | ||
14 | return KAsync::error<void>(1, "Comparison failed.");\ | ||
15 | } while (0) | ||
16 | |||
17 | #define ASYNCVERIFY(statement) \ | ||
18 | do {\ | ||
19 | if (!QTest::qVerify((statement), #statement, "", __FILE__, __LINE__))\ | ||
20 | return KAsync::error<void>(1, "Verify failed.");\ | ||
21 | } while (0) | ||
22 | |||
23 | #define VERIFYEXEC(statement) \ | ||
24 | do {\ | ||
25 | auto result = statement.exec(); \ | ||
26 | result.waitForFinished(); \ | ||
27 | if (!QTest::qVerify(!result.errorCode(), #statement, "", __FILE__, __LINE__))\ | ||
28 | return;\ | ||
29 | } while (0) | ||
30 | |||
31 | #define VERIFYEXEC_FAIL(statement) \ | ||
32 | do {\ | ||
33 | auto result = statement.exec(); \ | ||
34 | result.waitForFinished(); \ | ||
35 | if (!QTest::qVerify(result.errorCode(), #statement, "", __FILE__, __LINE__))\ | ||
36 | return;\ | ||
37 | } while (0) | ||
38 | 11 | ||
39 | using namespace Imap; | 12 | using namespace Imap; |
40 | 13 | ||