Skip to content

Commit d55f7a7

Browse files
authoredMar 28, 2023
add test
1 parent 4bc7fab commit d55f7a7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 

‎tests/src/gui/testqgsscalecombobox.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "qgsapplication.h"
1919
#include "qgslogger.h"
2020
#include "qgsscalecombobox.h"
21+
#include "qgssettingsregistrycore.h"
2122
#include <QObject>
2223
#include <QLineEdit>
2324
#include <QComboBox>
@@ -70,6 +71,14 @@ void TestQgsScaleComboBox::init()
7071

7172
void TestQgsScaleComboBox::basic()
7273
{
74+
const QStringList scales = QgsSettingsRegistryCore::settingsMapScales->value();
75+
QCOMPARE( scales.count(), s->count() );
76+
for ( int i = 0; i < s->count(); i++ )
77+
{
78+
int denominator = QLocale().toInt( scales[i].split( ':' )[1] );
79+
QCOMPARE( s->itemText( i ), QString( "1:%1" ).arg( QLocale().toString( denominator ) ) );
80+
}
81+
7382
// Testing conversion from "1:nnn".
7483
enterScale( QStringLiteral( "1:2345" ) );
7584
QCOMPARE( s->scaleString(), QString( "1:%1" ).arg( QLocale().toString( 2345 ) ) );

0 commit comments

Comments
 (0)
Please sign in to comment.