File indexing completed on 2024-04-14 14:19:43

0001 /* This file is part of the KDE libraries
0002     Copyright (c) 2006 Peter Kümmel <syntheticpp@yahoo.com>
0003 
0004     This library is free software; you can redistribute it and/or
0005     modify it under the terms of the GNU Library General Public
0006     License version 2 as published by the Free Software Foundation.
0007 
0008     This library is distributed in the hope that it will be useful,
0009     but WITHOUT ANY WARRANTY; without even the implied warranty of
0010     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0011     Library General Public License for more details.
0012 
0013     You should have received a copy of the GNU Library General Public License
0014     along with this library; see the file COPYING.LIB.  If not, write to
0015     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0016     Boston, MA 02110-1301, USA.
0017 */
0018 
0019 #ifndef ksavefiletest_h
0020 #define ksavefiletest_h
0021 
0022 #include <QObject>
0023 #include <QStringList>
0024 #include <qtemporarydir.h>
0025 
0026 class KSaveFileTest : public QObject
0027 {
0028     Q_OBJECT
0029 
0030 private Q_SLOTS:
0031     void initTestCase();
0032     void test_ksavefile();
0033     void transactionalWriteNoPermissionsOnDir_data();
0034     void transactionalWriteNoPermissionsOnDir();
0035 
0036     void test_numberedBackupFile();
0037     void test_rcsBackupFile();
0038     void test_simpleBackupFile();
0039     void cleanupTestCase();
0040 
0041 private:
0042     QStringList filesToRemove;
0043 
0044     QTemporaryDir tmpDir; // destination for backups
0045     QString tmp;
0046 };
0047 
0048 #endif