File indexing completed on 2024-05-12 04:19:59

0001 /*
0002 Gwenview: an image viewer
0003 Copyright 2007 Aurélien Gâteau <agateau@kde.org>
0004 
0005 This program is free software; you can redistribute it and/or
0006 modify it under the terms of the GNU General Public License
0007 as published by the Free Software Foundation; either version 2
0008 of the License, or (at your option) any later version.
0009 
0010 This program is distributed in the hope that it will be useful,
0011 but WITHOUT ANY WARRANTY; without even the implied warranty of
0012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0013 GNU General Public License for more details.
0014 
0015 You should have received a copy of the GNU General Public License
0016 along with this program; if not, write to the Free Software
0017 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
0018 
0019 */
0020 #ifndef THUMBNAILPROVIDERTEST_H
0021 #define THUMBNAILPROVIDERTEST_H
0022 
0023 // Qt
0024 #include <QColor>
0025 #include <QHash>
0026 #include <QObject>
0027 #include <QSize>
0028 
0029 class SandBox
0030 {
0031 public:
0032     SandBox();
0033     void initDir();
0034     void fill();
0035     void createTestImage(const QString &name, int width, int height, const QColor &color);
0036     void copyTestImage(const QString &name, int width, int height);
0037 
0038     QHash<QString, QSize> mSizeHash;
0039     QString mPath;
0040 };
0041 
0042 class ThumbnailProviderTest : public QObject
0043 {
0044     Q_OBJECT
0045 
0046 private Q_SLOTS:
0047     void init();
0048     void initTestCase();
0049     void testLoadLocal();
0050     void testLoadRemote();
0051     void testUseEmbeddedOrNot();
0052     void testRemoveItemsWhileGenerating();
0053 
0054 private:
0055     SandBox mSandBox;
0056 };
0057 
0058 #endif // THUMBNAILPROVIDERTEST_H