Skip to content
Permalink
Browse files
use static method access
  • Loading branch information
Koyaani authored and nyalldawson committed Nov 4, 2021
1 parent abf542a commit 4f65754059f123fdaf302e894ba09e97bbb0c27e
Showing with 6 additions and 6 deletions.
  1. +6 −6 tests/src/core/testqgsexpression.cpp
@@ -4164,7 +4164,7 @@ class TestQgsExpression: public QObject
const QVariant t_float( 12345.001F );
const QVariant t_double( 12345.001 );

QLocale().setDefault( QLocale::English );
QLocale::setDefault( QLocale::English );

QCOMPARE( QgsExpression::formatPreviewString( t_int ), QStringLiteral( "12,345" ) );
QCOMPARE( QgsExpression::formatPreviewString( t_uint ), QStringLiteral( "12,345" ) );
@@ -4173,7 +4173,7 @@ class TestQgsExpression: public QObject
QCOMPARE( QgsExpression::formatPreviewString( t_float ), QStringLiteral( "12,345.0009765625" ) );
QCOMPARE( QgsExpression::formatPreviewString( t_double ), QStringLiteral( "12,345.001" ) );

QLocale().setDefault( QLocale::Italian );
QLocale::setDefault( QLocale::Italian );

QCOMPARE( QgsExpression::formatPreviewString( t_int ), QStringLiteral( "12.345" ) );
QCOMPARE( QgsExpression::formatPreviewString( t_uint ), QStringLiteral( "12.345" ) );
@@ -4182,7 +4182,7 @@ class TestQgsExpression: public QObject
QCOMPARE( QgsExpression::formatPreviewString( t_float ), QStringLiteral( "12.345,0009765625" ) );
QCOMPARE( QgsExpression::formatPreviewString( t_double ), QStringLiteral( "12.345,001" ) );

QLocale().setDefault( QLocale::English );
QLocale::setDefault( QLocale::English );

}

@@ -4684,7 +4684,7 @@ class TestQgsExpression: public QObject
t_ulong = 12346;
const QVariant t_double( 123456.801 );

QLocale().setDefault( QLocale::English );
QLocale::setDefault( QLocale::English );

qDebug() << QVariant( 123456.801 ).toString();

@@ -4694,15 +4694,15 @@ class TestQgsExpression: public QObject
QCOMPARE( QgsExpressionUtils::toLocalizedString( t_ulong ), QStringLiteral( "12,346" ) );
QCOMPARE( QgsExpressionUtils::toLocalizedString( t_double ), QStringLiteral( "123,456.801" ) );

QLocale().setDefault( QLocale::Italian );
QLocale::setDefault( QLocale::Italian );

QCOMPARE( QgsExpressionUtils::toLocalizedString( t_int ), QStringLiteral( "12.346" ) );
QCOMPARE( QgsExpressionUtils::toLocalizedString( t_uint ), QStringLiteral( "12.346" ) );
QCOMPARE( QgsExpressionUtils::toLocalizedString( t_long ), QStringLiteral( "12.346" ) );
QCOMPARE( QgsExpressionUtils::toLocalizedString( t_ulong ), QStringLiteral( "12.346" ) );
QCOMPARE( QgsExpressionUtils::toLocalizedString( t_double ), QStringLiteral( "123.456,801" ) );

QLocale().setDefault( QLocale::English );
QLocale::setDefault( QLocale::English );

QCOMPARE( QgsExpressionUtils::toLocalizedString( QString( "hello world" ) ), QStringLiteral( "hello world" ) );
}

0 comments on commit 4f65754

Please sign in to comment.