tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp
branchRCL_3
changeset 4 3b1da2848fc7
parent 3 41300fa6a67c
--- a/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp	Tue Feb 02 00:43:10 2010 +0200
+++ b/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp	Fri Feb 19 23:40:16 2010 +0200
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
 ** All rights reserved.
 ** Contact: Nokia Corporation (qt-info@nokia.com)
 **
@@ -149,6 +149,7 @@
 
     void taskQTBUG_5008_textFromValueAndValidate();
     void taskQTBUG_6670_selectAllWithPrefix();
+    void taskQTBUG_6496_fiddlingWithPrecision();
 
 public slots:
     void valueChangedHelper(const QString &);
@@ -1096,5 +1097,17 @@
     QCOMPARE(spin.value(), 12.);
 }
 
+void tst_QDoubleSpinBox::taskQTBUG_6496_fiddlingWithPrecision()
+{
+    QDoubleSpinBox dsb;
+    dsb.setRange(0, 0.991);
+    dsb.setDecimals(1);
+    QCOMPARE(dsb.maximum(), 1.0);
+    dsb.setDecimals(2);
+    QCOMPARE(dsb.maximum(), 0.99);
+    dsb.setDecimals(3);
+    QCOMPARE(dsb.maximum(), 0.991);
+}
+
 QTEST_MAIN(tst_QDoubleSpinBox)
 #include "tst_qdoublespinbox.moc"