Skip to content

Commit

Permalink
Add some qgsRound tests
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Oct 12, 2015
1 parent 468012a commit a9baeb1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/src/core/testqgis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class TestQGis : public QObject
void permissiveToDouble();
void permissiveToInt();
void doubleToString();
void qgsround();

private:
QString mReport;
Expand Down Expand Up @@ -136,5 +137,17 @@ void TestQGis::doubleToString()
QCOMPARE( qgsDoubleToString( 12345, -1 ), QString( "12345" ) );
}

void TestQGis::qgsround()
{
QCOMPARE( qgsRound( 3.141592653589793 ), 3. );
QCOMPARE( qgsRound( 2.718281828459045 ), 3. );
QCOMPARE( qgsRound( -3.141592653589793 ), -3. );
QCOMPARE( qgsRound( -2.718281828459045 ), -3. );
QCOMPARE( qgsRound( 314159265358979.3 ), 314159265358979. );
QCOMPARE( qgsRound( 2718281828459.045 ), 2718281828459. );
QCOMPARE( qgsRound( -314159265358979.3 ), -314159265358979. );
QCOMPARE( qgsRound( -2718281828459.045 ), -2718281828459. );
}

QTEST_MAIN( TestQGis )
#include "testqgis.moc"

0 comments on commit a9baeb1

Please sign in to comment.