Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
PIM Messagelib
Commits
58f7885f
Commit
58f7885f
authored
Jun 30, 2020
by
Laurent Montel
Browse files
Fix mem leak found by ASAN
parent
ee69e482
Changes
3
Hide whitespace changes
Inline
Side-by-side
messageviewer/src/messagepartthemes/default/autotests/showonlymimeparttest.cpp
View file @
58f7885f
...
...
@@ -63,7 +63,7 @@ void ShowOnlyMimePartTest::testDrawFrame()
QString
referenceFileName
(
QStringLiteral
(
MAIL_DATA_DIR
)
+
QLatin1Char
(
'/'
)
+
commonName
);
// load input mail
const
KMime
::
Message
::
Ptr
msg
(
Test
::
readAndParseMail
(
QStringLiteral
(
"frametest.mbox"
)));
KMime
::
Message
::
Ptr
msg
(
Test
::
readAndParseMail
(
QStringLiteral
(
"frametest.mbox"
)));
// render the mail
FileHtmlWriter
fileWriter
(
outFileName
);
...
...
@@ -85,6 +85,7 @@ void ShowOnlyMimePartTest::testDrawFrame()
fileWriter
.
end
();
Test
::
compareFile
(
outFileName
,
referenceFileName
);
msg
.
clear
();
}
void
ShowOnlyMimePartTest
::
testRelated_data
()
...
...
@@ -110,7 +111,7 @@ void ShowOnlyMimePartTest::testRelated()
QString
referenceFileName
(
QStringLiteral
(
MAIL_DATA_DIR
)
+
QLatin1Char
(
'/'
)
+
commonName
);
// load input mail
const
KMime
::
Message
::
Ptr
msg
(
Test
::
readAndParseMail
(
QStringLiteral
(
"html-multipart-related.mbox"
)));
KMime
::
Message
::
Ptr
msg
(
Test
::
readAndParseMail
(
QStringLiteral
(
"html-multipart-related.mbox"
)));
// render the mail
FileHtmlWriter
fileWriter
(
outFileName
);
...
...
@@ -132,6 +133,7 @@ void ShowOnlyMimePartTest::testRelated()
fileWriter
.
end
();
Test
::
compareFile
(
outFileName
,
referenceFileName
);
msg
.
clear
();
}
QTEST_MAIN
(
ShowOnlyMimePartTest
)
messageviewer/src/messagepartthemes/default/autotests/unencryptedmessagetest.cpp
View file @
58f7885f
...
...
@@ -80,6 +80,8 @@ void UnencryptedMessageTest::testNotDecrypted()
KMime
::
Message
::
Ptr
unencryptedMessage
=
nodeHelper
.
unencryptedMessage
(
originalMessage
);
QCOMPARE
((
bool
)
unencryptedMessage
,
false
);
originalMessage
.
clear
();
unencryptedMessage
.
clear
();
}
void
UnencryptedMessageTest
::
testSMimeAutoCertImport
()
...
...
@@ -99,4 +101,5 @@ void UnencryptedMessageTest::testSMimeAutoCertImport()
QCOMPARE
(
otp
.
plainTextContent
().
toLatin1
().
data
(),
""
);
QVERIFY
(
testWriter
.
data
().
contains
(
"Sorry, certificate could not be imported."
));
originalMessage
.
clear
();
}
templateparser/autotests/templateparserjobtest.cpp
View file @
58f7885f
...
...
@@ -374,7 +374,7 @@ void TemplateParserJobTest::test_forwardedAttachments()
QFile
referenceFile
(
referenceFileName
);
QVERIFY
(
referenceFile
.
open
(
QIODevice
::
ReadOnly
));
const
QByteArray
referenceRawData
=
KMime
::
CRLFtoLF
(
referenceFile
.
readAll
());
const
KMime
::
Message
::
Ptr
referenceMsg
(
new
KMime
::
Message
);
KMime
::
Message
::
Ptr
referenceMsg
(
new
KMime
::
Message
);
referenceMsg
->
setContent
(
referenceRawData
);
referenceMsg
->
parse
();
...
...
@@ -382,6 +382,7 @@ void TemplateParserJobTest::test_forwardedAttachments()
for
(
int
i
=
1
;
i
<
msg
->
contents
().
size
();
i
++
)
{
QCOMPARE
(
msg
->
contents
()[
i
]
->
encodedContent
(),
referenceMsg
->
contents
()[
i
]
->
encodedContent
());
}
referenceMsg
.
clear
();
}
else
{
QCOMPARE
(
msg
->
contents
().
size
(),
0
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment