Skip to content
Permalink
Browse files

Added test for rounding

  • Loading branch information
homann committed Sep 21, 2012
1 parent f059e6f commit dbbb3c35beaf3a449cccfeaeb56e60a1868db2e0
Showing with 8 additions and 3 deletions.
  1. +8 −3 tests/src/gui/testqgsscalecombobox.cpp
@@ -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 );

};

0 comments on commit dbbb3c3

Please sign in to comment.
You can’t perform that action at this time.