Commit 79612a3d authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

create class on stack

parent 0171abad
...@@ -94,8 +94,8 @@ void ComposerTest::testAutoSave() ...@@ -94,8 +94,8 @@ void ComposerTest::testAutoSave()
void ComposerTest::testNonAsciiHeaders() void ComposerTest::testNonAsciiHeaders()
{ {
Composer *composer = new Composer; Composer composer;
fillComposerData(composer); fillComposerData(&composer);
const QString mailbox = QStringLiteral(" <bla@example.com>"); const QString mailbox = QStringLiteral(" <bla@example.com>");
const QString fromDisplayName = QStringLiteral("Hellö"); const QString fromDisplayName = QStringLiteral("Hellö");
...@@ -109,15 +109,15 @@ void ComposerTest::testNonAsciiHeaders() ...@@ -109,15 +109,15 @@ void ComposerTest::testNonAsciiHeaders()
const QString bcc = bccDisplayName + mailbox; const QString bcc = bccDisplayName + mailbox;
const QStringList replyto = QStringList{replyToDisplayName + mailbox}; const QStringList replyto = QStringList{replyToDisplayName + mailbox};
composer->infoPart()->setFrom(from); composer.infoPart()->setFrom(from);
composer->infoPart()->setTo(QStringList() << to); composer.infoPart()->setTo(QStringList() << to);
composer->infoPart()->setCc(QStringList() << cc); composer.infoPart()->setCc(QStringList() << cc);
composer->infoPart()->setBcc(QStringList() << bcc); composer.infoPart()->setBcc(QStringList() << bcc);
composer->infoPart()->setReplyTo(replyto); composer.infoPart()->setReplyTo(replyto);
QVERIFY(composer->exec()); QVERIFY(composer.exec());
QCOMPARE(composer->resultMessages().size(), 1); QCOMPARE(composer.resultMessages().size(), 1);
const KMime::Message::Ptr message = composer->resultMessages().constFirst(); const KMime::Message::Ptr message = composer.resultMessages().constFirst();
message->assemble(); message->assemble();
message->parse(); message->parse();
QCOMPARE(message->bcc(false)->displayNames().size(), 1); QCOMPARE(message->bcc(false)->displayNames().size(), 1);
...@@ -131,8 +131,6 @@ void ComposerTest::testNonAsciiHeaders() ...@@ -131,8 +131,6 @@ void ComposerTest::testNonAsciiHeaders()
QCOMPARE(message->bcc()->displayNames().constFirst(), bccDisplayName); QCOMPARE(message->bcc()->displayNames().constFirst(), bccDisplayName);
QCOMPARE(message->replyTo()->displayNames().constFirst(), replyToDisplayName); QCOMPARE(message->replyTo()->displayNames().constFirst(), replyToDisplayName);
message->clear(); message->clear();
delete composer;
composer = nullptr;
} }
void ComposerTest::testBug271192() void ComposerTest::testBug271192()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment