File indexing completed on 2024-04-28 15:19:32

0001 /*  This file is part of the KDE libraries
0002     SPDX-FileCopyrightText: 1997 Matthias Kalle Dalheimer <kalle@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef KCONFIGTEST_H
0008 #define KCONFIGTEST_H
0009 
0010 #include <QObject>
0011 
0012 class KConfigTest : public QObject
0013 {
0014     Q_OBJECT
0015 
0016 public:
0017     enum Testing {
0018         Ones = 1,
0019         Tens = 10,
0020         Hundreds = 100,
0021     };
0022     Q_ENUM(Testing)
0023     enum bits {
0024         bit0 = 1,
0025         bit1 = 2,
0026         bit2 = 4,
0027         bit3 = 8,
0028     };
0029     Q_DECLARE_FLAGS(Flags, bits)
0030     Q_FLAG(Flags)
0031 
0032 private Q_SLOTS:
0033     void initTestCase();
0034     void cleanupTestCase();
0035     void testSimple();
0036     void testDefaults();
0037     void testLists();
0038     void testLocale();
0039     void testEncoding();
0040     void testPath();
0041     void testPathQtHome();
0042     void testPersistenceOfExpandFlagForPath();
0043     void testComplex();
0044     void testEnums();
0045     void testEntryMap();
0046     void testInvalid();
0047     void testDeleteEntry();
0048     void testDelete();
0049     void testDeleteWhenLocalized();
0050     void testDefaultGroup();
0051     void testEmptyGroup();
0052     void testCascadingWithLocale();
0053     void testMerge();
0054     void testImmutable();
0055     void testGroupEscape();
0056     void testRevertAllEntries();
0057     void testChangeGroup();
0058     void testGroupCopyTo();
0059     void testConfigCopyTo();
0060     void testConfigCopyToSync();
0061     void testReparent();
0062     void testAnonymousConfig();
0063     void testQByteArrayUtf8();
0064     void testQStringUtf8_data();
0065     void testQStringUtf8();
0066 
0067     void testMoveValuesTo();
0068 
0069     void testSubGroup();
0070     void testAddConfigSources();
0071     void testWriteOnSync();
0072     void testFailOnReadOnlyFileSync();
0073     void testDirtyOnEqual();
0074     void testDirtyOnEqualOverdo();
0075     void testCreateDir();
0076     void testSharedConfig();
0077     void testOptionOrder();
0078     void testLocaleConfig();
0079     void testDirtyAfterRevert();
0080     void testKdeGlobals();
0081     void testLocalDeletion();
0082     void testNewlines();
0083     void testXdgListEntry();
0084     void testNotify();
0085     void testNotifyIllegalObjectPath();
0086     void testKAuthorizeEnums();
0087 
0088     void testThreads();
0089 
0090     void testKdeglobalsVsDefault();
0091 
0092     // should be last
0093     void testSyncOnExit();
0094 
0095 private:
0096     QString m_testConfigDir;
0097     QString m_kdeGlobalsPath;
0098 };
0099 Q_DECLARE_OPERATORS_FOR_FLAGS(KConfigTest::Flags)
0100 
0101 #endif /* KCONFIGTEST_H */