File indexing completed on 2024-04-28 04:57:44
0001 /* This file is part of the KDE project 0002 SPDX-FileCopyrightText: 2007 David Faure <faure@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef TESTKIOARCHIVE_H 0008 #define TESTKIOARCHIVE_H 0009 0010 #include <KIO/Job> 0011 #include <KIO/UDSEntry> 0012 0013 #include <QObject> 0014 #include <QUrl> 0015 0016 /** 0017 * This is a unit test for kio_archive 0018 * See also kdelibs/kio/tests/karchivetest for lower-level KTar and KZip tests. 0019 */ 0020 class TestKioArchive : public QObject 0021 { 0022 Q_OBJECT 0023 0024 public: 0025 TestKioArchive() 0026 { 0027 } 0028 0029 private Q_SLOTS: 0030 void initTestCase(); 0031 void testListTar(); 0032 void testListRecursive(); 0033 void testExtractFileFromTar(); 0034 void testExtractSymlinkFromTar(); 0035 void cleanupTestCase(); 0036 0037 protected Q_SLOTS: // real slots, not tests 0038 void slotEntries(KIO::Job *, const KIO::UDSEntryList &lst); 0039 0040 private: 0041 QString tmpDir() const; 0042 QUrl tarUrl() const; 0043 void copyFromTar(const QUrl &url, const QString &destPath); 0044 0045 QStringList m_listResult; 0046 }; 0047 0048 #endif