Commit 9b819006 authored by Igor Kushnir's avatar Igor Kushnir
Browse files

VCS tests: remove unused *BaseDir2 variables

These directories were created and removed but never used.

PerforcePluginTest::removeTempDirsIfAny() attempted to remove
perforceTestBaseDir twice because of what was almost certainly a typo.
perforceTestBaseDir2 was supposed to be removed there, but it is better
to never create and never remove this unused directory.
parent 7af21c6c
......@@ -33,7 +33,6 @@ do { QVERIFY(j); QVERIFY(j->exec()); QVERIFY((j)->status() == KDevelop::VcsJob::
const QString tempDir = QDir::tempPath();
const QString bazaarTest_BaseDir(tempDir + "/kdevBazaar_testdir/");
const QString bazaarTest_BaseDir2(tempDir + "/kdevBazaar_testdir2/");
const QString bazaarRepo(bazaarTest_BaseDir + ".bzr");
const QString bazaarSrcDir(bazaarTest_BaseDir + "src/");
const QString bazaarTest_FileName(QStringLiteral("testfile"));
......@@ -63,7 +62,6 @@ void TestBazaar::init()
QDir tmpdir(tempDir);
tmpdir.mkdir(bazaarTest_BaseDir);
tmpdir.mkdir(bazaarSrcDir);
tmpdir.mkdir(bazaarTest_BaseDir2);
}
void TestBazaar::cleanup()
......@@ -339,10 +337,6 @@ void TestBazaar::removeTempDirs()
if (QFileInfo::exists(bazaarTest_BaseDir))
if (!(KIO::del(QUrl::fromLocalFile(bazaarTest_BaseDir))->exec()))
qDebug() << "KIO::del(" << bazaarTest_BaseDir << ") returned false";
if (QFileInfo::exists(bazaarTest_BaseDir2))
if (!(KIO::del(QUrl::fromLocalFile(bazaarTest_BaseDir2))->exec()))
qDebug() << "KIO::del(" << bazaarTest_BaseDir2 << ") returned false";
}
QTEST_MAIN(TestBazaar)
......@@ -25,7 +25,6 @@ do { QVERIFY(j); QVERIFY(j->exec()); QVERIFY((j)->status() == KDevelop::VcsJob::
inline QString tempDir() { return QDir::tempPath(); }
inline QString gitTest_BaseDir() { return tempDir() + "/kdevGit_testdir/"; }
inline QString gitTest_BaseDir2() { return tempDir() + "/kdevGit_testdir2/"; }
inline QString gitRepo() { return gitTest_BaseDir() + ".git"; }
inline QString gitSrcDir() { return gitTest_BaseDir() + "src/"; }
inline QString gitTest_FileName() { return QStringLiteral("testfile"); }
......@@ -69,7 +68,6 @@ void GitInitTest::init()
QDir tmpdir(tempDir());
tmpdir.mkdir(gitTest_BaseDir());
tmpdir.mkdir(gitSrcDir());
tmpdir.mkdir(gitTest_BaseDir2());
}
void GitInitTest::cleanup()
......@@ -542,11 +540,10 @@ void GitInitTest::testRemoveFolderContainingUnversionedFiles()
void GitInitTest::removeTempDirs()
{
for (const auto& dirPath : {gitTest_BaseDir(), gitTest_BaseDir2()}) {
QDir dir(dirPath);
if (dir.exists() && !dir.removeRecursively()) {
qDebug() << "QDir::removeRecursively(" << dirPath << ") returned false";
}
const auto dirPath = gitTest_BaseDir();
QDir dir(dirPath);
if (dir.exists() && !dir.removeRecursively()) {
qDebug() << "QDir::removeRecursively(" << dirPath << ") returned false";
}
}
......
......@@ -28,7 +28,6 @@
const QString tempDir = QDir::tempPath();
const QString perforceTestBaseDirNoSlash(tempDir + "/kdevPerforce_testdir");
const QString perforceTestBaseDir(tempDir + "/kdevPerforce_testdir/");
const QString perforceTestBaseDir2(tempDir + "/kdevPerforce_testdir2/");
const QString perforceConfigFileName(QStringLiteral("p4config.txt"));
const QString perforceSrcDir(perforceTestBaseDir + "src/");
......@@ -94,9 +93,7 @@ void PerforcePluginTest::createNewTempDirs()
}
g.close();
tmpdir.mkdir(perforceSrcDir);
tmpdir.mkdir(perforceTestBaseDir2);
}
......@@ -105,10 +102,6 @@ void PerforcePluginTest::removeTempDirsIfAny()
QDir dir(perforceTestBaseDir);
if (dir.exists() && !dir.removeRecursively())
qDebug() << "QDir::removeRecursively(" << perforceTestBaseDir << ") returned false";
QDir dir2(perforceTestBaseDir);
if (dir2.exists() && !dir2.removeRecursively())
qDebug() << "QDir::removeRecursively(" << perforceTestBaseDir2 << ") returned false";
}
......
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