Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
vcloarec authored and nyalldawson committed Sep 14, 2021
1 parent d9f9f9e commit 48b7c3d
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/src/core/geometry/testqgsrectangle.cpp
Expand Up @@ -372,6 +372,33 @@ void TestQgsRectangle::include()
QCOMPARE( rect1.xMaximum(), 115.0 );
QCOMPARE( rect1.yMaximum(), 242.0 );

rect1.setMinimal();

rect1.include( QgsPointXY( 15, 50 ) );
QCOMPARE( rect1.xMinimum(), 15.0 );
QCOMPARE( rect1.yMinimum(), 50.0 );
QCOMPARE( rect1.xMaximum(), 15.0 );
QCOMPARE( rect1.yMaximum(), 50.0 );

rect1.include( QgsPointXY( 5, 30 ) );
QCOMPARE( rect1.xMinimum(), 5.0 );
QCOMPARE( rect1.yMinimum(), 30.0 );
QCOMPARE( rect1.xMaximum(), 15.0 );
QCOMPARE( rect1.yMaximum(), 50.0 );

rect1.setMinimal();

rect1.include( QgsPointXY( 5, 30 ) );
QCOMPARE( rect1.xMinimum(), 5.0 );
QCOMPARE( rect1.yMinimum(), 30.0 );
QCOMPARE( rect1.xMaximum(), 5.0 );
QCOMPARE( rect1.yMaximum(), 30.0 );

rect1.include( QgsPointXY( 15, 50 ) );
QCOMPARE( rect1.xMinimum(), 5.0 );
QCOMPARE( rect1.yMinimum(), 30.0 );
QCOMPARE( rect1.xMaximum(), 15.0 );
QCOMPARE( rect1.yMaximum(), 50.0 );
}

void TestQgsRectangle::buffered()
Expand Down

0 comments on commit 48b7c3d

Please sign in to comment.