From ad169b96c7dc878c556b8b5cc12b9d40233008bf Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Thu, 11 Feb 2010 11:30:12 +1000 Subject: Improve stability of tst_qmlecmascript::dynamicDestruction Tweak timing to be more forgiving to system load. --- tests/auto/declarative/qmlecmascript/data/dynamicDeletion.qml | 2 +- tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/auto/declarative/qmlecmascript/data/dynamicDeletion.qml b/tests/auto/declarative/qmlecmascript/data/dynamicDeletion.qml index ba87b32..0855b29 100644 --- a/tests/auto/declarative/qmlecmascript/data/dynamicDeletion.qml +++ b/tests/auto/declarative/qmlecmascript/data/dynamicDeletion.qml @@ -10,7 +10,7 @@ MyQmlObject{ function killOther() { - obj.objectProperty.destroy(100); + obj.objectProperty.destroy(500); } function killMe() diff --git a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp index 2182ff4..e5472bb 100644 --- a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp +++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp @@ -849,8 +849,12 @@ void tst_qmlecmascript::dynamicDestruction() QTest::qWait(0); QCoreApplication::instance()->processEvents(QEventLoop::DeferredDeletion); QVERIFY(createdQmlObject); - QTest::qWait(100); - QCoreApplication::instance()->processEvents(QEventLoop::DeferredDeletion); + for (int ii = 0; createdQmlObject && ii < 10; ++ii) { + if (createdQmlObject) { + QTest::qWait(100); + QCoreApplication::instance()->processEvents(QEventLoop::DeferredDeletion); + } + } QVERIFY(!createdQmlObject); QMetaObject::invokeMethod(object, "killMe"); -- cgit v0.12