Skip to content
Permalink
Browse files
test
  • Loading branch information
vcloarec authored and nyalldawson committed Nov 1, 2021
1 parent 788910e commit fadb0d5b9dc1e015641207ac674f8d45e16fdcb8
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 fadb0d5

Please sign in to comment.