compile
[kdegraphics.git] / gwenview / tests / documenttest.h
blobc6513112ab2fac53c2dd0fb2af8e0b00a98ff31e
1 /*
2 Gwenview: an image viewer
3 Copyright 2007 Aurélien Gâteau <aurelien.gateau@free.fr>
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef DOCUMENTTEST_H
21 #define DOCUMENTTEST_H
23 // Qt
24 #include <QObject>
26 // Local
27 #include "../lib/document/document.h"
29 class LoadingStateSpy : public QObject {
30 Q_OBJECT
31 public:
32 LoadingStateSpy(const Gwenview::Document::Ptr& doc)
33 : mDocument(doc)
34 , mCallCount(0)
38 public Q_SLOTS:
39 void readState() {
40 mCallCount++;
41 mState = mDocument->loadingState();
44 public:
45 Gwenview::Document::Ptr mDocument;
46 int mCallCount;
47 Gwenview::Document::LoadingState mState;
51 class DocumentTest : public QObject {
52 Q_OBJECT
54 private Q_SLOTS:
55 void testLoad();
56 void testLoad_data();
57 void testLoadTwoPasses();
58 void testLoadEmpty();
59 void testLoadDownSampled();
60 void testLoadDownSampled_data();
61 void testLoadDownSampledPng();
62 void testLoadRemote();
63 void testLoadAnimated();
64 void testDeleteWhileLoading();
65 void testLoadRotated();
66 void testMultipleLoads();
67 void testSave();
68 void testSaveRemote();
69 void testLosslessSave();
70 void testLosslessRotate();
71 void testModify();
72 void testMetaInfoJpeg();
73 void testMetaInfoBmp();
75 void initTestCase();
76 void init();
79 #endif // DOCUMENTTEST_H