diff options
author | Sandro Knauß <sknauss@kde.org> | 2016-07-18 15:35:07 +0200 |
---|---|---|
committer | Sandro Knauß <sknauss@kde.org> | 2016-07-19 09:26:49 +0200 |
commit | 2fdddd2f795da4645dc9a48fee4865324143a21b (patch) | |
tree | e4127945653e9ead83d3cf7eab9ed507bbeb8470 /framework/domain/mimetreeparser/tests/interfacetest.cpp | |
parent | 7815e94c52d092701804521eee850ac35d7f7781 (diff) | |
download | kube-2fdddd2f795da4645dc9a48fee4865324143a21b.tar.gz kube-2fdddd2f795da4645dc9a48fee4865324143a21b.zip |
first tests with mimetreeparser interface
Diffstat (limited to 'framework/domain/mimetreeparser/tests/interfacetest.cpp')
-rw-r--r-- | framework/domain/mimetreeparser/tests/interfacetest.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/framework/domain/mimetreeparser/tests/interfacetest.cpp b/framework/domain/mimetreeparser/tests/interfacetest.cpp new file mode 100644 index 00000000..1e8c5302 --- /dev/null +++ b/framework/domain/mimetreeparser/tests/interfacetest.cpp | |||
@@ -0,0 +1,47 @@ | |||
1 | /* | ||
2 | Copyright (c) 2016 Sandro Knauß <knauss@kolabsystems.com> | ||
3 | |||
4 | This library is free software; you can redistribute it and/or modify it | ||
5 | under the terms of the GNU Library General Public License as published by | ||
6 | the Free Software Foundation; either version 2 of the License, or (at your | ||
7 | option) any later version. | ||
8 | |||
9 | This library is distributed in the hope that it will be useful, but WITHOUT | ||
10 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public | ||
12 | License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU Library General Public License | ||
15 | along with this library; see the file COPYING.LIB. If not, write to the | ||
16 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
17 | 02110-1301, USA. | ||
18 | */ | ||
19 | |||
20 | #include "interface.h" | ||
21 | |||
22 | #include <QTest> | ||
23 | |||
24 | QByteArray readMailFromFile(const QString &mailFile) | ||
25 | { | ||
26 | QFile file(QLatin1String(MAIL_DATA_DIR) + QLatin1Char('/') + mailFile); | ||
27 | file.open(QIODevice::ReadOnly); | ||
28 | Q_ASSERT(file.isOpen()); | ||
29 | return file.readAll(); | ||
30 | } | ||
31 | |||
32 | |||
33 | class InterfaceTest : public QObject | ||
34 | { | ||
35 | Q_OBJECT | ||
36 | private slots: | ||
37 | |||
38 | void testTextMail() | ||
39 | { | ||
40 | Parser parser(readMailFromFile("plaintext.mbox")); | ||
41 | auto contentPart = parser.collectContentPart(); | ||
42 | //QVERIFY((bool)contentPart); | ||
43 | } | ||
44 | }; | ||
45 | |||
46 | QTEST_GUILESS_MAIN(InterfaceTest) | ||
47 | #include "interfacetest.moc" \ No newline at end of file | ||