diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-02-11 05:27:48 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-02-11 05:27:48 (GMT) |
commit | b84ee1bd906aebc43b82823426dd01e29b7f5a89 (patch) | |
tree | f66d4d8b0a2bd52b3471eb6225aa01df9d50213c /tests/auto | |
parent | a4a464283851f062ad98b07755e1922c9fcfa7d5 (diff) | |
parent | 2d8bc0a7a87e4b3e1f3ab29e9e2c667137d9942e (diff) | |
download | Qt-b84ee1bd906aebc43b82823426dd01e29b7f5a89.zip Qt-b84ee1bd906aebc43b82823426dd01e29b7f5a89.tar.gz Qt-b84ee1bd906aebc43b82823426dd01e29b7f5a89.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-qml
Diffstat (limited to 'tests/auto')
12 files changed, 32 insertions, 18 deletions
diff --git a/tests/auto/declarative/animatedimage/tst_animatedimage.cpp b/tests/auto/declarative/animatedimage/tst_animatedimage.cpp index c4865d2..ee072c8 100644 --- a/tests/auto/declarative/animatedimage/tst_animatedimage.cpp +++ b/tests/auto/declarative/animatedimage/tst_animatedimage.cpp @@ -129,8 +129,6 @@ void tst_animatedimage::frameCount() QmlGraphicsAnimatedImage *anim = qobject_cast<QmlGraphicsAnimatedImage *>(component.create()); QVERIFY(anim); QVERIFY(anim->isPlaying()); - QCOMPARE(anim->frameCount(), 0); // GIF doesn't support frameCount until first pass through - QTest::qWait(600 + 100); QCOMPARE(anim->frameCount(), 3); delete anim; diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index 9bd7946..7b13b41 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -5,7 +5,6 @@ SUBDIRS += \ animations \ # Cover behaviors \ # Cover datetimeformatter \ # Cover - examples \ graphicswidgets \ # Cover layouts \ # Cover numberformatter \ # Cover @@ -58,7 +57,6 @@ SUBDIRS += \ sql \ # Cover states \ # Cover valuetypes \ # Cover - visual \ # Cover xmlhttprequest # Cover diff --git a/tests/auto/declarative/parserstress/tst_parserstress.cpp b/tests/auto/declarative/parserstress/tst_parserstress.cpp index fe177d1..a607bb3 100644 --- a/tests/auto/declarative/parserstress/tst_parserstress.cpp +++ b/tests/auto/declarative/parserstress/tst_parserstress.cpp @@ -87,8 +87,8 @@ QStringList tst_parserstress::findJSFiles(const QDir &d) void tst_parserstress::ecmascript_data() { QDir dir(SRCDIR); - dir.cdUp(); - dir.cdUp(); + dir.cdUp(); + dir.cdUp(); dir.cd("qscriptjstestsuite"); dir.cd("tests"); @@ -132,6 +132,16 @@ void tst_parserstress::ecmascript() QmlComponent component(&engine); component.setData(qmlData, QUrl::fromLocalFile(SRCDIR + QString("/dummy.qml"))); + QSet<QString> failingTests; + failingTests << "uc-003.js" << "uc-005.js" << "regress-352044-02-n.js" + << "regress-334158.js" << "regress-58274.js" << "dowhile-006.js" << "dowhile-005.js"; + QFileInfo info(file); + foreach (const QString &failing, failingTests) { + if (info.fileName().endsWith(failing)) { + QEXPECT_FAIL("", "QTBUG-8108", Continue); + break; + } + } QVERIFY(!component.isError()); } diff --git a/tests/auto/declarative/qmldebug/tst_qmldebug.cpp b/tests/auto/declarative/qmldebug/tst_qmldebug.cpp index 7615f9b..82e74ce 100644 --- a/tests/auto/declarative/qmldebug/tst_qmldebug.cpp +++ b/tests/auto/declarative/qmldebug/tst_qmldebug.cpp @@ -330,9 +330,11 @@ void tst_QmlDebug::watch_object() QmlDebugEnginesQuery *q_engines = m_dbg->queryAvailableEngines(this); waitForQuery(q_engines); + Q_ASSERT(q_engines->engines().count() > 0); QmlDebugRootContextQuery *q_context = m_dbg->queryRootContexts(q_engines->engines()[0].debugId(), this); waitForQuery(q_context); + Q_ASSERT(q_context->rootContext().objects().count() > 0); QmlDebugObjectQuery *q_obj = m_dbg->queryObject(q_context->rootContext().objects()[0], this); waitForQuery(q_obj); diff --git a/tests/auto/declarative/qmldebugclient/tst_qmldebugclient.cpp b/tests/auto/declarative/qmldebugclient/tst_qmldebugclient.cpp index 8325731..4ee0837 100644 --- a/tests/auto/declarative/qmldebugclient/tst_qmldebugclient.cpp +++ b/tests/auto/declarative/qmldebugclient/tst_qmldebugclient.cpp @@ -62,11 +62,9 @@ public: tst_QmlDebugClient(QmlDebugTestData *data) { m_conn = data->conn; - m_engine = data->engine; } QmlDebugConnection *m_conn; - QmlEngine *m_engine; private slots: void name(); @@ -145,6 +143,9 @@ public: QObject *createTest(QmlDebugTestData *data) { return new tst_QmlDebugClient(data); } }; + +// This does not use QTEST_MAIN because the test has to be created and run +// in a separate thread. int main(int argc, char *argv[]) { QApplication app(argc, argv); diff --git a/tests/auto/declarative/qmldebugservice/tst_qmldebugservice.cpp b/tests/auto/declarative/qmldebugservice/tst_qmldebugservice.cpp index 625d1f5..4e7bc27 100644 --- a/tests/auto/declarative/qmldebugservice/tst_qmldebugservice.cpp +++ b/tests/auto/declarative/qmldebugservice/tst_qmldebugservice.cpp @@ -62,11 +62,9 @@ public: tst_QmlDebugService(QmlDebugTestData *data) { m_conn = data->conn; - m_engine = data->engine; } QmlDebugConnection *m_conn; - QmlEngine *m_engine; private slots: void name(); @@ -178,6 +176,8 @@ public: QObject *createTest(QmlDebugTestData *data) { return new tst_QmlDebugService(data); } }; +// This does not use QTEST_MAIN because the test has to be created and run +// in a separate thread. int main(int argc, char *argv[]) { QApplication app(argc, argv); diff --git a/tests/auto/declarative/qmldom/tst_qmldom.cpp b/tests/auto/declarative/qmldom/tst_qmldom.cpp index 6527b36..ce35130 100644 --- a/tests/auto/declarative/qmldom/tst_qmldom.cpp +++ b/tests/auto/declarative/qmldom/tst_qmldom.cpp @@ -486,7 +486,7 @@ void tst_qmldom::loadDynamicProperty() DP_TEST(7, h, QVariant::Date, 168, 15, "date"); DP_TEST(8, i, qMetaTypeId<QVariant>(), 188, 14, "var"); DP_TEST(9, j, qMetaTypeId<QVariant>(), 207, 18, "variant"); - DP_TEST(10, k, -1, 230, 17, "QtObject"); + DP_TEST(10, k, -1, 230, 19, "QtObject"); } { 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"); diff --git a/tests/auto/declarative/qmlgraphicstext/tst_qmlgraphicstext.cpp b/tests/auto/declarative/qmlgraphicstext/tst_qmlgraphicstext.cpp index eed84ea..4626fe6 100644 --- a/tests/auto/declarative/qmlgraphicstext/tst_qmlgraphicstext.cpp +++ b/tests/auto/declarative/qmlgraphicstext/tst_qmlgraphicstext.cpp @@ -46,7 +46,7 @@ #include <private/qmlvaluetype_p.h> #include <QFontMetrics> #include <QGraphicsSceneMouseEvent> -#include <math.h> +#include <qmath.h> class tst_qmlgraphicstext : public QObject @@ -212,7 +212,7 @@ void tst_qmlgraphicstext::width() QFont f; QFontMetricsF fm(f); qreal metricWidth = fm.size(Qt::TextExpandTabs && Qt::TextShowMnemonic, standard.at(i)).width(); - metricWidth = floor(metricWidth); + metricWidth = qCeil(metricWidth); QString componentStr = "import Qt 4.6\nText { text: \"" + standard.at(i) + "\" }"; QmlComponent textComponent(&engine); diff --git a/tests/auto/declarative/shared/debugutil.cpp b/tests/auto/declarative/shared/debugutil.cpp index 936adda..aa0cd31 100644 --- a/tests/auto/declarative/shared/debugutil.cpp +++ b/tests/auto/declarative/shared/debugutil.cpp @@ -138,7 +138,7 @@ void tst_QmlDebug_Thread::run() Q_ASSERT(m_factory); QObject *test = m_factory->createTest(m_data); Q_ASSERT(test); - int code = QTest::qExec(test); + int code = QTest::qExec(test, QCoreApplication::arguments()); emit testsFinished(code); } @@ -168,6 +168,7 @@ int QmlDebugTest::runTests(QmlTestFactory *factory, const QList<QByteArray> &qml thread.m_ready = true; loop.exec(); + thread.wait(); return data.exitCode; } diff --git a/tests/auto/declarative/shared/debugutil_p.h b/tests/auto/declarative/shared/debugutil_p.h index cb20f5c..313d16c 100644 --- a/tests/auto/declarative/shared/debugutil_p.h +++ b/tests/auto/declarative/shared/debugutil_p.h @@ -60,8 +60,8 @@ public: ~QmlDebugTestData(); - QmlEngine *engine; QmlDebugConnection *conn; + QmlEngine *engine; int exitCode; QEventLoop *loop; |