Commit d31917f0 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix mem leak found by asan

parent 8db14966
Pipeline #24693 passed with stage
in 8 minutes and 8 seconds
......@@ -880,15 +880,15 @@ void ContentTest::testContentTypeMimetype()
QFETCH(QList<QByteArray> , contentMimeType);
// test parsing
Message *msg = new Message();
msg->setContent(data);
msg->parse();
Message msg;
msg.setContent(data);
msg.parse();
QEXPECT_FAIL("broken", "Problem with content type", Continue);
QCOMPARE(msg->contentType(false)->mimeType(), mimetype);
QCOMPARE(msg->contents().count(), contentCount);
for (int i = 0; i < msg->contents().count(); ++i) {
QVERIFY(msg->contents().at(i)->contentType(false));
QCOMPARE(msg.contentType(false)->mimeType(), mimetype);
QCOMPARE(msg.contents().count(), contentCount);
for (int i = 0; i < msg.contents().count(); ++i) {
QVERIFY(msg.contents().at(i)->contentType(false));
QCOMPARE(contentMimeType.count(), contentCount);
QCOMPARE(msg->contents().at(i)->contentType(false)->mimeType(), contentMimeType.at(i));
QCOMPARE(msg.contents().at(i)->contentType(false)->mimeType(), contentMimeType.at(i));
}
}
......@@ -572,11 +572,13 @@ void HeaderTest::testContentDispositionHeader()
"filename*9*=%D0%9F%D1%80%D0%BE%D0%B1%D0%B5%D0%BB%D0%BE%D0%B2%2E%74%78%74");
QCOMPARE(h->disposition(), CDattachment);
QCOMPARE(h->filename(), QString::fromUtf8("ЭтоВложениеСДлиннымИмемФайлаСовсемБезПробеловИЕщёРазЭтоВложениеСДлиннымИмемФайлаСовсемБезПробелов.txt"));
delete h;
h = new ContentDisposition;
h->from7BitString("attachment; filename*=UTF-8''%D0%AD%D1%82%D0%BE%D0%92%D0%BB%D0%BE%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5%D0%A1%D0%94%D0%BB%D0%B8%D0%BD%D0%BD%D1%8B%D0%BC%D0%98%D0%BC%D0%B5%D0%BC%D0%A4%D0%B0%D0%B9%D0%BB%D0%B0%D0%A1%D0%BE%D0%B2%D1%81%D0%B5%D0%BC%D0%91%D0%B5%D0%B7%D0%9F%D1%80%D0%BE%D0%B1%D0%B5%D0%BB%D0%BE%D0%B2%D0%98%D0%95%D1%89%D1%91%D0%A0%D0%B0%D0%B7%D0%AD%D1%82%D0%BE%D0%92%D0%BB%D0%BE%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5%D0%A1%D0%94%D0%BB%D0%B8%D0%BD%D0%BD%D1%8B%D0%BC%D0%98%D0%BC%D0%B5%D0%BC%D0%A4%D0%B0%D0%B9%D0%BB%D0%B0%D0%A1%D0%BE%D0%B2%D1%81%D0%B5%D0%BC%D0%91%D0%B5%D0%B7%D0%9F%D1%80%D0%BE%D0%B1%D0%B5%D0%BB%D0%BE%D0%B2%2Etxt");
QCOMPARE(h->disposition(), CDattachment);
QCOMPARE(h->filename(), QString::fromUtf8("ЭтоВложениеСДлиннымИмемФайлаСовсемБезПробеловИЕщёРазЭтоВложениеСДлиннымИмемФайлаСовсемБезПробелов.txt"));
delete h;
}
void HeaderTest::testContentTypeHeader()
......
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