Commit 7ee1c5db authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix mem leak found by asan

parent 102fc73e
Pipeline #24744 passed with stage
in 33 minutes
......@@ -36,34 +36,37 @@ void FilterBalsaMailTest::shouldImportData()
void FilterBalsaMailTest::canNotImportDataEmptyPath()
{
MailImporter::FilterBalsa filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QString());
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
void FilterBalsaMailTest::canNotImportDataUnknowPath()
{
MailImporter::FilterBalsa filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QStringLiteral("/foo/kde/bla/toto/"));
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
void FilterBalsaMailTest::canNotImportDataWhenHomeDirSelected()
{
MailImporter::FilterBalsa filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QDir::homePath());
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
QTEST_MAIN(FilterBalsaMailTest)
......@@ -36,34 +36,37 @@ void FilterClawsMailTest::shouldImportData()
void FilterClawsMailTest::canNotImportDataEmptyPath()
{
MailImporter::FilterClawsMail filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QString());
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
void FilterClawsMailTest::canNotImportDataUnknowPath()
{
MailImporter::FilterClawsMail filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QStringLiteral("/foo/kde/bla/toto/"));
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
void FilterClawsMailTest::canNotImportDataWhenHomeDirSelected()
{
MailImporter::FilterClawsMail filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QDir::homePath());
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
QTEST_MAIN(FilterClawsMailTest)
......@@ -55,34 +55,37 @@ void FilterIcedoveTest::shouldImportData()
void FilterIcedoveTest::canNotImportDataEmptyPath()
{
MailImporter::FilterIcedove filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QString());
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
void FilterIcedoveTest::canNotImportDataUnknowPath()
{
MailImporter::FilterIcedove filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QStringLiteral("/foo/kde/bla/toto/"));
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
void FilterIcedoveTest::canNotImportDataWhenHomeDirSelected()
{
MailImporter::FilterIcedove filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QDir::homePath());
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
QTEST_MAIN(FilterIcedoveTest)
......@@ -36,24 +36,26 @@ void FilterLnotesTest::shouldImportData()
void FilterLnotesTest::canNotImportDataEmptyPath()
{
MailImporter::FilterLNotes filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
//TODO implement it
//filter.importMail(QString());
//QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
void FilterLnotesTest::canNotImportDataUnknowPath()
{
MailImporter::FilterLNotes filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
//filter.importMails(QStringLiteral("/foo/kde/bla/toto/"));
//QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
QTEST_MAIN(FilterLnotesTest)
......@@ -36,23 +36,25 @@ void FilterMailAppTest::shouldImportData()
void FilterMailAppTest::canNotImportDataEmptyPath()
{
MailImporter::FilterMailApp filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QString());
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
void FilterMailAppTest::canNotImportDataUnknowPath()
{
MailImporter::FilterMailApp filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QStringLiteral("/foo/kde/bla/toto/"));
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
QTEST_MAIN(FilterMailAppTest)
......@@ -36,12 +36,13 @@ void FilterMAilmangzipTest::shouldImportData()
void FilterMAilmangzipTest::canNotImportDataEmptyPath()
{
MailImporter::FilterMailmanGzip filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QStringList());
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
void FilterMAilmangzipTest::canNotImportDataUnknowPath()
......
......@@ -36,23 +36,25 @@ void FilterMBoxTest::shouldImportData()
void FilterMBoxTest::canNotImportDataEmptyPath()
{
MailImporter::FilterMBox filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QStringList());
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
void FilterMBoxTest::canNotImportDataUnknowPath()
{
MailImporter::FilterMBox filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QStringList() << QStringLiteral("/foo/kde/bla/toto/"));
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
QTEST_MAIN(FilterMBoxTest)
......@@ -36,23 +36,25 @@ void FilterPlainTest::shouldImportData()
void FilterPlainTest::canNotImportDataEmptyPath()
{
MailImporter::FilterPlain filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QString());
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
void FilterPlainTest::canNotImportDataUnknowPath()
{
MailImporter::FilterPlain filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QStringLiteral("/foo/kde/bla/toto/"));
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
QTEST_MAIN(FilterPlainTest)
......@@ -37,34 +37,37 @@ void FilterSylpheedTest::shouldImportData()
void FilterSylpheedTest::canNotImportDataEmptyPath()
{
MailImporter::FilterSylpheed filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QString());
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
void FilterSylpheedTest::canNotImportDataUnknowPath()
{
MailImporter::FilterSylpheed filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QStringLiteral("/foo/kde/bla/toto/"));
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
void FilterSylpheedTest::canNotImportDataWhenHomeDirSelected()
{
MailImporter::FilterSylpheed filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QDir::homePath());
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
QTEST_MAIN(FilterSylpheedTest)
......@@ -36,34 +36,37 @@ void FilterTheBatTest::shouldImportData()
void FilterTheBatTest::canNotImportDataEmptyPath()
{
MailImporter::FilterTheBat filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QString());
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
void FilterTheBatTest::canNotImportDataUnknowPath()
{
MailImporter::FilterTheBat filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QStringLiteral("/foo/kde/bla/toto/"));
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
void FilterTheBatTest::canNotImportDataWhenHomeDirSelected()
{
MailImporter::FilterTheBat filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QDir::homePath());
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
QTEST_MAIN(FilterTheBatTest)
......@@ -55,34 +55,37 @@ void FilterThunderBirdTest::shouldImportData()
void FilterThunderBirdTest::canNotImportDataEmptyPath()
{
MailImporter::FilterThunderbird filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QString());
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
void FilterThunderBirdTest::canNotImportDataUnknowPath()
{
MailImporter::FilterThunderbird filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QStringLiteral("/foo/kde/bla/toto/"));
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
void FilterThunderBirdTest::canNotImportDataWhenHomeDirSelected()
{
MailImporter::FilterThunderbird filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QDir::homePath());
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
QTEST_MAIN(FilterThunderBirdTest)
......@@ -36,34 +36,37 @@ void FilterBalsaMailTest::shouldImportData()
void FilterBalsaMailTest::canNotImportDataEmptyPath()
{
MailImporter::FilterBalsa filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QString());
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
void FilterBalsaMailTest::canNotImportDataUnknowPath()
{
MailImporter::FilterBalsa filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QStringLiteral("/foo/kde/bla/toto/"));
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
void FilterBalsaMailTest::canNotImportDataWhenHomeDirSelected()
{
MailImporter::FilterBalsa filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QDir::homePath());
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
QTEST_MAIN(FilterBalsaMailTest)
......@@ -36,34 +36,37 @@ void FilterClawsMailTest::shouldImportData()
void FilterClawsMailTest::canNotImportDataEmptyPath()
{
MailImporter::FilterClawsMail filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QString());
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
void FilterClawsMailTest::canNotImportDataUnknowPath()
{
MailImporter::FilterClawsMail filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QStringLiteral("/foo/kde/bla/toto/"));
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
void FilterClawsMailTest::canNotImportDataWhenHomeDirSelected()
{
MailImporter::FilterClawsMail filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QDir::homePath());
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
QTEST_MAIN(FilterClawsMailTest)
......@@ -55,34 +55,37 @@ void FilterIcedoveTest::shouldImportData()
void FilterIcedoveTest::canNotImportDataEmptyPath()
{
MailImporter::FilterIcedove filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QString());
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
void FilterIcedoveTest::canNotImportDataUnknowPath()
{
MailImporter::FilterIcedove filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QStringLiteral("/foo/kde/bla/toto/"));
QVERIFY(importerTest->filterImporterDataList().isEmpty());
delete importerTest;
}
void FilterIcedoveTest::canNotImportDataWhenHomeDirSelected()
{
MailImporter::FilterIcedove filter;
MailImporter::FilterInfo *info = new MailImporter::FilterInfo;
FilterImporterTest *importerTest = new FilterImporterTest(info);
MailImporter::FilterInfo info;
FilterImporterTest *importerTest = new FilterImporterTest(&info);
filter.setFilterImporter(importerTest);
filter.setFilterInfo(info);
filter.setFilterInfo(&info);
filter.importMails(QDir::homePath());