From 33c5708ce5b4b237e1cc7e4b092bf98af4b7c324 Mon Sep 17 00:00:00 2001 From: Jonas Mucke Date: Wed, 15 Jan 2020 19:39:15 +0100 Subject: [PATCH] all tests unified, benchmark and unit test complete --- src/tst_unittest.cpp | 188 ++++++++++++++++++------------------------- 1 file changed, 79 insertions(+), 109 deletions(-) diff --git a/src/tst_unittest.cpp b/src/tst_unittest.cpp index f5692c2..1bb3390 100644 --- a/src/tst_unittest.cpp +++ b/src/tst_unittest.cpp @@ -144,7 +144,7 @@ private slots: void bench_Plain_interruptedDraw(); void bench_Polygon_fullDraw(); - //void bench_Polygon_interruptedDraw(); + void bench_Polygon_interruptedDraw(); void bench_Rectangle_fullDraw(); void bench_Rectangle_interruptedDraw(); @@ -176,7 +176,7 @@ void UnitTest::cleanupTestCase() //test painting area void UnitTest::test_addLayer(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::SHAPEDIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::SHAPEDIMAGE); QCOMPARE(area->layerBundle.size(), 1); QCOMPARE(area->activeLayer, 0); @@ -184,15 +184,15 @@ void UnitTest::test_addLayer(){ QCOMPARE(area->layerBundle[static_cast(area->activeLayer)].width, 200); QCOMPARE(area->layerBundle[static_cast(area->activeLayer)].widthOffset, 10); - QCOMPARE(area->layerBundle[static_cast(area->activeLayer)].height, 400); + QCOMPARE(area->layerBundle[static_cast(area->activeLayer)].height, 200); QCOMPARE(area->layerBundle[static_cast(area->activeLayer)].heightOffset, 20); area->deleteLayer(0); } void UnitTest::test_deleteLayer(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::SHAPEDIMAGE); - area->addLayer(200,400,10,20,IntelliImage::ImageType::SHAPEDIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::SHAPEDIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::SHAPEDIMAGE); area->deleteLayer(3); QCOMPARE(area->layerBundle.size(), 2); @@ -213,8 +213,8 @@ void UnitTest::test_deleteLayer(){ } void UnitTest::test_setActive(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::SHAPEDIMAGE); - area->addLayer(200,400,10,20,IntelliImage::ImageType::SHAPEDIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::SHAPEDIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::SHAPEDIMAGE); area->setLayerActive(0); QCOMPARE(area->activeLayer, 0); @@ -230,8 +230,8 @@ void UnitTest::test_setActive(){ } void UnitTest::test_setAlpha(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::SHAPEDIMAGE); - area->addLayer(200,400,10,20,IntelliImage::ImageType::SHAPEDIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::SHAPEDIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::SHAPEDIMAGE); area->setLayerAlpha(0,0); QCOMPARE(area->layerBundle[0].alpha, 0); @@ -253,13 +253,13 @@ void UnitTest::test_setAlpha(){ } void UnitTest::test_floodFill(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::SHAPEDIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::SHAPEDIMAGE); area->floodFill(255,255,255,255); QPoint point; for(size_t i = 0; i<200; i++){ point.setX(static_cast(i)); - for(size_t j = 0; i<400; i++){ + for(size_t j = 0; i<200; i++){ point.setY(static_cast(j)); QVERIFY(area->layerBundle[static_cast(area->activeLayer)].image->getPixelColor(point)==QColor(255,255,255,255)); } @@ -268,7 +268,7 @@ void UnitTest::test_floodFill(){ area->floodFill(0,0,0,0); for(size_t i = 0; i<200; i++){ point.setX(static_cast(i)); - for(size_t j = 0; i<400; i++){ + for(size_t j = 0; i<200; i++){ point.setY(static_cast(j)); QVERIFY(area->layerBundle[static_cast(area->activeLayer)].image->getPixelColor(point)==QColor(0,0,0,0)); } @@ -277,7 +277,7 @@ void UnitTest::test_floodFill(){ area->floodFill(-1,-1,-1,-1); for(size_t i = 0; i<200; i++){ point.setX(static_cast(i)); - for(size_t j = 0; i<400; i++){ + for(size_t j = 0; i<200; i++){ point.setY(static_cast(j)); QVERIFY(area->layerBundle[static_cast(area->activeLayer)].image->getPixelColor(point)==QColor(0,0,0,0)); } @@ -286,7 +286,7 @@ void UnitTest::test_floodFill(){ area->floodFill(256,256,256,256); for(size_t i = 0; i<200; i++){ point.setX(static_cast(i)); - for(size_t j = 0; i<400; i++){ + for(size_t j = 0; i<200; i++){ point.setY(static_cast(j)); QVERIFY(area->layerBundle[static_cast(area->activeLayer)].image->getPixelColor(point)==QColor(0,0,0,0)); } @@ -296,8 +296,8 @@ void UnitTest::test_floodFill(){ } void UnitTest::test_moveActive(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::SHAPEDIMAGE); - area->addLayer(200,400,10,20,IntelliImage::ImageType::SHAPEDIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::SHAPEDIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::SHAPEDIMAGE); area->floodFill(0,0,0,255); QPoint point(0,0); @@ -323,8 +323,8 @@ void UnitTest::test_moveActive(){ } void UnitTest::test_setPolygon(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); - area->addLayer(200,400,10,20,IntelliImage::ImageType::SHAPEDIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::SHAPEDIMAGE); std::vector polygon{ QPoint(10,00), @@ -345,8 +345,8 @@ void UnitTest::test_setPolygon(){ } void UnitTest::test_setLayerUp(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); - area->addLayer(200,400,10,20,IntelliImage::ImageType::SHAPEDIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::SHAPEDIMAGE); area->selectLayerUp(); QCOMPARE(area->activeLayer, 1); @@ -362,8 +362,8 @@ void UnitTest::test_setLayerUp(){ } void UnitTest::test_setLayerDown(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); - area->addLayer(200,400,10,20,IntelliImage::ImageType::SHAPEDIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::SHAPEDIMAGE); area->selectLayerDown(); QCOMPARE(area->activeLayer, 0); @@ -403,7 +403,7 @@ void UnitTest::test_createTools(){ //test Raster-Image operations void UnitTest::test_RasterImage_drawPixel(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); QPoint point(0,0); @@ -416,7 +416,7 @@ void UnitTest::test_RasterImage_drawPixel(){ } void UnitTest::test_RasterImage_drawLine(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); QPoint point1(0,0); QPoint point2(10,10); @@ -441,7 +441,7 @@ void UnitTest::test_RasterImage_drawLine(){ } void UnitTest::test_RasterImage_drawPoint(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); QPoint point1(5,5); QPoint point2(5,6); @@ -461,14 +461,14 @@ void UnitTest::test_RasterImage_drawPoint(){ } void UnitTest::test_RasterImage_getDisplayable(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); area->floodFill(255,255,255,255); - QImage img = area->layerBundle[0].image->getDisplayable(QSize(200,400),255); + QImage img = area->layerBundle[0].image->getDisplayable(QSize(200,200),255); QPoint point; for(size_t i=0; i<200; i++){ point.setX(static_cast(i)); - for(size_t j=0; j<400; j++){ + for(size_t j=0; j<200; j++){ point.setY(static_cast(j)); QVERIFY(img.pixelColor(point) == QColor(255,255,255,255)); } @@ -478,7 +478,7 @@ void UnitTest::test_RasterImage_getDisplayable(){ } void UnitTest::test_RasterImage_getPixelColor(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); QPoint point(0,0); area->floodFill(0,0,0,255); @@ -538,7 +538,7 @@ void UnitTest::test_RasterImage_setImageData(){ //test Shaped-Image operations void UnitTest::test_ShapedImage_drawPixel(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); QPoint point(0,0); @@ -551,7 +551,7 @@ void UnitTest::test_ShapedImage_drawPixel(){ } void UnitTest::test_ShapedImage_drawLine(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); QPoint point1(0,0); QPoint point2(10,10); @@ -576,7 +576,7 @@ void UnitTest::test_ShapedImage_drawLine(){ } void UnitTest::test_ShapedImage_drawPoint(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); QPoint point1(5,5); QPoint point2(5,6); @@ -631,7 +631,7 @@ void UnitTest::test_ShapedImage_getDisplayable(){ } void UnitTest::test_ShapedImage_getPixelColor(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); QPoint point(0,0); area->floodFill(0,0,0,255); @@ -691,7 +691,7 @@ void UnitTest::test_ShapedImage_setImageData(){ //test tools void UnitTest::test_Circle_fullDraw(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); area->colorPicker.setFirstColor(QColor(255,255,255,255)); area->colorPicker.setSecondColor(QColor(0,0,0,255)); area->createCircleTool(); @@ -711,7 +711,7 @@ void UnitTest::test_Circle_fullDraw(){ } void UnitTest::test_Circle_interruptedDraw(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); area->colorPicker.setFirstColor(QColor(255,255,255,255)); area->colorPicker.setSecondColor(QColor(0,0,0,255)); area->createCircleTool(); @@ -735,7 +735,7 @@ void UnitTest::test_Circle_interruptedDraw(){ void UnitTest::test_FloodFill_fullDraw(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); area->colorPicker.setFirstColor(QColor(255,255,255,255)); area->colorPicker.setSecondColor(QColor(0,0,0,255)); area->createFloodFillTool(); @@ -755,7 +755,7 @@ void UnitTest::test_FloodFill_fullDraw(){ } void UnitTest::test_FloodFill_interruptedDraw(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); area->colorPicker.setFirstColor(QColor(255,255,255,255)); area->colorPicker.setSecondColor(QColor(0,0,0,255)); area->createFloodFillTool(); @@ -778,7 +778,7 @@ void UnitTest::test_FloodFill_interruptedDraw(){ void UnitTest::test_Line_fullDraw(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); area->colorPicker.setFirstColor(QColor(255,255,255,255)); area->colorPicker.setSecondColor(QColor(0,0,0,255)); area->createLineTool(); @@ -798,7 +798,7 @@ void UnitTest::test_Line_fullDraw(){ } void UnitTest::test_Line_interruptedDraw(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); area->colorPicker.setFirstColor(QColor(255,255,255,255)); area->colorPicker.setSecondColor(QColor(0,0,0,255)); area->createLineTool(); @@ -820,7 +820,7 @@ void UnitTest::test_Line_interruptedDraw(){ } void UnitTest::test_Pen_fullDraw(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); area->colorPicker.setFirstColor(QColor(255,255,255,255)); area->colorPicker.setSecondColor(QColor(0,0,0,255)); area->createPenTool(); @@ -840,7 +840,7 @@ void UnitTest::test_Pen_fullDraw(){ } void UnitTest::test_Pen_interruptedDraw(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); area->colorPicker.setFirstColor(QColor(255,255,255,255)); area->colorPicker.setSecondColor(QColor(0,0,0,255)); area->createPenTool(); @@ -862,7 +862,7 @@ void UnitTest::test_Pen_interruptedDraw(){ } void UnitTest::test_Plain_fullDraw(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); area->colorPicker.setFirstColor(QColor(255,255,255,255)); area->colorPicker.setSecondColor(QColor(0,0,0,255)); area->createPlainTool(); @@ -882,7 +882,7 @@ void UnitTest::test_Plain_fullDraw(){ } void UnitTest::test_Plain_interruptedDraw(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); area->colorPicker.setFirstColor(QColor(255,255,255,255)); area->colorPicker.setSecondColor(QColor(0,0,0,255)); area->createPlainTool(); @@ -1017,7 +1017,7 @@ void UnitTest::test_Polygon_interruptedDraw(){ void UnitTest::test_Rectangle_fullDraw(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); area->colorPicker.setFirstColor(QColor(255,255,255,255)); area->colorPicker.setSecondColor(QColor(0,0,0,255)); area->createRectangleTool(); @@ -1039,7 +1039,7 @@ void UnitTest::test_Rectangle_fullDraw(){ } void UnitTest::test_Rectangle_interruptedDraw(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); area->colorPicker.setFirstColor(QColor(255,255,255,255)); area->colorPicker.setSecondColor(QColor(0,0,0,255)); area->createRectangleTool(); @@ -1154,7 +1154,7 @@ void UnitTest::bench_moveActive(){ } void UnitTest::bench_setPolygon(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::SHAPEDIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::SHAPEDIMAGE); std::vector polygon{ QPoint(10,00), @@ -1171,8 +1171,8 @@ void UnitTest::bench_setPolygon(){ } void UnitTest::bench_setLayerUp(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); area->setLayerActive(0); QBENCHMARK{ @@ -1184,8 +1184,8 @@ void UnitTest::bench_setLayerUp(){ } void UnitTest::bench_setLayerDown(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); QBENCHMARK{ area->selectLayerDown(); @@ -1226,7 +1226,7 @@ void UnitTest::bench_createTools(){ } void UnitTest::bench_RasterImage_drawPixel(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); QPoint point(0,0); @@ -1238,7 +1238,7 @@ void UnitTest::bench_RasterImage_drawPixel(){ } void UnitTest::bench_RasterImage_drawLine(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); QPoint point1(000,000); QPoint point2(200,200); @@ -1251,7 +1251,7 @@ void UnitTest::bench_RasterImage_drawLine(){ } void UnitTest::bench_RasterImage_drawPoint(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); QPoint point(000,000); @@ -1263,7 +1263,7 @@ void UnitTest::bench_RasterImage_drawPoint(){ } void UnitTest::bench_RasterImage_getDisplayable(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); QBENCHMARK{ area->layerBundle[0].image->getDisplayable(QSize(200,200),255); @@ -1273,7 +1273,7 @@ void UnitTest::bench_RasterImage_getDisplayable(){ } void UnitTest::bench_RasterImage_getPixelColor(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); QPoint point(000,000); @@ -1285,7 +1285,7 @@ void UnitTest::bench_RasterImage_getPixelColor(){ } void UnitTest::bench_RasterImage_getImageData(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); QBENCHMARK{ area->layerBundle[0].image->getImageData(); @@ -1295,7 +1295,7 @@ void UnitTest::bench_RasterImage_getImageData(){ } void UnitTest::bench_RasterImage_setImageData(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); QImage img = area->layerBundle[0].image->getImageData(); QBENCHMARK{ @@ -1306,7 +1306,7 @@ void UnitTest::bench_RasterImage_setImageData(){ } void UnitTest::bench_ShapedImage_drawPixel(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::SHAPEDIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::SHAPEDIMAGE); QPoint point(0,0); @@ -1318,7 +1318,7 @@ void UnitTest::bench_ShapedImage_drawPixel(){ } void UnitTest::bench_ShapedImage_drawLine(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::SHAPEDIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::SHAPEDIMAGE); QPoint point1(000,000); QPoint point2(200,200); @@ -1331,7 +1331,7 @@ void UnitTest::bench_ShapedImage_drawLine(){ } void UnitTest::bench_ShapedImage_drawPoint(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::SHAPEDIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::SHAPEDIMAGE); QPoint point(000,000); @@ -1343,7 +1343,7 @@ void UnitTest::bench_ShapedImage_drawPoint(){ } void UnitTest::bench_ShapedImage_getDisplayable(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::SHAPEDIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::SHAPEDIMAGE); QBENCHMARK{ area->layerBundle[0].image->getDisplayable(QSize(200,200),255); @@ -1353,7 +1353,7 @@ void UnitTest::bench_ShapedImage_getDisplayable(){ } void UnitTest::bench_ShapedImage_getPixelColor(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::SHAPEDIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::SHAPEDIMAGE); QPoint point(000,000); @@ -1365,7 +1365,7 @@ void UnitTest::bench_ShapedImage_getPixelColor(){ } void UnitTest::bench_ShapedImage_getImageData(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::SHAPEDIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::SHAPEDIMAGE); QBENCHMARK{ area->layerBundle[0].image->getImageData(); @@ -1375,7 +1375,7 @@ void UnitTest::bench_ShapedImage_getImageData(){ } void UnitTest::bench_ShapedImage_setImageData(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::SHAPEDIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::SHAPEDIMAGE); QImage img = area->layerBundle[0].image->getImageData(); QBENCHMARK{ @@ -1386,7 +1386,7 @@ void UnitTest::bench_ShapedImage_setImageData(){ } void UnitTest::bench_Circle_fullDraw(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); area->colorPicker.setFirstColor(QColor(255,255,255,255)); area->colorPicker.setSecondColor(QColor(0,0,0,255)); area->createCircleTool(); @@ -1404,7 +1404,7 @@ void UnitTest::bench_Circle_fullDraw(){ } void UnitTest::bench_Circle_interruptedDraw(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); area->colorPicker.setFirstColor(QColor(255,255,255,255)); area->colorPicker.setSecondColor(QColor(0,0,0,255)); area->createCircleTool(); @@ -1425,7 +1425,7 @@ void UnitTest::bench_Circle_interruptedDraw(){ void UnitTest::bench_FloodFill_fullDraw(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); area->colorPicker.setFirstColor(QColor(255,255,255,255)); area->colorPicker.setSecondColor(QColor(0,0,0,255)); area->createFloodFillTool(); @@ -1443,7 +1443,7 @@ void UnitTest::bench_FloodFill_fullDraw(){ } void UnitTest::bench_FloodFill_interruptedDraw(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); area->colorPicker.setFirstColor(QColor(255,255,255,255)); area->colorPicker.setSecondColor(QColor(0,0,0,255)); area->createFloodFillTool(); @@ -1464,7 +1464,7 @@ void UnitTest::bench_FloodFill_interruptedDraw(){ void UnitTest::bench_Line_fullDraw(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); area->colorPicker.setFirstColor(QColor(255,255,255,255)); area->colorPicker.setSecondColor(QColor(0,0,0,255)); area->createLineTool(); @@ -1482,7 +1482,7 @@ void UnitTest::bench_Line_fullDraw(){ } void UnitTest::bench_Line_interruptedDraw(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); area->colorPicker.setFirstColor(QColor(255,255,255,255)); area->colorPicker.setSecondColor(QColor(0,0,0,255)); area->createLineTool(); @@ -1503,7 +1503,7 @@ void UnitTest::bench_Line_interruptedDraw(){ } void UnitTest::bench_Pen_fullDraw(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); area->colorPicker.setFirstColor(QColor(255,255,255,255)); area->colorPicker.setSecondColor(QColor(0,0,0,255)); area->createPenTool(); @@ -1521,7 +1521,7 @@ void UnitTest::bench_Pen_fullDraw(){ } void UnitTest::bench_Pen_interruptedDraw(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); area->colorPicker.setFirstColor(QColor(255,255,255,255)); area->colorPicker.setSecondColor(QColor(0,0,0,255)); area->createPenTool(); @@ -1541,7 +1541,7 @@ void UnitTest::bench_Pen_interruptedDraw(){ } void UnitTest::bench_Plain_fullDraw(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); area->colorPicker.setFirstColor(QColor(255,255,255,255)); area->colorPicker.setSecondColor(QColor(0,0,0,255)); area->createPlainTool(); @@ -1559,7 +1559,7 @@ void UnitTest::bench_Plain_fullDraw(){ } void UnitTest::bench_Plain_interruptedDraw(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); area->colorPicker.setFirstColor(QColor(255,255,255,255)); area->colorPicker.setSecondColor(QColor(0,0,0,255)); area->createPlainTool(); @@ -1587,14 +1587,6 @@ void UnitTest::bench_Polygon_fullDraw(){ QPoint(20,10) }; - std::vector test{ - QPoint(00,00), - QPoint(00,20), - QPoint(20,00), - QPoint(20,20), - QPoint(10,10) - }; - area->colorPicker.setFirstColor(QColor(255,255,255,255)); area->colorPicker.setSecondColor(QColor(0,0,0,255)); area->createPolygonTool(); @@ -1624,23 +1616,13 @@ void UnitTest::bench_Polygon_fullDraw(){ area->deleteLayer(0); } -/* + void UnitTest::bench_Polygon_interruptedDraw(){ area->addLayer(201,201,10,20,IntelliImage::ImageType::RASTERIMAGE); std::vector points{ - QPoint(100,000), - QPoint(000,100), - QPoint(100,200), - QPoint(200,100) + QPoint(100,000) }; - std::vector test{ - QPoint(000,000), - QPoint(000,200), - QPoint(200,000), - QPoint(200,200), - QPoint(100,100) - }; area->colorPicker.setFirstColor(QColor(255,255,255,255)); area->colorPicker.setSecondColor(QColor(0,0,0,255)); @@ -1650,18 +1632,6 @@ void UnitTest::bench_Polygon_interruptedDraw(){ QBENCHMARK{ area->Tool->onMouseLeftPressed(points[0].x(), points[0].y()); area->Tool->onMouseLeftReleased(points[0].x(), points[0].y()); - area->Tool->onMouseMoved(points[1].x(), points[1].y()); - - area->Tool->onMouseLeftPressed(points[1].x(), points[1].y()); - area->Tool->onMouseLeftReleased(points[1].x(), points[1].y()); - area->Tool->onMouseMoved(points[2].x(), points[2].y()); - - area->Tool->onMouseLeftPressed(points[2].x(), points[2].y()); - area->Tool->onMouseLeftReleased(points[2].x(), points[2].y()); - area->Tool->onMouseMoved(points[3].x(), points[3].y()); - - area->Tool->onMouseLeftPressed(points[3].x(), points[3].y()); - area->Tool->onMouseLeftReleased(points[3].x(), points[3].y()); area->Tool->onMouseRightPressed(points[0].x(), points[0].y()); area->Tool->onMouseRightReleased(points[0].x(), points[0].y()); @@ -1669,10 +1639,10 @@ void UnitTest::bench_Polygon_interruptedDraw(){ area->deleteLayer(0); } -*/ + void UnitTest::bench_Rectangle_fullDraw(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); area->colorPicker.setFirstColor(QColor(255,255,255,255)); area->colorPicker.setSecondColor(QColor(0,0,0,255)); area->createRectangleTool(); @@ -1691,7 +1661,7 @@ void UnitTest::bench_Rectangle_fullDraw(){ } void UnitTest::bench_Rectangle_interruptedDraw(){ - area->addLayer(200,400,10,20,IntelliImage::ImageType::RASTERIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::RASTERIMAGE); area->colorPicker.setFirstColor(QColor(255,255,255,255)); area->colorPicker.setSecondColor(QColor(0,0,0,255)); area->createRectangleTool();