Skip to content

Commit

Permalink
test xy with pointAt
Browse files Browse the repository at this point in the history
  • Loading branch information
Koyaani authored and nyalldawson committed Nov 2, 2021
1 parent f9a0217 commit 60624d8
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/src/core/geometry/testqgscompoundcurve.cpp
Expand Up @@ -692,7 +692,7 @@ void TestQgsCompoundCurve::gettersSetters()
}


void TestQgsCompoundCurve::pointAt() // todo add tests with xy
void TestQgsCompoundCurve::pointAt()
{
QgsCompoundCurve cc;

Expand All @@ -711,21 +711,21 @@ void TestQgsCompoundCurve::pointAt() // todo add tests with xy
Qgis::VertexType type;
QVERIFY( !cc.pointAt( -1, p, type ) );
QVERIFY( !cc.pointAt( 11, p, type ) );

QVERIFY( cc.pointAt( 0, p, type ) );
QCOMPARE( p.z(), 3.0 );
QCOMPARE( p.m(), 4.0 );
QCOMPARE( p, QgsPoint( QgsWkbTypes::PointZM, 1, 2, 3, 4 ) );
QCOMPARE( type, Qgis::VertexType::Segment );

QVERIFY( cc.pointAt( 1, p, type ) );
QCOMPARE( p.z(), 13.0 );
QCOMPARE( p.m(), 14.0 );
QCOMPARE( p, QgsPoint( QgsWkbTypes::PointZM, 11, 12, 13, 14 ) );
QCOMPARE( type, Qgis::VertexType::Curve );

QVERIFY( cc.pointAt( 2, p, type ) );
QCOMPARE( p.z(), 23.0 );
QCOMPARE( p.m(), 24.0 );
QCOMPARE( p, QgsPoint( QgsWkbTypes::PointZM, 21, 22, 23, 24 ) );
QCOMPARE( type, Qgis::VertexType::Segment );

QVERIFY( cc.pointAt( 3, p, type ) );
QCOMPARE( p.z(), 13.0 );
QCOMPARE( p.m(), 14.0 );
QCOMPARE( p, QgsPoint( QgsWkbTypes::PointZM, 31, 22, 13, 14 ) );
QCOMPARE( type, Qgis::VertexType::Segment );
}

Expand Down

0 comments on commit 60624d8

Please sign in to comment.