Commit ef5c2024 authored by Elvis Angelaccio's avatar Elvis Angelaccio
Browse files

Try to fix ASAN's use-after-free crashes

This should fix the tests that fail on the CI because of ASAN.

GIT_SILENT
parent 491f1f78
......@@ -109,6 +109,7 @@ void AddTest::testAdding()
auto loadJob = Archive::load(archivePath);
QVERIFY(loadJob);
loadJob->setAutoDelete(false);
TestHelper::startAndWaitForResult(loadJob);
auto archive = loadJob->archive();
......@@ -131,6 +132,7 @@ void AddTest::testAdding()
QList<Archive::Entry*> resultedEntries = TestHelper::getEntryList(archive);
TestHelper::verifyAddedEntriesWithDestination(files, destination, oldEntries, resultedEntries);
loadJob->deleteLater();
archive->deleteLater();
}
......
......@@ -249,6 +249,7 @@ void AddToArchiveTest::testCompressHere()
QFETCH(QString, expectedArchiveName);
auto loadJob = Archive::load(QFINDTESTDATA(QStringLiteral("data/%1").arg(expectedArchiveName)));
QVERIFY(loadJob);
loadJob->setAutoDelete(false);
TestHelper::startAndWaitForResult(loadJob);
auto archive = loadJob->archive();
......@@ -267,6 +268,7 @@ void AddToArchiveTest::testCompressHere()
QVERIFY(QFile(archive->fileName()).remove());
loadJob->deleteLater();
archive->deleteLater();
}
......
......@@ -176,6 +176,7 @@ void CopyTest::testCopying()
auto loadJob = Archive::load(archivePath);
QVERIFY(loadJob);
loadJob->setAutoDelete(false);
TestHelper::startAndWaitForResult(loadJob);
auto archive = loadJob->archive();
......@@ -198,6 +199,7 @@ void CopyTest::testCopying()
QList<Archive::Entry*> resultedEntries = TestHelper::getEntryList(archive);
TestHelper::verifyCopiedEntriesWithDestination(files, destination, oldEntries, resultedEntries);
loadJob->deleteLater();
archive->deleteLater();
}
......
......@@ -196,9 +196,11 @@ void ExtractTest::testProperties()
QFETCH(QString, archivePath);
auto loadJob = Archive::load(archivePath, this);
QVERIFY(loadJob);
loadJob->setAutoDelete(false);
TestHelper::startAndWaitForResult(loadJob);
auto archive = loadJob->archive();
QVERIFY(archive);
if (!archive->isValid()) {
......@@ -235,6 +237,7 @@ void ExtractTest::testProperties()
QFETCH(QString, expectedSubfolderName);
QCOMPARE(archive->subfolderName(), expectedSubfolderName);
loadJob->deleteLater();
archive->deleteLater();
}
......
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