mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Merge pull request #4233 from myarjunar/test-toMapPixel
add unit test for toMapPoint function
This commit is contained in:
commit
e0979046a4
@ -29,6 +29,7 @@ class TestQgsMapToPixel: public QObject
|
||||
void rotation();
|
||||
void getters();
|
||||
void fromScale();
|
||||
void toMapPoint();
|
||||
};
|
||||
|
||||
void TestQgsMapToPixel::rotation()
|
||||
@ -106,6 +107,19 @@ void TestQgsMapToPixel::fromScale()
|
||||
QGSCOMPARENEAR( m2p.mapUnitsPerPixel(), 0.000265, 0.000001 );
|
||||
}
|
||||
|
||||
void TestQgsMapToPixel::toMapPoint()
|
||||
{
|
||||
QgsMapToPixel m2p( 1, 5, 5, 10, 10, 90 );
|
||||
QgsPoint p = m2p.toMapPoint( 5, 5 );
|
||||
QCOMPARE( p, QgsPoint( 5, 5 ) );
|
||||
|
||||
p = m2p.toMapPoint( 10, 10 );
|
||||
QCOMPARE( p, QgsPoint( 10, 10 ) );
|
||||
|
||||
p = m2p.toMapPoint( 20, 20 );
|
||||
QCOMPARE( p, QgsPoint( 20, 20 ) );
|
||||
}
|
||||
|
||||
QGSTEST_MAIN( TestQgsMapToPixel )
|
||||
#include "testqgsmaptopixel.moc"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user