~ubuntu-branches/ubuntu/saucy/digikam/saucy

« back to all changes in this revision

Viewing changes to tests/statesavingobjecttest.h

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-12-21 23:19:11 UTC
  • mfrom: (1.2.33 upstream) (3.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20101221231911-z9jip7s5aht1jqn9
Tags: 2:1.7.0-1ubuntu1
* Merge from Debian Experimental. Remaining Ubuntu changes:
  - Export .pot name and copy to plugins in debian/rules
  - Version build-depends on kipi-plugins-dev to ensure build is against the
    same version on all archs
* Drop debian/patches/kubuntu_01_linker.diff, incoporated upstream
* Remove patches directory and unused patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ============================================================
 
2
 *
 
3
 * This file is a part of digiKam project
 
4
 * http://www.digikam.org
 
5
 *
 
6
 * Date        : 2009-12-23
 
7
 * Description : a test for the StateSavingObject class
 
8
 *
 
9
 * Copyright (C) 2009 by Johannes Wienke <languitar at semipol dot de>
 
10
 *
 
11
 * This program is free software; you can redistribute it
 
12
 * and/or modify it under the terms of the GNU General
 
13
 * Public License as published by the Free Software Foundation;
 
14
 * either version 2, or (at your option)
 
15
 * any later version.
 
16
 *
 
17
 * This program is distributed in the hope that it will be useful,
 
18
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
19
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
20
 * GNU General Public License for more details.
 
21
 *
 
22
 * ============================================================ */
 
23
 
 
24
#ifndef STATESAVINGOBJECTTEST_H
 
25
#define STATESAVINGOBJECTTEST_H
 
26
 
 
27
// Qt includes
 
28
 
 
29
#include <QtTest/QtTest>
 
30
 
 
31
// Local includes
 
32
 
 
33
#include "statesavingobject.h"
 
34
 
 
35
class KConfigGroup;
 
36
 
 
37
class StateSavingObjectTest: public QObject
 
38
{
 
39
    Q_OBJECT
 
40
 
 
41
private Q_SLOTS:
 
42
 
 
43
    void testGroupName();
 
44
    void testPrefixUsage();
 
45
    void testDirectCalling();
 
46
    void testDirectChildrenLoading();
 
47
    void testDirectChildrenSaving();
 
48
    void testRecursiveChildrenLoading();
 
49
    void testRecursiveChildrenSaving();
 
50
 
 
51
};
 
52
 
 
53
class StubStateSaverPriv;
 
54
class StubStateSaver: public QObject, public Digikam::StateSavingObject
 
55
{
 
56
    Q_OBJECT
 
57
public:
 
58
    StubStateSaver(QObject* parent = 0);
 
59
    virtual ~StubStateSaver();
 
60
 
 
61
    KConfigGroup getGroup();
 
62
    QString getEntryKey(const QString& base);
 
63
 
 
64
    void doLoadState();
 
65
    void doSaveState();
 
66
 
 
67
    bool loadCalled();
 
68
    bool saveCalled();
 
69
 
 
70
    unsigned int numLoadCalls();
 
71
    unsigned int numSaveCalls();
 
72
 
 
73
private:
 
74
    StubStateSaverPriv* d;
 
75
 
 
76
};
 
77
 
 
78
#endif /* STATESAVINGOBJECTTEST_H */