summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2011-02-20 14:37:06 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2011-02-20 14:44:51 (GMT)
commit13e9642616ab480d09bda2603cc89dcaea7a1ad6 (patch)
tree4eb96a80880b9e4a64887a85a63d78106edc97c9
parentef06cbef2e3240d49848f398b2d19adbbea1e781 (diff)
downloadQt-13e9642616ab480d09bda2603cc89dcaea7a1ad6.zip
Qt-13e9642616ab480d09bda2603cc89dcaea7a1ad6.tar.gz
Qt-13e9642616ab480d09bda2603cc89dcaea7a1ad6.tar.bz2
Autotest: make at least one update before checking if more are needed
The timer gets started only by making updates. If you try to check if an update is needed without making the first update, the timer won't be started and the function will return false.
-rw-r--r--tests/auto/qfuturewatcher/tst_qfuturewatcher.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/auto/qfuturewatcher/tst_qfuturewatcher.cpp b/tests/auto/qfuturewatcher/tst_qfuturewatcher.cpp
index 2ca1a47..9875fb5 100644
--- a/tests/auto/qfuturewatcher/tst_qfuturewatcher.cpp
+++ b/tests/auto/qfuturewatcher/tst_qfuturewatcher.cpp
@@ -484,8 +484,6 @@ class ProgressTextTask : public RunFunctionTask<T>
public:
void runFunctor()
{
- while (this->isProgressUpdateNeeded() == false)
- QTest::qSleep(1);
this->setProgressValueAndText(1, QLatin1String("Foo 1"));
while (this->isProgressUpdateNeeded() == false)
@@ -495,6 +493,10 @@ public:
while (this->isProgressUpdateNeeded() == false)
QTest::qSleep(1);
this->setProgressValueAndText(3, QLatin1String("Foo 3"));
+
+ while (this->isProgressUpdateNeeded() == false)
+ QTest::qSleep(1);
+ this->setProgressValueAndText(4, QLatin1String("Foo 4"));
}
};
@@ -522,14 +524,16 @@ void tst_QFutureWatcher::progressText()
QTestEventLoop::instance().enterLoop(5);
QVERIFY(!QTestEventLoop::instance().timeout());
- QCOMPARE(f.progressText(), QLatin1String("Foo 3"));
- QCOMPARE(f.progressValue(), 3);
+ QCOMPARE(f.progressText(), QLatin1String("Foo 4"));
+ QCOMPARE(f.progressValue(), 4);
QVERIFY(progressValues.contains(1));
QVERIFY(progressValues.contains(2));
QVERIFY(progressValues.contains(3));
+ QVERIFY(progressValues.contains(4));
QVERIFY(progressTexts.contains(QLatin1String("Foo 1")));
QVERIFY(progressTexts.contains(QLatin1String("Foo 2")));
QVERIFY(progressTexts.contains(QLatin1String("Foo 3")));
+ QVERIFY(progressTexts.contains(QLatin1String("Foo 4")));
}
}