mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
fix testqgis
This commit is contained in:
parent
fdce0ac8cd
commit
e2e7e365e2
@ -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 );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user