Skip to content

Commit

Permalink
add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
Koyaani committed Nov 25, 2021
1 parent bea1f8e commit dd16be5
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/src/core/geometry/testqgsmultisurface.cpp
Expand Up @@ -39,6 +39,7 @@ class TestQgsMultiSurface: public QObject
void addGeometryM();
void addGeometryZM();
void insertGeometry();
void surfaceN();
void assignment();
void clone();
void copy();
Expand Down Expand Up @@ -463,6 +464,29 @@ void TestQgsMultiSurface::insertGeometry()
QCOMPARE( ms.numGeometries(), 1 );
}

void TestQgsMultiSurface::surfaceN()
{
QgsMultiSurface ms;
QgsCurvePolygon part;
QgsCircularString ring;

ring.setPoints( QgsPointSequence() << QgsPoint( 1, 10 )
<< QgsPoint( 2, 11 ) << QgsPoint( 1, 10 ) );
part.setExteriorRing( ring.clone() );
ms.addGeometry( part.clone() );

part.clear();
ring.setPoints( QgsPointSequence() << QgsPoint( 9, 12 )
<< QgsPoint( 3, 13 ) << QgsPoint( 9, 12 ) );
part.setExteriorRing( ring.clone() );
ms.addGeometry( part.clone() );

QCOMPARE( *ms.geometryN( 0 ), *ms.surfaceN( 0 ) );
QCOMPARE( *ms.geometryN( 0 ), *std::as_const( ms ).surfaceN( 0 ) );
QCOMPARE( *ms.geometryN( 1 ), *ms.surfaceN( 1 ) );
QCOMPARE( *ms.geometryN( 1 ), *std::as_const( ms ).surfaceN( 1 ) );
}

void TestQgsMultiSurface::assignment()
{
QgsMultiSurface ms1;
Expand Down

0 comments on commit dd16be5

Please sign in to comment.