Skip to content
Permalink
Browse files

fix testqgis

  • Loading branch information
jef-n committed Jul 1, 2015
1 parent fdce0ac commit e2e7e365e21762bdd1d8843f3b24221814f2b486
Showing with 5 additions and 5 deletions.
  1. +5 −5 tests/src/core/testqgis.cpp
@@ -68,15 +68,15 @@ void TestQGis::permissiveToDouble()
QVERIFY( ok );
QCOMPARE( result, 1000.0 );
ok = false;
result = QGis::permissiveToDouble( QString( "1%01000" ).arg( QLocale::system().groupSeparator() ), ok );
result = QGis::permissiveToDouble( QString( "1" ) + QLocale::system().groupSeparator() + "000", ok );
QVERIFY( ok );
QCOMPARE( result, 1000.0 );
ok = false;
result = QGis::permissiveToDouble( QString( "5.5" ), ok );
result = QGis::permissiveToDouble( QString( "5" ) + QLocale::system().decimalPoint() + "5", ok );
QVERIFY( ok );
QCOMPARE( result, 5.5 );
ok = false;
result = QGis::permissiveToDouble( QString( "1%01000.5" ).arg( QLocale::system().groupSeparator() ), ok );
result = QGis::permissiveToDouble( QString( "1" ) + QLocale::system().groupSeparator() + "000" + QLocale::system().decimalPoint() + "5", ok );
QVERIFY( ok );
QCOMPARE( result, 1000.5 );

@@ -87,11 +87,11 @@ void TestQGis::permissiveToDouble()

//messy input (invalid thousand separator position), should still be converted
ok = false;
result = QGis::permissiveToDouble( QString( "10%0100" ).arg( QLocale::system().groupSeparator() ), ok );
result = QGis::permissiveToDouble( QString( "10" ) + QLocale::system().groupSeparator() + "00", ok );
QVERIFY( ok );
QCOMPARE( result, 1000.0 );
ok = false;
result = QGis::permissiveToDouble( QString( "10%0100.5" ).arg( QLocale::system().groupSeparator() ), ok );
result = QGis::permissiveToDouble( QString( "10" ) + QLocale::system().groupSeparator() + "00" + QLocale::system().decimalPoint() + "5", ok );
QVERIFY( ok );
QCOMPARE( result, 1000.5 );
}

0 comments on commit e2e7e36

Please sign in to comment.
You can’t perform that action at this time.