From a1dcaf788ee48b70e6937962e6fc00a148d89bc5 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Wed, 7 May 2014 02:23:47 +0200 Subject: Fix unit tests after renaming the test executables now use QCoreApplication::applicationName() + "rc" as the config file name instead of hardcoding the named --- autotests/kconfignokdehometest.cpp | 5 +++-- autotests/ksharedconfigtest.cpp | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/autotests/kconfignokdehometest.cpp b/autotests/kconfignokdehometest.cpp index 4ee17635..d9712ee1 100644 --- a/autotests/kconfignokdehometest.cpp +++ b/autotests/kconfignokdehometest.cpp @@ -39,7 +39,7 @@ void KConfigNoKdeHomeTest::testNoKdeHome() QStandardPaths::setTestModeEnabled(true); QString configPath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation); QDir configDir(configPath); - configDir.removeRecursively(); + QVERIFY(configDir.removeRecursively()); QVERIFY(!QFile::exists(configPath)); // Do what kf5-config does, and ensure the config directory doesn't get created (#233892) @@ -52,7 +52,8 @@ void KConfigNoKdeHomeTest::testNoKdeHome() group.writeEntry("Key", "Value"); group.sync(); QVERIFY(QFile::exists(configPath)); - QVERIFY(QFile::exists(configPath + QStringLiteral("/kconfignokdehometestrc"))); + const QString rcFile = QCoreApplication::applicationName() + QStringLiteral("rc"); + QVERIFY(QFile::exists(configPath + QLatin1Char('/') + rcFile)); // Cleanup configDir.removeRecursively(); diff --git a/autotests/ksharedconfigtest.cpp b/autotests/ksharedconfigtest.cpp index 165322a3..c22623b4 100644 --- a/autotests/ksharedconfigtest.cpp +++ b/autotests/ksharedconfigtest.cpp @@ -38,7 +38,8 @@ void KSharedConfigTest::initTestCase() { QStandardPaths::enableTestMode(true); - m_path = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + "/ksharedconfigtestrc"; + m_path = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + + QLatin1Char('/') + QCoreApplication::applicationName() + QStringLiteral("rc"); QFile::remove(m_path); } -- cgit v1.2.1