fix testqgis

This commit is contained in:
Juergen E. Fischer 2015-07-01 09:46:18 +02:00
parent fdce0ac8cd
commit e2e7e365e2

View File

@ -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 );
}