Skip to content
Permalink
Browse files
add test for QgsMapToolEdit
  • Loading branch information
lbartoletti committed Apr 30, 2021
1 parent fc18428 commit f66d4b0a8ab9a85817161fa637afa1a06fa0db4c
Showing with 15 additions and 0 deletions.
  1. +15 −0 tests/src/gui/testqgsmaptooledit.cpp
@@ -35,6 +35,7 @@ class TestQgsMapToolEdit : public QObject
void cleanup(); // will be called after every testfunction.

void checkDefaultZValue();
void checkDefaultMValue();

private:
QgsMapCanvas *mCanvas = nullptr;
@@ -76,5 +77,19 @@ void TestQgsMapToolEdit::checkDefaultZValue()
QCOMPARE( tool->defaultZValue(), z_value_for_test );
}

void TestQgsMapToolEdit::checkDefaultMValue()
{
QgsSettings settings;
settings.remove( QStringLiteral( "/qgis/digitizing/default_m_value" ) );

QgsMapToolEdit *tool = new QgsMapToolEdit( mCanvas );
QCOMPARE( tool->defaultMValue(), Qgis::DEFAULT_M_COORDINATE );

double m_value_for_test = Qgis::DEFAULT_M_COORDINATE + 1;
settings.setValue( QStringLiteral( "/qgis/digitizing/default_m_value" ), m_value_for_test );

QCOMPARE( tool->defaultMValue(), m_value_for_test );
}

QGSTEST_MAIN( TestQgsMapToolEdit )
#include "testqgsmaptooledit.moc"

0 comments on commit f66d4b0

Please sign in to comment.