Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport 55371 to release 3 34 test #148

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Adapt backport of 55371 to release-3_34
Remove test non suitable for 3.34
agiudiceandrea authored Dec 19, 2023
commit 1f133b3c845878eea2d24be3f440792db704b9ad
50 changes: 0 additions & 50 deletions tests/src/app/testqgsmaptooladdring.cpp
Original file line number Diff line number Diff line change
@@ -41,7 +41,6 @@ class TestQgsMapToolAddRing: public QObject
void cleanupTestCase();// will be called after the last testfunction was executed.

void testAddRing();
void testAddRingClockWise();

private:
QPoint mapToPoint( double x, double y );
@@ -164,54 +163,5 @@ void TestQgsMapToolAddRing::testAddRing()
const QString wkt = "MultiPolygon (((0 0, 5 0, 5 5, 0 5, 0 0),(1 1, 1 2, 2 2, 2 1, 1 1)))";
QCOMPARE( mLayerMultiPolygon->getFeature( 1 ).geometry().asWkt(), wkt );
}

void TestQgsMapToolAddRing::testAddRingClockWise()
{
mLayerMultiPolygon->select( 1 );

// Draw in clockwise
std::unique_ptr< QgsMapMouseEvent > event( new QgsMapMouseEvent(
mCanvas,
QEvent::MouseButtonRelease,
mapToPoint( 3, 3 ),
Qt::LeftButton
) );
mCaptureTool->cadCanvasReleaseEvent( event.get() );

event.reset( new QgsMapMouseEvent(
mCanvas,
QEvent::MouseButtonRelease,
mapToPoint( 4, 3 ),
Qt::LeftButton
) );
mCaptureTool->cadCanvasReleaseEvent( event.get() );

event.reset( new QgsMapMouseEvent(
mCanvas,
QEvent::MouseButtonRelease,
mapToPoint( 4, 4 ),
Qt::LeftButton
) );
mCaptureTool->cadCanvasReleaseEvent( event.get() );

event.reset( new QgsMapMouseEvent(
mCanvas,
QEvent::MouseButtonRelease,
mapToPoint( 3, 4 ),
Qt::LeftButton
) );
mCaptureTool->cadCanvasReleaseEvent( event.get() );

event.reset( new QgsMapMouseEvent(
mCanvas,
QEvent::MouseButtonRelease,
mapToPoint( 3, 3 ),
Qt::RightButton
) );
mCaptureTool->cadCanvasReleaseEvent( event.get() );

const QString wkt = "MultiPolygon (((0 0, 5 0, 5 5, 0 5, 0 0),(1 1, 1 2, 2 2, 2 1, 1 1),(3 3, 3 4, 4 4, 4 3, 3 3)))";
QCOMPARE( mLayerMultiPolygon->getFeature( 1 ).geometry().asWkt(), wkt );
}
QGSTEST_MAIN( TestQgsMapToolAddRing )
#include "testqgsmaptooladdring.moc"