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 0937c49 commit ce7bc16
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/src/core/testqgsrectangle.cpp
Expand Up @@ -286,6 +286,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 ce7bc16

Please sign in to comment.