IntelliPhoto 0.7

mainUnitTest.cpp
Go to the documentation of this file.
1 #include <QtTest>
2 // add necessary includes here
3 #include <string>
4
5 #include "GUI/IntelliPhotoGui.h"
6
7
8 class UnitTest : public QObject
9 {
10 Q_OBJECT
11 private:
12 IntelliPhotoGui* gui;
13 PaintingArea* area;
14 QApplication* app;
15
16 public:
17 UnitTest();
18 ~UnitTest();
19
20 private slots:
21 void initTestCase();
22 void cleanupTestCase();
23 //void test_case1();
24
25 //test painting area
26 void test_addLayer();
27 void test_deleteLayer();
28 void test_setActive();
29 void test_setAlpha();
30 void test_floodFill();
31 void test_moveActive();
32 void test_setPolygon();
33 void test_setLayerUp();
34 void test_setLayerDown();
35
36 void test_createTools();
37
38 //test Raster-Image operations
39 void test_RasterImage_drawPixel();
40 void test_RasterImage_drawLine();
41 void test_RasterImage_drawPoint();
42 void test_RasterImage_getDisplayable();
43 void test_RasterImage_setPolygon();
44 void test_RasterImage_loadImage();
45 void test_RasterImage_getPixelColor();
46 void test_RasterImage_getImageData();
47 void test_RasterImage_setImageData();
48
49 //test Shaped-Image operations
50 void test_ShapedImage_drawPixel();
51 void test_ShapedImage_drawLine();
52 void test_ShapedImage_drawPoint();
53 void test_ShapedImage_getDisplayable();
54 void test_ShapedImage_setPolygon();
55 void test_ShapedImage_loadImage();
56 void test_ShapedImage_getPixelColor();
57 void test_ShapedImage_getImageData();
58 void test_ShapedImage_setImageData();
59
60 //test painting-area tools
61 void test_createTool_Circle();
62 void test_createTool_FloodFill();
63 void test_createTool_Line();
64 void test_createTool_Pen();
65 void test_createTool_Plain();
66 void test_createTool_Polygon();
67 void test_createTool_Rectangle();
68
69 //test tools
70 void test_Circle_fullDraw();
71 void test_Circle_interruptedDraw();
72
73 void test_FloodFill_fullDraw();
74 void test_FloodFill_interruptedDraw();
75
76 void test_Line_fullDraw();
77 void test_Line_interruptedDraw();
78
79 void test_Pen_fullDraw();
80 void test_Pen_interruptedDraw();
81
82 void test_Plain_fullDraw();
83 void test_Plain_interruptedDraw();
84
85 void test_Polygon_fullDraw();
86 void test_Polygon_interruptedDraw();
87
88 void test_Rectangle_fullDraw();
89 void test_Rectangle_interruptedDraw();
90
91 //test Triangulation
92 void test_Triangulation_Coverage();
93 };
94
95 UnitTest::UnitTest()
96 {
97 char arg0[] = "programName";
98 char arg1[] = "arg1";
99 char arg2[] = "arg2";
100 char*argv[] = {arg0, arg1, arg2, nullptr};
101 int argc = sizeof(argv) / sizeof(char*) - 1;
102
103 app = new QApplication(argc,argv);
104 gui = new IntelliPhotoGui();
105 area = gui->paintingArea;
106 }
107
108 UnitTest::~UnitTest()
109 {
110
111 }
112
113 void UnitTest::initTestCase()
114 {
115
116 }
117
118 void UnitTest::cleanupTestCase()
119 {
120 delete gui;
121 delete app;
122 }
123
124 //void UnitTest::test_case1()
125 //{
126 // QBENCHMARK {
127 // QVERIFY(1 == 1);
128 // }
129 //}
130
131 //test painting area
132 void UnitTest::test_addLayer(){
133 }
134 void UnitTest::test_deleteLayer(){
135 }
136 void UnitTest::test_setActive(){
137 }
138 void UnitTest::test_setAlpha(){
139 }
140 void UnitTest::test_floodFill(){
141 }
142 void UnitTest::test_moveActive(){
143 }
144 void UnitTest::test_setPolygon(){
145 }
146 void UnitTest::test_setLayerUp(){
147 }
148 void UnitTest::test_setLayerDown(){
149 }
150
151 void UnitTest::test_createTools(){
152 }
153
154 //test Raster-Image operations
155 void UnitTest::test_RasterImage_drawPixel(){
156 }
157 void UnitTest::test_RasterImage_drawLine(){
158 }
159 void UnitTest::test_RasterImage_drawPoint(){
160 }
161 void UnitTest::test_RasterImage_getDisplayable(){
162 }
163 void UnitTest::test_RasterImage_setPolygon(){
164 }
165 void UnitTest::test_RasterImage_loadImage(){
166 }
167 void UnitTest::test_RasterImage_getPixelColor(){
168 }
169 void UnitTest::test_RasterImage_getImageData(){
170 }
171 void UnitTest::test_RasterImage_setImageData(){
172 }
173
174 //test Shaped-Image operations
175 void UnitTest::test_ShapedImage_drawPixel(){
176 }
177 void UnitTest::test_ShapedImage_drawLine(){
178 }
179 void UnitTest::test_ShapedImage_drawPoint(){
180 }
181 void UnitTest::test_ShapedImage_getDisplayable(){
182 }
183 void UnitTest::test_ShapedImage_setPolygon(){
184 }
185 void UnitTest::test_ShapedImage_loadImage(){
186 }
187 void UnitTest::test_ShapedImage_getPixelColor(){
188 }
189 void UnitTest::test_ShapedImage_getImageData(){
190 }
191 void UnitTest::test_ShapedImage_setImageData(){
192 }
193
194 //test painting-area tools
195 void UnitTest::test_createTool_Circle(){
196 }
197 void UnitTest::test_createTool_FloodFill(){
198 }
199 void UnitTest::test_createTool_Line(){
200 }
201 void UnitTest::test_createTool_Pen(){
202 }
203 void UnitTest::test_createTool_Plain(){
204 }
205 void UnitTest::test_createTool_Polygon(){
206 }
207 void UnitTest::test_createTool_Rectangle(){
208 }
209
210 //test tools
211 void UnitTest::test_Circle_fullDraw(){
212 }
213 void UnitTest::test_Circle_interruptedDraw(){
214 }
215
216 void UnitTest::test_FloodFill_fullDraw(){
217 }
218 void UnitTest::test_FloodFill_interruptedDraw(){
219 }
220
221 void UnitTest::test_Line_fullDraw(){
222 }
223 void UnitTest::test_Line_interruptedDraw(){
224 }
225
226 void UnitTest::test_Pen_fullDraw(){
227 }
228 void UnitTest::test_Pen_interruptedDraw(){
229 }
230
231 void UnitTest::test_Plain_fullDraw(){
232 }
233 void UnitTest::test_Plain_interruptedDraw(){
234 }
235
236 void UnitTest::test_Polygon_fullDraw(){
237 }
238 void UnitTest::test_Polygon_interruptedDraw(){
239 }
240
241 void UnitTest::test_Rectangle_fullDraw(){
242 }
243 void UnitTest::test_Rectangle_interruptedDraw(){
244 }
245
246 //test Triangulation
247 void UnitTest::test_Triangulation_Coverage(){
248 }
249
250 QTEST_APPLESS_MAIN(UnitTest)
251
252 #include "tst_unittest.moc"
UnitTest::~UnitTest
~UnitTest()
Definition: mainUnitTest.cpp:108
IntelliPhotoGui
The IntelliPhotoGui base class handles the graphical user interface and events for the intelliPhoto p...
Definition: IntelliPhotoGui.h:34
UnitTest::UnitTest
UnitTest()
Definition: mainUnitTest.cpp:95
PaintingArea
The PaintingArea class manages the methods and stores information about the current painting area,...
Definition: PaintingArea.h:57
IntelliPhotoGui.h
UnitTest
Definition: mainUnitTest.cpp:8