diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-06 04:58:15 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-06 04:58:15 (GMT) |
commit | 5df9e8ced092f6f61b712d6f8ffaea7bc0041222 (patch) | |
tree | 59ecacb7f935494ee9df845637bc40e145c2143a /tests | |
parent | c96047c0495c58b56a73873fd235ce859e0e9255 (diff) | |
parent | 281d95827bdce97727ed56049bd4afbac917ee91 (diff) | |
download | Qt-5df9e8ced092f6f61b712d6f8ffaea7bc0041222.zip Qt-5df9e8ced092f6f61b712d6f8ffaea7bc0041222.tar.gz Qt-5df9e8ced092f6f61b712d6f8ffaea7bc0041222.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-multimedia-staging into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/qt-multimedia-staging:
Remove qWait functions as it is used in QTRY_* macros.
QAudioInput: possible change of state without emitting stateChange()
Did not include updated repaint number for parent item in revert.
Partially revert "Remove qWait functions as it is used in QTRY_* macros."
Remove qWait functions as it is used in QTRY_* macros.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp | 36 | ||||
-rw-r--r-- | tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 23 |
2 files changed, 23 insertions, 36 deletions
diff --git a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp index 49b840f..dbd4a23 100644 --- a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp +++ b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp @@ -277,9 +277,8 @@ void tst_QGraphicsEffect::draw() // Make sure installing the effect triggers a repaint. CustomEffect *effect = new CustomEffect; item->setGraphicsEffect(effect); - QTest::qWait(50); - QCOMPARE(effect->numRepaints, 1); - QCOMPARE(item->numRepaints, 1); + QTRY_COMPARE(effect->numRepaints, 1); + QTRY_COMPARE(item->numRepaints, 1); // Make sure QPainter* and QStyleOptionGraphicsItem* stays persistent // during QGraphicsEffect::draw/QGraphicsItem::paint. @@ -293,26 +292,23 @@ void tst_QGraphicsEffect::draw() // Make sure updating the source triggers a repaint. item->update(); - QTest::qWait(50); - QCOMPARE(effect->numRepaints, 1); - QCOMPARE(item->numRepaints, 1); + QTRY_COMPARE(effect->numRepaints, 1); + QTRY_COMPARE(item->numRepaints, 1); QVERIFY(effect->m_sourceChangedFlags & QGraphicsEffect::SourceInvalidated); effect->reset(); item->reset(); // Make sure changing the effect's bounding rect triggers a repaint. effect->setMargin(20); - QTest::qWait(50); - QCOMPARE(effect->numRepaints, 1); - QCOMPARE(item->numRepaints, 1); + QTRY_COMPARE(effect->numRepaints, 1); + QTRY_COMPARE(item->numRepaints, 1); effect->reset(); item->reset(); // Make sure change the item's bounding rect triggers a repaint. item->setRect(0, 0, 50, 50); - QTest::qWait(50); - QCOMPARE(effect->numRepaints, 1); - QCOMPARE(item->numRepaints, 1); + QTRY_COMPARE(effect->numRepaints, 1); + QTRY_COMPARE(item->numRepaints, 1); QVERIFY(effect->m_sourceChangedFlags & QGraphicsEffect::SourceBoundingRectChanged); effect->reset(); item->reset(); @@ -320,8 +316,7 @@ void tst_QGraphicsEffect::draw() // Make sure the effect is the one to issue a repaint of the item. effect->doNothingInDraw = true; item->update(); - QTest::qWait(50); - QCOMPARE(effect->numRepaints, 1); + QTRY_COMPARE(effect->numRepaints, 1); QCOMPARE(item->numRepaints, 0); effect->doNothingInDraw = false; effect->reset(); @@ -336,9 +331,8 @@ void tst_QGraphicsEffect::draw() item->reset(); effect->setEnabled(true); - QTest::qWait(50); - QCOMPARE(effect->numRepaints, 1); - QCOMPARE(item->numRepaints, 1); + QTRY_COMPARE(effect->numRepaints, 1); + QTRY_COMPARE(item->numRepaints, 1); effect->reset(); item->reset(); @@ -352,8 +346,7 @@ void tst_QGraphicsEffect::draw() QPointer<CustomEffect> ptr = effect; item->setGraphicsEffect(0); QVERIFY(!ptr); - QTest::qWait(50); - QCOMPARE(item->numRepaints, 1); + QTRY_COMPARE(item->numRepaints, 1); } void tst_QGraphicsEffect::opacity() @@ -515,7 +508,6 @@ void tst_QGraphicsEffect::drawPixmapItem() QTRY_VERIFY(effect->repaints >= 1); item->rotate(180); - QTest::qWait(50); QTRY_VERIFY(effect->repaints >= 2); } @@ -560,9 +552,8 @@ void tst_QGraphicsEffect::deviceCoordinateTranslateCaching() int numRepaints = item->numRepaints; item->translate(10, 0); - QTest::qWait(50); - QVERIFY(item->numRepaints == numRepaints); + QTRY_VERIFY(item->numRepaints == numRepaints); } void tst_QGraphicsEffect::inheritOpacity() @@ -588,7 +579,6 @@ void tst_QGraphicsEffect::inheritOpacity() int numRepaints = item->numRepaints; rectItem->setOpacity(1); - QTest::qWait(50); // item should have been rerendered due to opacity changing QTRY_VERIFY(item->numRepaints > numRepaints); diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 6725159..bec4950 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -6823,8 +6823,8 @@ void tst_QGraphicsItem::cacheMode() testerChild2->rotate(22); QTest::qWait(25); QTRY_COMPARE(tester->repaints, 4); - QCOMPARE(testerChild->repaints, 4); - QCOMPARE(testerChild2->repaints, 3); + QTRY_COMPARE(testerChild->repaints, 4); + QTRY_COMPARE(testerChild2->repaints, 3); tester->resetTransform(); testerChild->resetTransform(); testerChild2->resetTransform(); @@ -6902,33 +6902,30 @@ void tst_QGraphicsItem::cacheMode() testerChild->setPos(1, 1); QTest::qWait(25); QTRY_COMPARE(tester->repaints, 11); - QCOMPARE(testerChild->repaints, 10); - QCOMPARE(testerChild2->repaints, 5); + QTRY_COMPARE(testerChild->repaints, 10); + QTRY_COMPARE(testerChild2->repaints, 5); tester->resetTransform(); // Make a huge item tester->setGeometry(QRectF(-4000, -4000, 8000, 8000)); - QTest::qWait(25); QTRY_COMPARE(tester->repaints, 12); - QCOMPARE(testerChild->repaints, 11); - QCOMPARE(testerChild2->repaints, 5); + QTRY_COMPARE(testerChild->repaints, 11); + QTRY_COMPARE(testerChild2->repaints, 5); // Move the large item - will cause a repaint as the // cache is clipped. tester->setPos(5, 0); - QTest::qWait(25); QTRY_COMPARE(tester->repaints, 13); - QCOMPARE(testerChild->repaints, 11); - QCOMPARE(testerChild2->repaints, 5); + QTRY_COMPARE(testerChild->repaints, 11); + QTRY_COMPARE(testerChild2->repaints, 5); // Hiding and showing should invalidate the cache tester->hide(); QTest::qWait(25); tester->show(); - QTest::qWait(25); QTRY_COMPARE(tester->repaints, 14); - QCOMPARE(testerChild->repaints, 12); - QCOMPARE(testerChild2->repaints, 6); + QTRY_COMPARE(testerChild->repaints, 12); + QTRY_COMPARE(testerChild2->repaints, 6); } void tst_QGraphicsItem::cacheMode2() |