Skip to content
Permalink
Browse files
test
  • Loading branch information
vcloarec authored and nyalldawson committed Sep 14, 2021
1 parent 0937c49 commit ce7bc16a84e983763ec2b087563d10c62f7ff3e6
Showing with 27 additions and 0 deletions.
  1. +27 −0 tests/src/core/testqgsrectangle.cpp
@@ -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()

0 comments on commit ce7bc16

Please sign in to comment.