IntelliPhoto  0.5
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 
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 
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 void UnitTest::test_deleteLayer(){}
134 void UnitTest::test_setActive(){}
135 void UnitTest::test_setAlpha(){}
136 void UnitTest::test_floodFill(){}
137 void UnitTest::test_moveActive(){}
138 void UnitTest::test_setPolygon(){}
139 void UnitTest::test_setLayerUp(){}
140 void UnitTest::test_setLayerDown(){}
141 
142 void UnitTest::test_createTools(){}
143 
144 //test Raster-Image operations
145 void UnitTest::test_RasterImage_drawPixel(){}
146 void UnitTest::test_RasterImage_drawLine(){}
147 void UnitTest::test_RasterImage_drawPoint(){}
148 void UnitTest::test_RasterImage_getDisplayable(){}
149 void UnitTest::test_RasterImage_setPolygon(){}
150 void UnitTest::test_RasterImage_loadImage(){}
151 void UnitTest::test_RasterImage_getPixelColor(){}
152 void UnitTest::test_RasterImage_getImageData(){}
153 void UnitTest::test_RasterImage_setImageData(){}
154 
155 //test Shaped-Image operations
156 void UnitTest::test_ShapedImage_drawPixel(){}
157 void UnitTest::test_ShapedImage_drawLine(){}
158 void UnitTest::test_ShapedImage_drawPoint(){}
159 void UnitTest::test_ShapedImage_getDisplayable(){}
160 void UnitTest::test_ShapedImage_setPolygon(){}
161 void UnitTest::test_ShapedImage_loadImage(){}
162 void UnitTest::test_ShapedImage_getPixelColor(){}
163 void UnitTest::test_ShapedImage_getImageData(){}
164 void UnitTest::test_ShapedImage_setImageData(){}
165 
166 //test painting-area tools
167 void UnitTest::test_createTool_Circle(){}
168 void UnitTest::test_createTool_FloodFill(){}
169 void UnitTest::test_createTool_Line(){}
170 void UnitTest::test_createTool_Pen(){}
171 void UnitTest::test_createTool_Plain(){}
172 void UnitTest::test_createTool_Polygon(){}
173 void UnitTest::test_createTool_Rectangle(){}
174 
175 //test tools
176 void UnitTest::test_Circle_fullDraw(){}
177 void UnitTest::test_Circle_interruptedDraw(){}
178 
179 void UnitTest::test_FloodFill_fullDraw(){}
180 void UnitTest::test_FloodFill_interruptedDraw(){}
181 
182 void UnitTest::test_Line_fullDraw(){}
183 void UnitTest::test_Line_interruptedDraw(){}
184 
185 void UnitTest::test_Pen_fullDraw(){}
186 void UnitTest::test_Pen_interruptedDraw(){}
187 
188 void UnitTest::test_Plain_fullDraw(){}
189 void UnitTest::test_Plain_interruptedDraw(){}
190 
191 void UnitTest::test_Polygon_fullDraw(){}
192 void UnitTest::test_Polygon_interruptedDraw(){}
193 
194 void UnitTest::test_Rectangle_fullDraw(){}
195 void UnitTest::test_Rectangle_interruptedDraw(){}
196 
197 //test Triangulation
198 void UnitTest::test_Triangulation_Coverage(){}
199 
200 QTEST_APPLESS_MAIN(UnitTest)
201 
202 #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:28
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:53
IntelliPhotoGui.h
UnitTest
Definition: mainUnitTest.cpp:8