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

0 comments on commit 48b7c3d

Please sign in to comment.