mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 02:42:48 +00:00
kdecore: use QDir::exists() to check for directory existence from tests
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
246fa5b377
commit
38c049bb36
2 changed files with 7 additions and 6 deletions
|
@ -1573,21 +1573,22 @@ void KConfigTest::testNoKdeHome()
|
|||
const QString kdeHome = QDir::homePath() + "/.kde-unit-test-does-not-exist";
|
||||
setenv("KDEHOME", QFile::encodeName( kdeHome ), 1);
|
||||
KTempDir::removeDir(kdeHome);
|
||||
QVERIFY(!QFile::exists(kdeHome));
|
||||
QDir kdeDir(kdeHome);
|
||||
QVERIFY(!kdeDir.exists());
|
||||
|
||||
// Do what kde4-config does, and ensure kdehome doesn't get created (#233892)
|
||||
KComponentData componentData("KConfigTest");
|
||||
QVERIFY(!QFile::exists(kdeHome));
|
||||
QVERIFY(!kdeDir.exists());
|
||||
componentData.dirs();
|
||||
QVERIFY(!QFile::exists(kdeHome));
|
||||
QVERIFY(!kdeDir.exists());
|
||||
componentData.config();
|
||||
QVERIFY(!QFile::exists(kdeHome));
|
||||
QVERIFY(!kdeDir.exists());
|
||||
|
||||
// Now try to actually save something, see if it works.
|
||||
KConfigGroup group(componentData.config(), "Group");
|
||||
group.writeEntry("Key", "Value");
|
||||
group.sync();
|
||||
QVERIFY(QFile::exists(kdeHome));
|
||||
QVERIFY(kdeDir.exists());
|
||||
QVERIFY(QFile::exists(kdeHome + "/share/config/KConfigTestrc"));
|
||||
|
||||
// Cleanup
|
||||
|
|
|
@ -372,7 +372,7 @@ void KStandarddirsTest::testRestrictedResources()
|
|||
// Ensure we have a local share/apps/qttest dir
|
||||
const QString localDataDir = KStandardDirs::locateLocal("data", "qttest/");
|
||||
QVERIFY(!localDataDir.isEmpty());
|
||||
QVERIFY(QFile::exists(localDataDir));
|
||||
QVERIFY(QDir(localDataDir).exists());
|
||||
const QString localOtherDataDir = KStandardDirs::locateLocal("data", "other/");
|
||||
QVERIFY(!localOtherDataDir.isEmpty());
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue