summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-02-15 04:27:49 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-02-15 04:27:49 (GMT)
commit070208528ca9a532a926d7b38abf4b5df576c0d5 (patch)
tree81b97bf24eaffc29a4d549b0609bf270bcfb3278 /tests
parent1caff7f6909aa69f280d7ba89aeaad15e80563d8 (diff)
downloadQt-070208528ca9a532a926d7b38abf4b5df576c0d5.zip
Qt-070208528ca9a532a926d7b38abf4b5df576c0d5.tar.gz
Qt-070208528ca9a532a926d7b38abf4b5df576c0d5.tar.bz2
Make tst_qmlecmascript::dynamicDestruction stable
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
index e5472bb..4edca69 100644
--- a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
+++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
@@ -45,7 +45,7 @@
#include <QtDeclarative/qmlcontext.h>
#include <QtCore/qfileinfo.h>
#include <QtCore/qdebug.h>
-#include <QtCore/private/qguard_p.h>
+#include <QtDeclarative/private/qmlguard_p.h>
#include <QtCore/qdir.h>
#include <QtCore/qnumeric.h>
#include <private/qmlengine_p.h>
@@ -835,9 +835,9 @@ void tst_qmlecmascript::dynamicCreation()
void tst_qmlecmascript::dynamicDestruction()
{
QmlComponent component(&engine, TEST_FILE("dynamicDeletion.qml"));
- QGuard<MyQmlObject> object = qobject_cast<MyQmlObject*>(component.create());
+ QmlGuard<MyQmlObject> object = qobject_cast<MyQmlObject*>(component.create());
QVERIFY(object != 0);
- QGuard<QObject> createdQmlObject = 0;
+ QmlGuard<QObject> createdQmlObject = 0;
QMetaObject::invokeMethod(object, "create");
createdQmlObject = object->objectProperty();
@@ -846,10 +846,9 @@ void tst_qmlecmascript::dynamicDestruction()
QMetaObject::invokeMethod(object, "killOther");
QVERIFY(createdQmlObject);
- QTest::qWait(0);
QCoreApplication::instance()->processEvents(QEventLoop::DeferredDeletion);
QVERIFY(createdQmlObject);
- for (int ii = 0; createdQmlObject && ii < 10; ++ii) {
+ for (int ii = 0; createdQmlObject && ii < 50; ++ii) { // After 5 seconds we should give up
if (createdQmlObject) {
QTest::qWait(100);
QCoreApplication::instance()->processEvents(QEventLoop::DeferredDeletion);