Navigation Menu

Skip to content

Commit

Permalink
Added test for rounding
Browse files Browse the repository at this point in the history
  • Loading branch information
homann committed Sep 21, 2012
1 parent f059e6f commit dbbb3c3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/src/gui/testqgsscalecombobox.cpp
Expand Up @@ -82,12 +82,17 @@ void TestQgsScaleComboBox::basic()
QCOMPARE( s->scaleString(), QString( "42:1" ) );
QCOMPARE( s->scale(), ( double ) 42 );

// Testing conversion from illegal
// Testing rounding and conversion from illegal

l->setText( "" );
QTest::keyClicks( l, QLocale::system().toString( 0.24 ) );
QTest::keyClick( l, Qt::Key_Return );

l->setText( "" );
QTest::keyClicks( l, "1:x:2" );
QTest::keyClick( l, Qt::Key_Return );
QCOMPARE( s->scaleString(), QString( "42:1" ) );
QCOMPARE( s->scale(), ( double ) 42 );
QCOMPARE( s->scaleString(), QString( "1:4" ) );
QCOMPARE( s->scale(), ( double ) 0.25 );

};

Expand Down

0 comments on commit dbbb3c3

Please sign in to comment.