Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids authored and github-actions[bot] committed Mar 28, 2023
1 parent 01868a6 commit f30c8f0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/src/gui/testqgsscalecombobox.cpp
Expand Up @@ -18,6 +18,7 @@
#include "qgsapplication.h"
#include "qgslogger.h"
#include "qgsscalecombobox.h"
#include "qgssettingsregistrycore.h"
#include <QObject>
#include <QLineEdit>
#include <QComboBox>
Expand Down Expand Up @@ -70,6 +71,14 @@ void TestQgsScaleComboBox::init()

void TestQgsScaleComboBox::basic()
{
const QStringList scales = QgsSettingsRegistryCore::settingsMapScales->value();
QCOMPARE( scales.count(), s->count() );
for ( int i = 0; i < s->count(); i++ )
{
int denominator = QLocale().toInt( scales[i].split( ':' )[1] );
QCOMPARE( s->itemText( i ), QString( "1:%1" ).arg( QLocale().toString( denominator ) ) );
}

// Testing conversion from "1:nnn".
enterScale( QStringLiteral( "1:2345" ) );
QCOMPARE( s->scaleString(), QString( "1:%1" ).arg( QLocale().toString( 2345 ) ) );
Expand Down

0 comments on commit f30c8f0

Please sign in to comment.