16
16
Boston, MA 02110-1301, USA.
19
#undef QT_USE_FAST_CONCATENATION
20
#undef QT_USE_FAST_OPERATOR_PLUS
19
23
#include <qtest_kde.h>
21
25
#include "utiltest.h"
22
26
#include "utiltest.moc"
24
28
#include <kmime_util.h>
29
#include <kmime_message.h>
26
31
using namespace KMime;
149
154
QCOMPARE( string, QString::fromLatin1( "\"John \\\"the hacker\\\" Smith\"" ) );
157
void UtilTest::testIsSigned_data()
159
QTest::addColumn<QByteArray>( "input" );
160
QTest::addColumn<bool>( "hasSignature" );
162
QTest::newRow( "pgp" ) << QByteArray(
163
"From: xxx xxx <xxx@xxx.xxx>\n"
164
"To: xxx xxx <xxx@xxx.xxx>\n"
166
"Date: Mon, 13 Dec 2010 12:22:03 +0100\n"
167
"MIME-Version: 1.0\n"
168
"Content-Type: multipart/signed;\n"
169
" boundary=\"nextPart1571960.gHxU0aGA9V\";\n"
170
" protocol=\"application/pgp-signature\";\n"
172
"Content-Transfer-Encoding: 7bit\n\n"
173
"--nextPart1571960.gHxU0aGA9V\n"
174
"Content-Type: text/plain;\n"
175
" charset=\"iso-8859-15\"\n"
176
"Content-Transfer-Encoding: quoted-printable\n"
177
"Content-Disposition: inline\n\n"
179
"--nextPart1571960.gHxU0aGA9V\n"
180
"Content-Type: application/pgp-signature; name=signature.asc\n"
181
"Content-Description: This is a digitally signed message part.\n\n"
182
"-----BEGIN PGP SIGNATURE-----\n"
183
"Version: GnuPG v2.0.15 (GNU/Linux)\n"
185
"-----END PGP SIGNATURE-----\n\n"
186
"--nextPart1571960.gHxU0aGA9V--\n"
190
void UtilTest::testIsSigned()
192
QFETCH( QByteArray, input );
193
QFETCH( bool, hasSignature );
195
KMime::Message::Ptr msg( new KMime::Message );
196
msg->setContent( input );
198
QCOMPARE( isSigned( msg.get() ), hasSignature );