testini.h
1 //------------------------------------------------------------------------------
2 // testini.h
3 //------------------------------------------------------------------------------
4 //
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.
9 //
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.
14 //
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
18 // 02110-1301, USA.
19 //
20 //------------------------------------------------------------------------------
21 // Copyright (C) 2010 "Zalewa" <zalewapl@gmail.com>
22 //------------------------------------------------------------------------------
23 #ifndef __TESTINI_H__
24 #define __TESTINI_H__
25 
26 #include "tests/testbase.h"
27 #include <QByteArray>
28 
30 {
31  public:
39  static QByteArray getExampleINI();
40 
44  static QByteArray getExampleError1();
45 };
46 
47 class TestReadINI : public TestUnitBase
48 {
49  public:
50  TestReadINI();
51 
52  bool executeTest();
53 };
54 
56 {
57  public:
59  : TestUnitBase("Read INI Variable")
60  {
61  }
62 
63  bool executeTest();
64 };
65 
67 {
68  public:
70  : TestUnitBase("Read INI List")
71  {
72  }
73 
74  bool executeTest();
75 
76  protected:
77  bool compareEntry(const QString& actual, const QString& expected);
78 };
79 
81 {
82  public:
84  : TestUnitBase("Delete INI Variable")
85  {
86  }
87 
88  bool executeTest();
89 };
90 
92 {
93  public:
95  : TestUnitBase("Delete INI Section")
96  {
97  }
98 
99  bool executeTest();
100 };
101 
103 {
104  public:
106  : TestUnitBase("Read INI file with errors")
107  {
108  }
109 
110  bool executeTest();
111 };
112 
113 #endif
Base class for Test Units.
Definition: testbase.h:42
static QByteArray getExampleINI()
Gets an INI file that is written in a format that is 100% supported by the Ini class.
Definition: testini.cpp:52
static QByteArray getExampleError1()
Ini class should detect errors in this example.
Definition: testini.cpp:57