mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-12 19:40:28 +02:00
working setup for unit tests
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
QT += testlib
|
||||
QT += gui
|
||||
CONFIG += qt warn_on depend_includepath testcase
|
||||
QT -= gui
|
||||
|
||||
CONFIG += qt console warn_on depend_includepath testcase
|
||||
CONFIG -= app_bundle
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
|
||||
TEMPLATE = app
|
||||
|
||||
SOURCES += \
|
||||
SOURCES += tst_unittest.cpp \
|
||||
GUI/IntelliPhotoGui.cpp \
|
||||
Image/IntelliImage.cpp \
|
||||
Image/IntelliRasterImage.cpp \
|
||||
@@ -23,8 +26,7 @@ SOURCES += \
|
||||
Tool/IntelliToolPen.cpp \
|
||||
Tool/IntelliToolPlain.cpp \
|
||||
Tool/IntelliToolPolygon.cpp \
|
||||
Tool/IntelliToolRectangle.cpp \
|
||||
mainUnitTest.cpp
|
||||
Tool/IntelliToolRectangle.cpp
|
||||
|
||||
DISTFILES += \
|
||||
icons/Wechselpfeile.png \
|
||||
@@ -20,7 +20,7 @@ public:
|
||||
private slots:
|
||||
void initTestCase();
|
||||
void cleanupTestCase();
|
||||
void test_case1();
|
||||
//void test_case1();
|
||||
|
||||
//test painting area
|
||||
void test_addLayer();
|
||||
@@ -121,12 +121,81 @@ void UnitTest::cleanupTestCase()
|
||||
delete app;
|
||||
}
|
||||
|
||||
void UnitTest::test_case1()
|
||||
{
|
||||
QBENCHMARK {
|
||||
QVERIFY(1 == 1);
|
||||
}
|
||||
}
|
||||
//void UnitTest::test_case1()
|
||||
//{
|
||||
// QBENCHMARK {
|
||||
// QVERIFY(1 == 1);
|
||||
// }
|
||||
//}
|
||||
|
||||
//test painting area
|
||||
void UnitTest::test_addLayer(){}
|
||||
void UnitTest::test_deleteLayer(){}
|
||||
void UnitTest::test_setActive(){}
|
||||
void UnitTest::test_setAlpha(){}
|
||||
void UnitTest::test_floodFill(){}
|
||||
void UnitTest::test_moveActive(){}
|
||||
void UnitTest::test_setPolygon(){}
|
||||
void UnitTest::test_setLayerUp(){}
|
||||
void UnitTest::test_setLayerDown(){}
|
||||
|
||||
void UnitTest::test_createTools(){}
|
||||
|
||||
//test Raster-Image operations
|
||||
void UnitTest::test_RasterImage_drawPixel(){}
|
||||
void UnitTest::test_RasterImage_drawLine(){}
|
||||
void UnitTest::test_RasterImage_drawPoint(){}
|
||||
void UnitTest::test_RasterImage_getDisplayable(){}
|
||||
void UnitTest::test_RasterImage_setPolygon(){}
|
||||
void UnitTest::test_RasterImage_loadImage(){}
|
||||
void UnitTest::test_RasterImage_getPixelColor(){}
|
||||
void UnitTest::test_RasterImage_getImageData(){}
|
||||
void UnitTest::test_RasterImage_setImageData(){}
|
||||
|
||||
//test Shaped-Image operations
|
||||
void UnitTest::test_ShapedImage_drawPixel(){}
|
||||
void UnitTest::test_ShapedImage_drawLine(){}
|
||||
void UnitTest::test_ShapedImage_drawPoint(){}
|
||||
void UnitTest::test_ShapedImage_getDisplayable(){}
|
||||
void UnitTest::test_ShapedImage_setPolygon(){}
|
||||
void UnitTest::test_ShapedImage_loadImage(){}
|
||||
void UnitTest::test_ShapedImage_getPixelColor(){}
|
||||
void UnitTest::test_ShapedImage_getImageData(){}
|
||||
void UnitTest::test_ShapedImage_setImageData(){}
|
||||
|
||||
//test painting-area tools
|
||||
void UnitTest::test_createTool_Circle(){}
|
||||
void UnitTest::test_createTool_FloodFill(){}
|
||||
void UnitTest::test_createTool_Line(){}
|
||||
void UnitTest::test_createTool_Pen(){}
|
||||
void UnitTest::test_createTool_Plain(){}
|
||||
void UnitTest::test_createTool_Polygon(){}
|
||||
void UnitTest::test_createTool_Rectangle(){}
|
||||
|
||||
//test tools
|
||||
void UnitTest::test_Circle_fullDraw(){}
|
||||
void UnitTest::test_Circle_interruptedDraw(){}
|
||||
|
||||
void UnitTest::test_FloodFill_fullDraw(){}
|
||||
void UnitTest::test_FloodFill_interruptedDraw(){}
|
||||
|
||||
void UnitTest::test_Line_fullDraw(){}
|
||||
void UnitTest::test_Line_interruptedDraw(){}
|
||||
|
||||
void UnitTest::test_Pen_fullDraw(){}
|
||||
void UnitTest::test_Pen_interruptedDraw(){}
|
||||
|
||||
void UnitTest::test_Plain_fullDraw(){}
|
||||
void UnitTest::test_Plain_interruptedDraw(){}
|
||||
|
||||
void UnitTest::test_Polygon_fullDraw(){}
|
||||
void UnitTest::test_Polygon_interruptedDraw(){}
|
||||
|
||||
void UnitTest::test_Rectangle_fullDraw(){}
|
||||
void UnitTest::test_Rectangle_interruptedDraw(){}
|
||||
|
||||
//test Triangulation
|
||||
void UnitTest::test_Triangulation_Coverage(){}
|
||||
|
||||
QTEST_APPLESS_MAIN(UnitTest)
|
||||
|
||||
|
||||
191
src/tst_unittest.cpp
Normal file
191
src/tst_unittest.cpp
Normal file
@@ -0,0 +1,191 @@
|
||||
#include <QtTest>
|
||||
#include <QCoreApplication>
|
||||
// add necessary includes here
|
||||
#include "GUI/IntelliPhotoGui.h"
|
||||
|
||||
class UnitTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
IntelliPhotoGui* gui;
|
||||
PaintingArea* area;
|
||||
|
||||
public:
|
||||
UnitTest();
|
||||
~UnitTest();
|
||||
|
||||
private slots:
|
||||
void initTestCase();
|
||||
void cleanupTestCase();
|
||||
//void test_case1();
|
||||
|
||||
//test painting area
|
||||
void test_addLayer();
|
||||
void test_deleteLayer();
|
||||
void test_setActive();
|
||||
void test_setAlpha();
|
||||
void test_floodFill();
|
||||
void test_moveActive();
|
||||
void test_setPolygon();
|
||||
void test_setLayerUp();
|
||||
void test_setLayerDown();
|
||||
|
||||
void test_createTools();
|
||||
|
||||
//test Raster-Image operations
|
||||
void test_RasterImage_drawPixel();
|
||||
void test_RasterImage_drawLine();
|
||||
void test_RasterImage_drawPoint();
|
||||
void test_RasterImage_getDisplayable();
|
||||
void test_RasterImage_setPolygon();
|
||||
void test_RasterImage_loadImage();
|
||||
void test_RasterImage_getPixelColor();
|
||||
void test_RasterImage_getImageData();
|
||||
void test_RasterImage_setImageData();
|
||||
|
||||
//test Shaped-Image operations
|
||||
void test_ShapedImage_drawPixel();
|
||||
void test_ShapedImage_drawLine();
|
||||
void test_ShapedImage_drawPoint();
|
||||
void test_ShapedImage_getDisplayable();
|
||||
void test_ShapedImage_setPolygon();
|
||||
void test_ShapedImage_loadImage();
|
||||
void test_ShapedImage_getPixelColor();
|
||||
void test_ShapedImage_getImageData();
|
||||
void test_ShapedImage_setImageData();
|
||||
|
||||
//test painting-area tools
|
||||
void test_createTool_Circle();
|
||||
void test_createTool_FloodFill();
|
||||
void test_createTool_Line();
|
||||
void test_createTool_Pen();
|
||||
void test_createTool_Plain();
|
||||
void test_createTool_Polygon();
|
||||
void test_createTool_Rectangle();
|
||||
|
||||
//test tools
|
||||
void test_Circle_fullDraw();
|
||||
void test_Circle_interruptedDraw();
|
||||
|
||||
void test_FloodFill_fullDraw();
|
||||
void test_FloodFill_interruptedDraw();
|
||||
|
||||
void test_Line_fullDraw();
|
||||
void test_Line_interruptedDraw();
|
||||
|
||||
void test_Pen_fullDraw();
|
||||
void test_Pen_interruptedDraw();
|
||||
|
||||
void test_Plain_fullDraw();
|
||||
void test_Plain_interruptedDraw();
|
||||
|
||||
void test_Polygon_fullDraw();
|
||||
void test_Polygon_interruptedDraw();
|
||||
|
||||
void test_Rectangle_fullDraw();
|
||||
void test_Rectangle_interruptedDraw();
|
||||
|
||||
//test Triangulation
|
||||
void test_Triangulation_Coverage();
|
||||
};
|
||||
|
||||
UnitTest::UnitTest()
|
||||
{
|
||||
gui = new IntelliPhotoGui();
|
||||
area = gui->paintingArea;
|
||||
}
|
||||
|
||||
UnitTest::~UnitTest()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void UnitTest::initTestCase()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void UnitTest::cleanupTestCase()
|
||||
{
|
||||
delete gui;
|
||||
}
|
||||
|
||||
//void UnitTest::test_case1()
|
||||
//{
|
||||
// QBENCHMARK {
|
||||
// QVERIFY(1 == 1);
|
||||
// }
|
||||
//}
|
||||
|
||||
//test painting area
|
||||
void UnitTest::test_addLayer(){}
|
||||
void UnitTest::test_deleteLayer(){}
|
||||
void UnitTest::test_setActive(){}
|
||||
void UnitTest::test_setAlpha(){}
|
||||
void UnitTest::test_floodFill(){}
|
||||
void UnitTest::test_moveActive(){}
|
||||
void UnitTest::test_setPolygon(){}
|
||||
void UnitTest::test_setLayerUp(){}
|
||||
void UnitTest::test_setLayerDown(){}
|
||||
|
||||
void UnitTest::test_createTools(){}
|
||||
|
||||
//test Raster-Image operations
|
||||
void UnitTest::test_RasterImage_drawPixel(){}
|
||||
void UnitTest::test_RasterImage_drawLine(){}
|
||||
void UnitTest::test_RasterImage_drawPoint(){}
|
||||
void UnitTest::test_RasterImage_getDisplayable(){}
|
||||
void UnitTest::test_RasterImage_setPolygon(){}
|
||||
void UnitTest::test_RasterImage_loadImage(){}
|
||||
void UnitTest::test_RasterImage_getPixelColor(){}
|
||||
void UnitTest::test_RasterImage_getImageData(){}
|
||||
void UnitTest::test_RasterImage_setImageData(){}
|
||||
|
||||
//test Shaped-Image operations
|
||||
void UnitTest::test_ShapedImage_drawPixel(){}
|
||||
void UnitTest::test_ShapedImage_drawLine(){}
|
||||
void UnitTest::test_ShapedImage_drawPoint(){}
|
||||
void UnitTest::test_ShapedImage_getDisplayable(){}
|
||||
void UnitTest::test_ShapedImage_setPolygon(){}
|
||||
void UnitTest::test_ShapedImage_loadImage(){}
|
||||
void UnitTest::test_ShapedImage_getPixelColor(){}
|
||||
void UnitTest::test_ShapedImage_getImageData(){}
|
||||
void UnitTest::test_ShapedImage_setImageData(){}
|
||||
|
||||
//test painting-area tools
|
||||
void UnitTest::test_createTool_Circle(){}
|
||||
void UnitTest::test_createTool_FloodFill(){}
|
||||
void UnitTest::test_createTool_Line(){}
|
||||
void UnitTest::test_createTool_Pen(){}
|
||||
void UnitTest::test_createTool_Plain(){}
|
||||
void UnitTest::test_createTool_Polygon(){}
|
||||
void UnitTest::test_createTool_Rectangle(){}
|
||||
|
||||
//test tools
|
||||
void UnitTest::test_Circle_fullDraw(){}
|
||||
void UnitTest::test_Circle_interruptedDraw(){}
|
||||
|
||||
void UnitTest::test_FloodFill_fullDraw(){}
|
||||
void UnitTest::test_FloodFill_interruptedDraw(){}
|
||||
|
||||
void UnitTest::test_Line_fullDraw(){}
|
||||
void UnitTest::test_Line_interruptedDraw(){}
|
||||
|
||||
void UnitTest::test_Pen_fullDraw(){}
|
||||
void UnitTest::test_Pen_interruptedDraw(){}
|
||||
|
||||
void UnitTest::test_Plain_fullDraw(){}
|
||||
void UnitTest::test_Plain_interruptedDraw(){}
|
||||
|
||||
void UnitTest::test_Polygon_fullDraw(){}
|
||||
void UnitTest::test_Polygon_interruptedDraw(){}
|
||||
|
||||
void UnitTest::test_Rectangle_fullDraw(){}
|
||||
void UnitTest::test_Rectangle_interruptedDraw(){}
|
||||
|
||||
//test Triangulation
|
||||
void UnitTest::test_Triangulation_Coverage(){}
|
||||
|
||||
QTEST_MAIN(UnitTest)
|
||||
|
||||
#include "tst_unittest.moc"
|
||||
Reference in New Issue
Block a user