diff --git a/runners/locations/autotests/locationsrunnertest.cpp b/runners/locations/autotests/locationsrunnertest.cpp index 4a98d4eca..3aad807a5 100644 --- a/runners/locations/autotests/locationsrunnertest.cpp +++ b/runners/locations/autotests/locationsrunnertest.cpp @@ -52,7 +52,6 @@ void ConverterRunnerTest::initTestCase() } } QVERIFY(!normalHomeFile.isEmpty()); - QVERIFY(!executableHomeFile.isEmpty()); } void ConverterRunnerTest::shouldNotProduceResult() @@ -78,7 +77,9 @@ void ConverterRunnerTest::shouldNotProduceResult_data() QTest::newRow("executable name") << "ls"; QTest::newRow("executable file path") << "/bin/ls"; - QTest::newRow("executable file in home dir") << executableHomeFile; + if (!executableHomeFile.isEmpty()) { + QTest::newRow("executable file in home dir") << executableHomeFile; + } QTest::newRow("executable path and argument") << "/bin/ls -Al"; QTest::newRow("non existent file") << QDir::homePath() + "_thisfiledoesnotexist.abc"; QTest::newRow("non existent file URL") << QUrl::fromLocalFile(QDir::homePath() + "_thisfiledoesnotexist.abc").toString(); @@ -100,8 +101,9 @@ void ConverterRunnerTest::shouldProduceResult_data() QTest::newRow("file tilde") << KShell::tildeCollapse(normalHomeFile) << QVariant(QUrl::fromLocalFile(normalHomeFile)); QTest::newRow("file with $HOME as env variable") << KShell::tildeCollapse(normalHomeFile).replace("~", "$HOME") << QVariant(QUrl::fromLocalFile(normalHomeFile)); QTest::newRow("file URL") << QUrl::fromLocalFile(normalHomeFile).toString() << QVariant(QUrl::fromLocalFile(normalHomeFile)); - QTest::newRow("file URL to executable") << QUrl::fromLocalFile(executableHomeFile).toString() << QVariant(QUrl::fromLocalFile(executableHomeFile)); - + if (!executableHomeFile.isEmpty()) { + QTest::newRow("file URL to executable") << QUrl::fromLocalFile(executableHomeFile).toString() << QVariant(QUrl::fromLocalFile(executableHomeFile)); + } if (KProtocolInfo::isHelperProtocol("vnc")) { QTest::newRow("vnc URL") << "vnc:foo" << QVariant("vnc:foo"); }