kdecore: adjust tests to recent changes

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-03-27 06:20:57 +02:00
parent 1eaf3dab61
commit 318fa971d3
2 changed files with 9 additions and 6 deletions

View file

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

View file

@ -130,9 +130,12 @@ void KServiceTest::testByName()
QVERIFY( s0 ); QVERIFY( s0 );
QCOMPARE( s0->name(), QString::fromLatin1("KParts/ReadOnlyPart") ); QCOMPARE( s0->name(), QString::fromLatin1("KParts/ReadOnlyPart") );
KService::Ptr kfilemodule = KService::serviceByDesktopPath("kfilemodule.desktop"); KService::Ptr kfilemetadataplugin = KService::serviceByDesktopPath("kfilemetadata_epub.desktop");
QVERIFY(kfilemodule); if (kfilemetadataplugin) {
QCOMPARE( kfilemodule->name(), QString::fromLatin1("KFileModule")); QCOMPARE( kfilemetadataplugin->name(), QString::fromLatin1("KFileMetaDataEPubPlugin"));
} else {
qWarning("Skipping test for kfilemetadata_epub.desktop, not found. kdelibs not installed?");
}
} }
void KServiceTest::testProperty() void KServiceTest::testProperty()