From ede24aab6793fc524a4660a8d092309a82a5ccff Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Thu, 6 Aug 2009 10:47:00 +0200 Subject: Q3ProgressBar autotest fixed on mac - We need to process events in order to leave time to mac to update the widget. - When in undefined case, the progressbar is animated, so the number of paintevents might be bigger than 1. --- tests/auto/q3progressbar/tst_q3progressbar.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/auto/q3progressbar/tst_q3progressbar.cpp b/tests/auto/q3progressbar/tst_q3progressbar.cpp index 0378d15..549c8a4 100644 --- a/tests/auto/q3progressbar/tst_q3progressbar.cpp +++ b/tests/auto/q3progressbar/tst_q3progressbar.cpp @@ -102,7 +102,7 @@ void tst_Q3ProgressBar::setProgress() { MyCustomProgressBar * m_progressBar = new MyCustomProgressBar(); m_progressBar->show(); - QTest::qWait(500); + QApplication::processEvents(); //case with total steps = 0 m_progressBar->setTotalSteps(0); @@ -110,15 +110,16 @@ void tst_Q3ProgressBar::setProgress() m_progressBar->paintNumber = 0; m_progressBar->setProgress(m_progressBar->progress() + 1); QCOMPARE(oldValue + 1,m_progressBar->progress()); - QCOMPARE(m_progressBar->paintNumber,1); + QApplication::processEvents(); + QVERIFY(m_progressBar->paintNumber >= 1); //it might be more than 1 because it is animated //standard case m_progressBar->setTotalSteps(3); m_progressBar->setProgress(0); m_progressBar->paintNumber = 0; m_progressBar->setProgress(m_progressBar->progress() + 1); + QApplication::processEvents(); QCOMPARE(m_progressBar->paintNumber,1); - } QTEST_MAIN(tst_Q3ProgressBar) -- cgit v0.12