summaryrefslogtreecommitdiffstats
path: root/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp')
-rw-r--r--tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp b/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp
index a3f0915..258d8dc 100644
--- a/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp
+++ b/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp
@@ -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 @@ private slots:
void taskQTBUG_5008_textFromValueAndValidate();
void taskQTBUG_6670_selectAllWithPrefix();
+ void taskQTBUG_6496_fiddlingWithPrecision();
public slots:
void valueChangedHelper(const QString &);
@@ -1096,5 +1097,17 @@ void tst_QDoubleSpinBox::taskQTBUG_6670_selectAllWithPrefix()
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"