diff --git a/tests/src/app/testqgsmaptoolrotatefeature.cpp b/tests/src/app/testqgsmaptoolrotatefeature.cpp index 09563904291..c2d90c4a00c 100644 --- a/tests/src/app/testqgsmaptoolrotatefeature.cpp +++ b/tests/src/app/testqgsmaptoolrotatefeature.cpp @@ -89,10 +89,10 @@ void TestQgsMapToolRotateFeature::initTestCase() QgsProject::instance()->addMapLayers( QList() << mLayerBase ); mLayerBase->startEditing(); - QString wkt1 = QStringLiteral( "Polygon ((0 0, 0 1, 1 1, 1 0))" ); + QString wkt1 = QStringLiteral( "Polygon ((0 0, 0 1, 1 1, 1 0, 0 0))" ); QgsFeature f1; f1.setGeometry( QgsGeometry::fromWkt( wkt1 ) ); - QString wkt2 = QStringLiteral( "Polygon ((1.1 0, 1.1 5, 2.1 5, 2.1 0))" ); + QString wkt2 = QStringLiteral( "Polygon ((1.1 0, 1.1 5, 2.1 5, 2.1 0, 1.1 0))" ); QgsFeature f2; f2.setGeometry( QgsGeometry::fromWkt( wkt2 ) ); @@ -137,8 +137,8 @@ void TestQgsMapToolRotateFeature::testRotateFeature() utils.mouseMove( 2, 1 ); utils.mouseClick( 2, 1, Qt::LeftButton, Qt::KeyboardModifiers(), true ); - QCOMPARE( mLayerBase->getFeature( 1 ).geometry().asWkt( 2 ), QStringLiteral( "Polygon ((0.72 -0.17, 0.28 1.17, 1.17 0.72, 0.72 -0.17))" ) ); - QCOMPARE( mLayerBase->getFeature( 2 ).geometry().asWkt( 2 ), QStringLiteral( "Polygon ((1.1 0, 1.1 5, 2.1 5, 2.1 0))" ) ); + QCOMPARE( mLayerBase->getFeature( 1 ).geometry().asWkt( 2 ), QStringLiteral( "Polygon ((-0.17 0.28, 0.28 1.17, 1.17 0.72, 0.72 -0.17, -0.17 0.28))" ) ); + QCOMPARE( mLayerBase->getFeature( 2 ).geometry().asWkt( 2 ), QStringLiteral( "Polygon ((1.1 0, 1.1 5, 2.1 5, 2.1 0, 1.1 0))" ) ); mLayerBase->undoStack()->undo(); } @@ -155,8 +155,8 @@ void TestQgsMapToolRotateFeature::testRotateFeatureManualAnchor() utils.mouseMove( 2, 1 ); utils.mouseClick( 2, 1, Qt::LeftButton, Qt::KeyboardModifiers(), true ); - QCOMPARE( mLayerBase->getFeature( 1 ).geometry().asWkt( 2 ), QStringLiteral( "Polygon ((2.06 0.34, 0.87 1.1, 1.84 1.31, 2.06 0.34))" ) ); - QCOMPARE( mLayerBase->getFeature( 2 ).geometry().asWkt( 2 ), QStringLiteral( "Polygon ((1.1 0, 1.1 5, 2.1 5, 2.1 0))" ) ); + QCOMPARE( mLayerBase->getFeature( 1 ).geometry().asWkt( 2 ), QStringLiteral( "Polygon ((1.08 0.12, 0.87 1.1, 1.84 1.31, 2.06 0.34, 1.08 0.12))" ) ); + QCOMPARE( mLayerBase->getFeature( 2 ).geometry().asWkt( 2 ), QStringLiteral( "Polygon ((1.1 0, 1.1 5, 2.1 5, 2.1 0, 1.1 0))" ) ); mLayerBase->undoStack()->undo(); } @@ -177,8 +177,8 @@ void TestQgsMapToolRotateFeature::testCancelManualAnchor() utils.mouseMove( 2, 1 ); utils.mouseClick( 2, 1, Qt::LeftButton, Qt::KeyboardModifiers(), true ); - QCOMPARE( mLayerBase->getFeature( 1 ).geometry().asWkt( 2 ), QStringLiteral( "Polygon ((0.72 -0.17, 0.28 1.17, 1.17 0.72, 0.72 -0.17))" ) ); - QCOMPARE( mLayerBase->getFeature( 2 ).geometry().asWkt( 2 ), QStringLiteral( "Polygon ((1.1 0, 1.1 5, 2.1 5, 2.1 0))" ) ); + QCOMPARE( mLayerBase->getFeature( 1 ).geometry().asWkt( 2 ), QStringLiteral( "Polygon ((-0.17 0.28, 0.28 1.17, 1.17 0.72, 0.72 -0.17, -0.17 0.28))" ) ); + QCOMPARE( mLayerBase->getFeature( 2 ).geometry().asWkt( 2 ), QStringLiteral( "Polygon ((1.1 0, 1.1 5, 2.1 5, 2.1 0, 1.1 0))" ) ); mLayerBase->undoStack()->undo(); } @@ -199,12 +199,11 @@ void TestQgsMapToolRotateFeature::testRotateFeatureManualAnchorAfterStartRotate( utils.mouseMove( 2, 1 ); utils.mouseClick( 2, 1, Qt::LeftButton, Qt::KeyboardModifiers(), true ); - QCOMPARE( mLayerBase->getFeature( 1 ).geometry().asWkt( 2 ), QStringLiteral( "Polygon ((-5.06 5.63, -3.79 6.26, -4.11 5.32, -5.06 5.63))" ) ); - QCOMPARE( mLayerBase->getFeature( 2 ).geometry().asWkt( 2 ), QStringLiteral( "Polygon ((1.1 0, 1.1 5, 2.1 5, 2.1 0))" ) ); + QCOMPARE( mLayerBase->getFeature( 1 ).geometry().asWkt( 2 ), QStringLiteral( "Polygon ((-4.74 6.58, -3.79 6.26, -4.11 5.32, -5.06 5.63, -4.74 6.58))" ) ); + QCOMPARE( mLayerBase->getFeature( 2 ).geometry().asWkt( 2 ), QStringLiteral( "Polygon ((1.1 0, 1.1 5, 2.1 5, 2.1 0, 1.1 0))" ) ); mLayerBase->undoStack()->undo(); } - QGSTEST_MAIN( TestQgsMapToolRotateFeature ) #include "testqgsmaptoolrotatefeature.moc"