Skip to content
Permalink
Browse files

add unit test for scale

  • Loading branch information
pblottiere committed May 18, 2016
1 parent d23a110 commit f15197da730d44dcb883b131c2d89eebee34ee18
Showing with 16 additions and 0 deletions.
  1. +16 −0 tests/src/gui/testqgsmapcanvas.cpp
@@ -49,6 +49,7 @@ class TestQgsMapCanvas : public QObject
void testPanByKeyboard();
void testMagnification();
void testMagnificationExtent();
void testMagnificationScale();

private:
QgsMapCanvas* mCanvas;
@@ -344,5 +345,20 @@ void TestQgsMapCanvas::testMagnificationExtent()
compareExtent( mCanvas->extent(), initialExtent );
}

void TestQgsMapCanvas::testMagnificationScale()
{
mCanvas->setMagnificationFactor( 1.0 );
double initialScale = mCanvas->scale();

mCanvas->setMagnificationFactor( 4.0 );
QCOMPARE( initialScale, mCanvas->scale() );

mCanvas->setMagnificationFactor( 7.5 );
QCOMPARE( initialScale, mCanvas->scale() );

mCanvas->setMagnificationFactor( 1.0 );
QCOMPARE( initialScale, mCanvas->scale() );
}

QTEST_MAIN( TestQgsMapCanvas )
#include "testqgsmapcanvas.moc"

0 comments on commit f15197d

Please sign in to comment.
You can’t perform that action at this time.