generic: fix and adjust some tests

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-04-11 02:03:54 +03:00
parent fba93fc80f
commit b4f3b51382
3 changed files with 7 additions and 7 deletions

View file

@ -105,15 +105,15 @@ void KDesktopFileTest::testActionGroup()
void KDesktopFileTest::testIsAuthorizedDesktopFile()
{
const QString fileName = QFile::decodeName(KDESRCDIR "../../kioslave/http/http_cache_cleaner.desktop");
const QString fileName = QFile::decodeName(KDESRCDIR "../../kfile/kfilemodule.desktop");
QVERIFY(QFile::exists(fileName));
QVERIFY(!KDesktopFile::isAuthorizedDesktopFile(fileName));
const QString installedFile = KGlobal::dirs()->locate("services", "http_cache_cleaner.desktop");
const QString installedFile = KGlobal::dirs()->locate("services", "kfilemodule.desktop");
if (!installedFile.isEmpty()) {
QVERIFY(KDesktopFile::isAuthorizedDesktopFile(installedFile));
} else {
qWarning("Skipping test for http_cache_cleaner.desktop, not found. kdelibs not installed?");
qWarning("Skipping test for kfilemodule.desktop, not found. kdelibs not installed?");
}
const QString autostartFile = KStandardDirs::locate("autostart", "plasma-desktop.desktop");

View file

@ -386,13 +386,13 @@ private Q_SLOTS:
void testRemovedImplicitAssociation178560()
{
// #178560: Removing ark from interface/x-winamp-skin didn't work
// Using application/x-kns (another zip-derived mimetype) nowadays.
const QString mime = "application/x-kns";
// Using application/vnd.comicbook+zip (another zip-derived mimetype) nowadays.
const QString mime = "application/vnd.comicbook+zip";
KService::List offers = KMimeTypeTrader::self()->query(mime);
QVERIFY(offerListHasService(offers, fakeArkApplication, true));
writeToMimeApps(QByteArray("[Removed Associations]\n"
"application/x-kns=fakearkapplication.desktop;\n"));
"application/vnd.comicbook+zip=fakearkapplication.desktop;\n"));
offers = KMimeTypeTrader::self()->query(mime);
QVERIFY(!offerListHasService(offers, fakeArkApplication, false));

View file

@ -27,7 +27,7 @@ KFILE_EXECUTABLE_TESTS(
)
add_definitions(
-DTEST_DATA="\\"${CMAKE_SOURCE_DIR}/solid/solid/backends/fakehw/fakecomputer.xml\\""
-DTEST_DATA="${CMAKE_SOURCE_DIR}/solid/solid/backends/fakehw/fakecomputer.xml"
)
KFILE_UNIT_TESTS(