File indexing completed on 2024-04-21 15:03:05

0001 /*
0002     SPDX-FileCopyrightText: 2006 David Faure <faure@kde.org>
0003     SPDX-FileCopyrightText: 2022 Harald Sitter <sitter@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-only
0006 */
0007 #ifndef KSERVICETEST_H
0008 #define KSERVICETEST_H
0009 
0010 #include <kservice_export.h>
0011 
0012 #include <QAtomicInt>
0013 #include <QObject>
0014 
0015 class KServiceTest : public QObject
0016 {
0017     Q_OBJECT
0018 public:
0019     KServiceTest()
0020         : m_sycocaUpdateDone(0)
0021     {
0022     }
0023 private Q_SLOTS:
0024     void initTestCase();
0025 #if KSERVICE_BUILD_DEPRECATED_SINCE(5, 0)
0026     void testKPluginMetaData();
0027 #endif
0028     void cleanupTestCase();
0029     void testByName();
0030     void testConstructorFullPath();
0031     void testConstructorKDesktopFileFullPath();
0032     void testConstructorKDesktopFile();
0033     void testCopyConstructor();
0034     void testCopyInvalidService();
0035     void testProperty();
0036     void testAllServiceTypes();
0037     void testAllServices();
0038 #if KSERVICE_BUILD_DEPRECATED_SINCE(5, 90)
0039     void testServiceTypeTraderForReadOnlyPart();
0040     void testTraderConstraints();
0041 #endif
0042     void testSubseqConstraints();
0043 #if KSERVICE_BUILD_DEPRECATED_SINCE(5, 104)
0044     void testHasServiceType1();
0045     void testHasServiceType2();
0046 #endif
0047 #if KSERVICE_BUILD_DEPRECATED_SINCE(5, 66)
0048     void testWriteServiceTypeProfile();
0049 #endif
0050 #if KSERVICE_BUILD_DEPRECATED_SINCE(5, 90)
0051     void testDefaultOffers();
0052 #endif
0053 #if KSERVICE_BUILD_DEPRECATED_SINCE(5, 66)
0054     void testDeleteServiceTypeProfile();
0055 #endif
0056     void testDBUSStartupType();
0057     void testByStorageId();
0058     void testActionsAndDataStream();
0059     void testServiceGroups();
0060     void testDeletingService();
0061     void testReaderThreads();
0062     void testThreads();
0063 #if KSERVICE_BUILD_DEPRECATED_SINCE(5, 86)
0064     void testOperatorKPluginName();
0065 #endif
0066 #if KSERVICE_BUILD_DEPRECATED_SINCE(5, 90)
0067     void testKPluginInfoQuery();
0068 #endif
0069     void testCompleteBaseName();
0070     void testEntryPathToName();
0071     void testMimeType();
0072     void testProtocols();
0073 
0074 #if KSERVICE_BUILD_DEPRECATED_SINCE(5, 90)
0075     void testTraderQueryMustRebuildSycoca();
0076 #endif
0077 
0078     void testAliasFor();
0079     void testServiceActionService();
0080 
0081 private:
0082     void createFakeService(const QString &filenameSuffix, const QString &serviceType);
0083     void runKBuildSycoca(bool noincremental = false);
0084 
0085     QString m_firstOffer;
0086     bool m_hasKde5Konsole;
0087     QAtomicInt m_sycocaUpdateDone;
0088     bool m_hasNonCLocale;
0089 };
0090 
0091 #endif