File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ class TestQGis : public QObject
3636 void permissiveToDouble ();
3737 void permissiveToInt ();
3838 void doubleToString ();
39+ void qgsround ();
3940
4041 private:
4142 QString mReport ;
@@ -136,5 +137,17 @@ void TestQGis::doubleToString()
136137 QCOMPARE ( qgsDoubleToString ( 12345 , -1 ), QString ( " 12345" ) );
137138}
138139
140+ void TestQGis::qgsround ()
141+ {
142+ QCOMPARE ( qgsRound ( 3.141592653589793 ), 3 . );
143+ QCOMPARE ( qgsRound ( 2.718281828459045 ), 3 . );
144+ QCOMPARE ( qgsRound ( -3.141592653589793 ), -3 . );
145+ QCOMPARE ( qgsRound ( -2.718281828459045 ), -3 . );
146+ QCOMPARE ( qgsRound ( 314159265358979.3 ), 314159265358979 . );
147+ QCOMPARE ( qgsRound ( 2718281828459.045 ), 2718281828459 . );
148+ QCOMPARE ( qgsRound ( -314159265358979.3 ), -314159265358979 . );
149+ QCOMPARE ( qgsRound ( -2718281828459.045 ), -2718281828459 . );
150+ }
151+
139152QTEST_MAIN ( TestQGis )
140153#include " testqgis.moc"
You can’t perform that action at this time.
0 commit comments