summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/dialogs/qprogressdialog
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@digia.com>2013-05-14 13:46:12 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-05-15 05:06:15 +0200
commit69c05bbef47fb9d30d70e594bd5942add8b135fe (patch)
tree19449954af658a6d710d89af13382d57cc8a1b51 /tests/auto/widgets/dialogs/qprogressdialog
parent252cba3cd506ce2118ae65a3fc9eb1efe8f23a4f (diff)
QtWidgets: avoid integer divide by zero in QProgressDialog
Autotest is included. Task-number: QTBUG-31046 Change-Id: Ie549b59112f458de478294fa00443a3cf6898c85 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'tests/auto/widgets/dialogs/qprogressdialog')
-rw-r--r--tests/auto/widgets/dialogs/qprogressdialog/tst_qprogressdialog.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/auto/widgets/dialogs/qprogressdialog/tst_qprogressdialog.cpp b/tests/auto/widgets/dialogs/qprogressdialog/tst_qprogressdialog.cpp
index d49f356d8c..68502f0d8d 100644
--- a/tests/auto/widgets/dialogs/qprogressdialog/tst_qprogressdialog.cpp
+++ b/tests/auto/widgets/dialogs/qprogressdialog/tst_qprogressdialog.cpp
@@ -46,6 +46,7 @@
#include <qdebug.h>
#include <qprogressdialog.h>
#include <qlabel.h>
+#include <qthread.h>
class tst_QProgressDialog : public QObject
{
@@ -58,6 +59,7 @@ public:
private slots:
void getSetCheck();
void task198202();
+ void QTBUG_31046();
};
tst_QProgressDialog::tst_QProgressDialog()
@@ -149,5 +151,14 @@ void tst_QProgressDialog::task198202()
QCOMPARE(dlg.sizeHint().height(), futureHeight);
}
+void tst_QProgressDialog::QTBUG_31046()
+{
+ QProgressDialog dlg("", "", 50, 60);
+ dlg.setValue(0);
+ QThread::msleep(200);
+ dlg.setValue(50);
+ QCOMPARE(50, dlg.value());
+}
+
QTEST_MAIN(tst_QProgressDialog)
#include "tst_qprogressdialog.moc"