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
36
36
void permissiveToDouble ();
37
37
void permissiveToInt ();
38
38
void doubleToString ();
39
+ void qgsround ();
39
40
40
41
private:
41
42
QString mReport ;
@@ -136,5 +137,17 @@ void TestQGis::doubleToString()
136
137
QCOMPARE ( qgsDoubleToString ( 12345 , -1 ), QString ( " 12345" ) );
137
138
}
138
139
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
+
139
152
QTEST_MAIN ( TestQGis )
140
153
#include " testqgis.moc"
You can’t perform that action at this time.
0 commit comments