Skip to content

Commit

Permalink
More robust test for numeric scale bar
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Apr 26, 2017
1 parent b40bc0c commit fa21311
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/src/core/testqgscomposerscalebar.cpp
Expand Up @@ -179,11 +179,19 @@ void TestQgsComposerScaleBar::doubleBox()

void TestQgsComposerScaleBar::numeric()
{
QFont f = mComposerScaleBar->font();

QFont newFont = QgsFontUtils::getStandardTestFont( QStringLiteral( "Bold" ) );
newFont.setPointSizeF( 12 );
mComposerScaleBar->setFont( newFont );

mComposerScaleBar->setStyle( QStringLiteral( "Numeric" ) );
mComposerScaleBar->setSceneRect( QRectF( 20, 180, 50, 20 ) );
QgsCompositionChecker checker( QStringLiteral( "composerscalebar_numeric" ), mComposition );
checker.setControlPathPrefix( QStringLiteral( "composer_scalebar" ) );
QVERIFY( checker.testComposition( mReport, 0, 0 ) );
bool result = checker.testComposition( mReport, 0, 0 );
mComposerScaleBar->setFont( f );
QVERIFY( result );
}

void TestQgsComposerScaleBar::tick()
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.

0 comments on commit fa21311

Please sign in to comment.