Skip to content
Permalink
Browse files

Add some qgsRound tests

  • Loading branch information
manisandro committed Oct 12, 2015
1 parent 468012a commit a9baeb114bdd48fe666bd30cbdd640ec74c397fa
Showing with 13 additions and 0 deletions.
  1. +13 −0 tests/src/core/testqgis.cpp
@@ -36,6 +36,7 @@ class TestQGis : public QObject
void permissiveToDouble();
void permissiveToInt();
void doubleToString();
void qgsround();

private:
QString mReport;
@@ -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.
You can’t perform that action at this time.