Skip to content

Commit

Permalink
Fix failing composer scale bar test on less common locales
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Jan 4, 2016
1 parent 7b2298e commit 215ba22
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/src/core/testqgscomposerscalebar.cpp
Expand Up @@ -25,6 +25,8 @@
#include "qgsmultibandcolorrenderer.h"
#include "qgsrasterlayer.h"
#include "qgsfontutils.h"

#include <QLocale>
#include <QObject>
#include <QtTest/QtTest>

Expand Down Expand Up @@ -67,6 +69,12 @@ void TestQgsComposerScaleBar::initTestCase()
QgsApplication::init();
QgsApplication::initQgis();

// the scale denominator is formatted in a locale aware manner
// so 10000 is rendered as "10,000" in C (or en_US) locale, however
// other locales may render the number differently (e.g. "10 000" in cs_CZ)
// so we enforce C locale to make sure we get expected result
QLocale::setDefault( QLocale::c() );

mMapSettings = new QgsMapSettings();

//create maplayers from testdata and add to layer registry
Expand Down

0 comments on commit 215ba22

Please sign in to comment.