diff options
Diffstat (limited to 'tests')
19 files changed, 298 insertions, 270 deletions
diff --git a/tests/auto/declarative/qmlanimations/tst_qmlanimations.cpp b/tests/auto/declarative/qmlanimations/tst_qmlanimations.cpp index 17a1453..b2653df 100644 --- a/tests/auto/declarative/qmlanimations/tst_qmlanimations.cpp +++ b/tests/auto/declarative/qmlanimations/tst_qmlanimations.cpp @@ -46,13 +46,15 @@ #include <private/qmlanimation_p.h> #include <QVariantAnimation> -class tst_animations : public QObject +class tst_qmlanimations : public QObject { Q_OBJECT public: - tst_animations() {} + tst_qmlanimations() {} private slots: + void initTestCase() { QmlEngine engine; } // ensure types are registered + void simpleProperty(); void simpleNumber(); void simpleColor(); @@ -80,7 +82,7 @@ private slots: QCOMPARE(lhs, rhs); \ } while (false) -void tst_animations::simpleProperty() +void tst_qmlanimations::simpleProperty() { QmlGraphicsRectangle rect; QmlPropertyAnimation animation; @@ -105,7 +107,7 @@ void tst_animations::simpleProperty() QCOMPARE(rect.pos(), QPointF(100,100)); } -void tst_animations::simpleNumber() +void tst_qmlanimations::simpleNumber() { QmlGraphicsRectangle rect; QmlNumberAnimation animation; @@ -130,7 +132,7 @@ void tst_animations::simpleNumber() QCOMPARE(rect.x(), qreal(100)); } -void tst_animations::simpleColor() +void tst_qmlanimations::simpleColor() { QmlGraphicsRectangle rect; QmlColorAnimation animation; @@ -164,7 +166,7 @@ void tst_animations::simpleColor() QCOMPARE(rect.color(), QColor::fromRgbF(0.498039, 0, 0.498039, 1)); } -void tst_animations::alwaysRunToEnd() +void tst_qmlanimations::alwaysRunToEnd() { QmlGraphicsRectangle rect; QmlPropertyAnimation animation; @@ -184,7 +186,7 @@ void tst_animations::alwaysRunToEnd() QTIMED_COMPARE(rect.x(), qreal(200)); } -void tst_animations::complete() +void tst_qmlanimations::complete() { QmlGraphicsRectangle rect; QmlPropertyAnimation animation; @@ -205,7 +207,7 @@ void tst_animations::complete() QCOMPARE(rect.x(), qreal(200)); } -void tst_animations::resume() +void tst_qmlanimations::resume() { QmlGraphicsRectangle rect; QmlPropertyAnimation animation; @@ -232,7 +234,7 @@ void tst_animations::resume() QVERIFY(rect.x() > x); } -void tst_animations::dotProperty() +void tst_qmlanimations::dotProperty() { QmlGraphicsRectangle rect; QmlNumberAnimation animation; @@ -251,7 +253,7 @@ void tst_animations::dotProperty() QCOMPARE(rect.border()->width(), 5); } -void tst_animations::badTypes() +void tst_qmlanimations::badTypes() { //don't crash { @@ -301,7 +303,7 @@ void tst_animations::badTypes() } } -void tst_animations::badProperties() +void tst_qmlanimations::badProperties() { //make sure we get a runtime error { @@ -328,7 +330,7 @@ void tst_animations::badProperties() //test animating mixed types with property animation in a transition //for example, int + real; color + real; etc -void tst_animations::mixedTypes() +void tst_qmlanimations::mixedTypes() { //assumes border.width stats a real -- not real robust { @@ -364,7 +366,7 @@ void tst_animations::mixedTypes() } } -void tst_animations::properties() +void tst_qmlanimations::properties() { const int waitDuration = 300; { @@ -431,7 +433,7 @@ void tst_animations::properties() } } -void tst_animations::propertiesTransition() +void tst_qmlanimations::propertiesTransition() { const int waitDuration = 300; { @@ -502,7 +504,7 @@ void tst_animations::propertiesTransition() } } -void tst_animations::easingStringConversion() +void tst_qmlanimations::easingStringConversion() { QmlNumberAnimation *animation = new QmlNumberAnimation; animation->setEasing("easeInOutQuad"); @@ -553,7 +555,7 @@ void tst_animations::easingStringConversion() delete animation; } -void tst_animations::invalidDuration() +void tst_qmlanimations::invalidDuration() { QmlPropertyAnimation *animation = new QmlPropertyAnimation; QTest::ignoreMessage(QtWarningMsg, "QML PropertyAnimation (unknown location) Cannot set a duration of < 0"); @@ -566,7 +568,7 @@ void tst_animations::invalidDuration() QCOMPARE(pauseAnimation->duration(), 250); } -void tst_animations::attached() +void tst_qmlanimations::attached() { QmlEngine engine; @@ -577,7 +579,7 @@ void tst_animations::attached() QVERIFY(rect); } -void tst_animations::propertyValueSourceDefaultStart() +void tst_qmlanimations::propertyValueSourceDefaultStart() { { QmlEngine engine; @@ -606,6 +608,6 @@ void tst_animations::propertyValueSourceDefaultStart() } } -QTEST_MAIN(tst_animations) +QTEST_MAIN(tst_qmlanimations) #include "tst_qmlanimations.moc" diff --git a/tests/auto/declarative/qmlbehaviors/tst_qmlbehaviors.cpp b/tests/auto/declarative/qmlbehaviors/tst_qmlbehaviors.cpp index 61023a2..5663237 100644 --- a/tests/auto/declarative/qmlbehaviors/tst_qmlbehaviors.cpp +++ b/tests/auto/declarative/qmlbehaviors/tst_qmlbehaviors.cpp @@ -46,11 +46,11 @@ #include <private/qmlbehavior_p.h> #include <private/qmlanimation_p.h> -class tst_behaviors : public QObject +class tst_qmlbehaviors : public QObject { Q_OBJECT public: - tst_behaviors() {} + tst_qmlbehaviors() {} private slots: void simpleBehavior(); @@ -68,7 +68,7 @@ private slots: void disabled(); }; -void tst_behaviors::simpleBehavior() +void tst_qmlbehaviors::simpleBehavior() { QmlEngine engine; QmlComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/simple.qml")); @@ -82,7 +82,7 @@ void tst_behaviors::simpleBehavior() QVERIFY(x > 0 && x < 200); //i.e. the behavior has been triggered } -void tst_behaviors::scriptTriggered() +void tst_qmlbehaviors::scriptTriggered() { QmlEngine engine; QmlComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/scripttrigger.qml")); @@ -95,7 +95,7 @@ void tst_behaviors::scriptTriggered() QVERIFY(x > 0 && x < 200); //i.e. the behavior has been triggered } -void tst_behaviors::cppTriggered() +void tst_qmlbehaviors::cppTriggered() { QmlEngine engine; QmlComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/cpptrigger.qml")); @@ -111,7 +111,7 @@ void tst_behaviors::cppTriggered() QVERIFY(x > 0 && x < 200); //i.e. the behavior has been triggered } -void tst_behaviors::loop() +void tst_qmlbehaviors::loop() { QmlEngine engine; QmlComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/loop.qml")); @@ -122,7 +122,7 @@ void tst_behaviors::loop() rect->setState("moved"); } -void tst_behaviors::colorBehavior() +void tst_qmlbehaviors::colorBehavior() { QmlEngine engine; QmlComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/color.qml")); @@ -135,7 +135,7 @@ void tst_behaviors::colorBehavior() QVERIFY(color != QColor("red") && color != QColor("green")); //i.e. the behavior has been triggered } -void tst_behaviors::parentBehavior() +void tst_qmlbehaviors::parentBehavior() { QmlEngine engine; QmlComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/parent.qml")); @@ -152,7 +152,7 @@ void tst_behaviors::parentBehavior() QVERIFY(parent == newParent); } -void tst_behaviors::replaceBinding() +void tst_qmlbehaviors::replaceBinding() { QmlEngine engine; QmlComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/binding.qml")); @@ -186,7 +186,7 @@ void tst_behaviors::replaceBinding() QCOMPARE(innerRect->x(), (qreal)20); } -void tst_behaviors::group() +void tst_qmlbehaviors::group() { { QmlEngine engine; @@ -213,7 +213,7 @@ void tst_behaviors::group() } } -void tst_behaviors::emptyBehavior() +void tst_qmlbehaviors::emptyBehavior() { QmlEngine engine; QmlComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/empty.qml")); @@ -225,7 +225,7 @@ void tst_behaviors::emptyBehavior() QCOMPARE(x, qreal(200)); //should change immediately } -void tst_behaviors::nonSelectingBehavior() +void tst_qmlbehaviors::nonSelectingBehavior() { { QmlEngine engine; @@ -250,7 +250,7 @@ void tst_behaviors::nonSelectingBehavior() } } -void tst_behaviors::reassignedAnimation() +void tst_qmlbehaviors::reassignedAnimation() { QmlEngine engine; QmlComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/reassignedAnimation.qml")); @@ -262,7 +262,7 @@ void tst_behaviors::reassignedAnimation() rect->findChild<QmlBehavior*>("MyBehavior"))->animation())->duration(), 200); } -void tst_behaviors::disabled() +void tst_qmlbehaviors::disabled() { QmlEngine engine; QmlComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/disabled.qml")); @@ -276,6 +276,6 @@ void tst_behaviors::disabled() } -QTEST_MAIN(tst_behaviors) +QTEST_MAIN(tst_qmlbehaviors) #include "tst_qmlbehaviors.moc" diff --git a/tests/auto/declarative/qmldatetimeformatter/tst_qmldatetimeformatter.cpp b/tests/auto/declarative/qmldatetimeformatter/tst_qmldatetimeformatter.cpp index 2ce6186..b21a4f0 100644 --- a/tests/auto/declarative/qmldatetimeformatter/tst_qmldatetimeformatter.cpp +++ b/tests/auto/declarative/qmldatetimeformatter/tst_qmldatetimeformatter.cpp @@ -44,11 +44,11 @@ #include <private/qmldatetimeformatter_p.h> #include <QDebug> -class tst_datetimeformatter : public QObject +class tst_qmldatetimeformatter : public QObject { Q_OBJECT public: - tst_datetimeformatter() {} + tst_qmldatetimeformatter() {} private slots: void date(); @@ -56,7 +56,7 @@ private slots: void dateTime(); }; -void tst_datetimeformatter::date() +void tst_qmldatetimeformatter::date() { QmlEngine engine; QmlComponent formatterComponent(&engine); @@ -86,7 +86,7 @@ void tst_datetimeformatter::date() delete formatter; } -void tst_datetimeformatter::time() +void tst_qmldatetimeformatter::time() { QmlEngine engine; QmlComponent formatterComponent(&engine); @@ -119,7 +119,7 @@ void tst_datetimeformatter::time() delete formatter; } -void tst_datetimeformatter::dateTime() +void tst_qmldatetimeformatter::dateTime() { QmlEngine engine; QmlComponent formatterComponent(&engine); @@ -145,6 +145,6 @@ void tst_datetimeformatter::dateTime() delete formatter; } -QTEST_MAIN(tst_datetimeformatter) +QTEST_MAIN(tst_qmldatetimeformatter) #include "tst_qmldatetimeformatter.moc" diff --git a/tests/auto/declarative/qmldebug/tst_qmldebug.cpp b/tests/auto/declarative/qmldebug/tst_qmldebug.cpp index 82e74ce..a51fd29 100644 --- a/tests/auto/declarative/qmldebug/tst_qmldebug.cpp +++ b/tests/auto/declarative/qmldebug/tst_qmldebug.cpp @@ -288,10 +288,11 @@ void tst_QmlDebug::watch_property() QmlDebugPropertyWatch *watch; - QmlEngineDebug unconnected(0); - watch = unconnected.addWatch(prop, this); + QmlEngineDebug *unconnected = new QmlEngineDebug(0); + watch = unconnected->addWatch(prop, this); QCOMPARE(watch->state(), QmlDebugWatch::Dead); delete watch; + delete unconnected; watch = m_dbg->addWatch(QmlDebugPropertyReference(), this); QVERIFY(QmlDebugTest::waitForSignal(watch, SIGNAL(stateChanged(QmlDebugWatch::State)))); @@ -346,10 +347,11 @@ void tst_QmlDebug::watch_object() QmlDebugWatch *watch; - QmlEngineDebug unconnected(0); - watch = unconnected.addWatch(obj, this); + QmlEngineDebug *unconnected = new QmlEngineDebug(0); + watch = unconnected->addWatch(obj, this); QCOMPARE(watch->state(), QmlDebugWatch::Dead); delete watch; + delete unconnected; watch = m_dbg->addWatch(QmlDebugObjectReference(), this); QVERIFY(QmlDebugTest::waitForSignal(watch, SIGNAL(stateChanged(QmlDebugWatch::State)))); @@ -409,10 +411,11 @@ void tst_QmlDebug::watch_expression() QmlDebugObjectExpressionWatch *watch; - QmlEngineDebug unconnected(0); - watch = unconnected.addWatch(obj, expr, this); + QmlEngineDebug *unconnected = new QmlEngineDebug(0); + watch = unconnected->addWatch(obj, expr, this); QCOMPARE(watch->state(), QmlDebugWatch::Dead); delete watch; + delete unconnected; watch = m_dbg->addWatch(QmlDebugObjectReference(), expr, this); QVERIFY(QmlDebugTest::waitForSignal(watch, SIGNAL(stateChanged(QmlDebugWatch::State)))); @@ -487,10 +490,11 @@ void tst_QmlDebug::queryAvailableEngines() { QmlDebugEnginesQuery *q_engines; - QmlEngineDebug unconnected(0); - q_engines = unconnected.queryAvailableEngines(0); + QmlEngineDebug *unconnected = new QmlEngineDebug(0); + q_engines = unconnected->queryAvailableEngines(0); QCOMPARE(q_engines->state(), QmlDebugQuery::Error); delete q_engines; + delete unconnected; q_engines = m_dbg->queryAvailableEngines(this); delete q_engines; @@ -519,10 +523,11 @@ void tst_QmlDebug::queryRootContexts() QmlDebugRootContextQuery *q_context; - QmlEngineDebug unconnected(0); - q_context = unconnected.queryRootContexts(engineId, this); + QmlEngineDebug *unconnected = new QmlEngineDebug(0); + q_context = unconnected->queryRootContexts(engineId, this); QCOMPARE(q_context->state(), QmlDebugQuery::Error); delete q_context; + delete unconnected; q_context = m_dbg->queryRootContexts(engineId, this); delete q_context; @@ -563,10 +568,11 @@ void tst_QmlDebug::queryObject() QmlDebugObjectQuery *q_obj = 0; - QmlEngineDebug unconnected(0); - q_obj = recursive ? unconnected.queryObjectRecursive(rootObject, this) : unconnected.queryObject(rootObject, this); + QmlEngineDebug *unconnected = new QmlEngineDebug(0); + q_obj = recursive ? unconnected->queryObjectRecursive(rootObject, this) : unconnected->queryObject(rootObject, this); QCOMPARE(q_obj->state(), QmlDebugQuery::Error); delete q_obj; + delete unconnected; q_obj = recursive ? m_dbg->queryObjectRecursive(rootObject, this) : m_dbg->queryObject(rootObject, this); delete q_obj; @@ -637,10 +643,11 @@ void tst_QmlDebug::queryExpressionResult() QmlDebugExpressionQuery *q_expr; - QmlEngineDebug unconnected(0); - q_expr = unconnected.queryExpressionResult(objectId, expr, this); + QmlEngineDebug *unconnected = new QmlEngineDebug(0); + q_expr = unconnected->queryExpressionResult(objectId, expr, this); QCOMPARE(q_expr->state(), QmlDebugQuery::Error); delete q_expr; + delete unconnected; q_expr = m_dbg->queryExpressionResult(objectId, expr, this); delete q_expr; @@ -801,9 +808,10 @@ class tst_QmlDebug_Factory : public QmlTestFactory public: QObject *createTest(QmlDebugTestData *data) { - QmlContext *c = new QmlContext(data->engine->rootContext()); + tst_QmlDebug *test = new tst_QmlDebug(data); + QmlContext *c = new QmlContext(data->engine->rootContext(), test); c->setObjectName("tst_QmlDebug_childContext"); - return new tst_QmlDebug(data); + return test; } }; diff --git a/tests/auto/declarative/qmldebugservice/tst_qmldebugservice.cpp b/tests/auto/declarative/qmldebugservice/tst_qmldebugservice.cpp index 4e7bc27..9abc5a5 100644 --- a/tests/auto/declarative/qmldebugservice/tst_qmldebugservice.cpp +++ b/tests/auto/declarative/qmldebugservice/tst_qmldebugservice.cpp @@ -167,6 +167,7 @@ void tst_QmlDebugService::objectToString() obj->setObjectName("Hello"); QCOMPARE(QmlDebugService::objectToString(obj), QString("QObject: Hello")); + delete obj; } diff --git a/tests/auto/declarative/qmlgraphicsanchors/tst_qmlgraphicsanchors.cpp b/tests/auto/declarative/qmlgraphicsanchors/tst_qmlgraphicsanchors.cpp index 5850cf0..1187038 100644 --- a/tests/auto/declarative/qmlgraphicsanchors/tst_qmlgraphicsanchors.cpp +++ b/tests/auto/declarative/qmlgraphicsanchors/tst_qmlgraphicsanchors.cpp @@ -51,11 +51,11 @@ Q_DECLARE_METATYPE(QmlGraphicsAnchors::UsedAnchor) Q_DECLARE_METATYPE(QmlGraphicsAnchorLine::AnchorLine) -class tst_anchors : public QObject +class tst_qmlgraphicsanchors : public QObject { Q_OBJECT public: - tst_anchors() {} + tst_qmlgraphicsanchors() {} template<typename T> T *findItem(QmlGraphicsItem *parent, const QString &id); @@ -80,7 +80,7 @@ private slots: Find an item with the specified id. */ template<typename T> -T *tst_anchors::findItem(QmlGraphicsItem *parent, const QString &objectName) +T *tst_qmlgraphicsanchors::findItem(QmlGraphicsItem *parent, const QString &objectName) { const QMetaObject &mo = T::staticMetaObject; QList<QGraphicsItem *> children = parent->childItems(); @@ -99,7 +99,7 @@ T *tst_anchors::findItem(QmlGraphicsItem *parent, const QString &objectName) return 0; } -void tst_anchors::basicAnchors() +void tst_qmlgraphicsanchors::basicAnchors() { QmlView *view = new QmlView; view->setUrl(QUrl::fromLocalFile(SRCDIR "/data/anchors.qml")); @@ -168,7 +168,7 @@ void tst_anchors::basicAnchors() } // mostly testing that we don't crash -void tst_anchors::loops() +void tst_qmlgraphicsanchors::loops() { { QmlView *view = new QmlView; @@ -199,7 +199,7 @@ void tst_anchors::loops() } } -void tst_anchors::illegalSets() +void tst_qmlgraphicsanchors::illegalSets() { QFETCH(QString, qml); QFETCH(QString, warning); @@ -216,7 +216,7 @@ void tst_anchors::illegalSets() delete o; } -void tst_anchors::illegalSets_data() +void tst_qmlgraphicsanchors::illegalSets_data() { QTest::addColumn<QString>("qml"); QTest::addColumn<QString>("warning"); @@ -274,7 +274,7 @@ void tst_anchors::illegalSets_data() << "QML Rectangle (file::2:45) Can't anchor to an item that isn't a parent or sibling."; } -void tst_anchors::reset() +void tst_qmlgraphicsanchors::reset() { QFETCH(QString, side); QFETCH(QmlGraphicsAnchorLine::AnchorLine, anchorLine); @@ -301,7 +301,7 @@ void tst_anchors::reset() delete baseItem; } -void tst_anchors::reset_data() +void tst_qmlgraphicsanchors::reset_data() { QTest::addColumn<QString>("side"); QTest::addColumn<QmlGraphicsAnchorLine::AnchorLine>("anchorLine"); @@ -317,7 +317,7 @@ void tst_anchors::reset_data() QTest::newRow("baseline") << "baseline" << QmlGraphicsAnchorLine::Baseline << QmlGraphicsAnchors::HasBaselineAnchor; } -void tst_anchors::resetConvenience() +void tst_qmlgraphicsanchors::resetConvenience() { QmlGraphicsItem *baseItem = new QmlGraphicsItem; QmlGraphicsItem *item = new QmlGraphicsItem; @@ -338,7 +338,7 @@ void tst_anchors::resetConvenience() delete baseItem; } -void tst_anchors::nullItem() +void tst_qmlgraphicsanchors::nullItem() { QFETCH(QString, side); @@ -354,7 +354,7 @@ void tst_anchors::nullItem() delete item; } -void tst_anchors::nullItem_data() +void tst_qmlgraphicsanchors::nullItem_data() { QTest::addColumn<QString>("side"); @@ -368,7 +368,7 @@ void tst_anchors::nullItem_data() QTest::newRow("baseline") << "baseline"; } -void tst_anchors::crash1() +void tst_qmlgraphicsanchors::crash1() { QmlView *view = new QmlView; @@ -383,7 +383,7 @@ void tst_anchors::crash1() delete view; } -void tst_anchors::fill() +void tst_qmlgraphicsanchors::fill() { QmlView *view = new QmlView; @@ -409,7 +409,7 @@ void tst_anchors::fill() delete view; } -void tst_anchors::centerIn() +void tst_qmlgraphicsanchors::centerIn() { QmlView *view = new QmlView; @@ -429,7 +429,7 @@ void tst_anchors::centerIn() delete view; } -void tst_anchors::margins() +void tst_qmlgraphicsanchors::margins() { QmlView *view = new QmlView; @@ -454,6 +454,6 @@ void tst_anchors::margins() delete view; } -QTEST_MAIN(tst_anchors) +QTEST_MAIN(tst_qmlgraphicsanchors) #include "tst_qmlgraphicsanchors.moc" diff --git a/tests/auto/declarative/qmlgraphicsanimatedimage/tst_qmlgraphicsanimatedimage.cpp b/tests/auto/declarative/qmlgraphicsanimatedimage/tst_qmlgraphicsanimatedimage.cpp index bc10e30..1703c01 100644 --- a/tests/auto/declarative/qmlgraphicsanimatedimage/tst_qmlgraphicsanimatedimage.cpp +++ b/tests/auto/declarative/qmlgraphicsanimatedimage/tst_qmlgraphicsanimatedimage.cpp @@ -58,11 +58,11 @@ } while (false) -class tst_animatedimage : public QObject +class tst_qmlgraphicsanimatedimage : public QObject { Q_OBJECT public: - tst_animatedimage() {} + tst_qmlgraphicsanimatedimage() {} private slots: void play(); @@ -75,7 +75,7 @@ private slots: void invalidSource(); }; -void tst_animatedimage::play() +void tst_qmlgraphicsanimatedimage::play() { QmlEngine engine; QmlComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/stickman.qml")); @@ -86,7 +86,7 @@ void tst_animatedimage::play() delete anim; } -void tst_animatedimage::pause() +void tst_qmlgraphicsanimatedimage::pause() { QmlEngine engine; QmlComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/stickmanpause.qml")); @@ -98,7 +98,7 @@ void tst_animatedimage::pause() delete anim; } -void tst_animatedimage::stopped() +void tst_qmlgraphicsanimatedimage::stopped() { QmlEngine engine; QmlComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/stickmanstopped.qml")); @@ -110,7 +110,7 @@ void tst_animatedimage::stopped() delete anim; } -void tst_animatedimage::setFrame() +void tst_qmlgraphicsanimatedimage::setFrame() { QmlEngine engine; QmlComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/stickmanpause.qml")); @@ -122,7 +122,7 @@ void tst_animatedimage::setFrame() delete anim; } -void tst_animatedimage::frameCount() +void tst_qmlgraphicsanimatedimage::frameCount() { QmlEngine engine; QmlComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/colors.qml")); @@ -134,7 +134,7 @@ void tst_animatedimage::frameCount() delete anim; } -void tst_animatedimage::remote() +void tst_qmlgraphicsanimatedimage::remote() { QFETCH(QString, fileName); QFETCH(bool, paused); @@ -159,7 +159,7 @@ void tst_animatedimage::remote() delete anim; } -void tst_animatedimage::remote_data() +void tst_qmlgraphicsanimatedimage::remote_data() { QTest::addColumn<QString>("fileName"); QTest::addColumn<bool>("paused"); @@ -168,7 +168,7 @@ void tst_animatedimage::remote_data() QTest::newRow("paused") << "stickmanpause.qml" << true; } -void tst_animatedimage::invalidSource() +void tst_qmlgraphicsanimatedimage::invalidSource() { QmlEngine engine; QmlComponent component(&engine); @@ -186,6 +186,6 @@ void tst_animatedimage::invalidSource() QCOMPARE(anim->frameCount(), 0); } -QTEST_MAIN(tst_animatedimage) +QTEST_MAIN(tst_qmlgraphicsanimatedimage) #include "tst_qmlgraphicsanimatedimage.moc" diff --git a/tests/auto/declarative/qmlgraphicspositioners/tst_qmlgraphicspositioners.cpp b/tests/auto/declarative/qmlgraphicspositioners/tst_qmlgraphicspositioners.cpp index da541c8..42d6da9 100644 --- a/tests/auto/declarative/qmlgraphicspositioners/tst_qmlgraphicspositioners.cpp +++ b/tests/auto/declarative/qmlgraphicspositioners/tst_qmlgraphicspositioners.cpp @@ -43,6 +43,7 @@ #include <qmlview.h> #include <private/qmlgraphicsrectangle_p.h> #include <qmlexpression.h> +#include "../../../shared/util.h" class tst_QmlGraphicsPositioners : public QObject { @@ -75,7 +76,6 @@ void tst_QmlGraphicsPositioners::test_horizontal() QmlView *canvas = createView(SRCDIR "/data/horizontal.qml"); canvas->execute(); - qApp->processEvents(); QmlGraphicsRectangle *one = canvas->root()->findChild<QmlGraphicsRectangle*>("one"); QVERIFY(one != 0); @@ -99,7 +99,6 @@ void tst_QmlGraphicsPositioners::test_horizontal_spacing() QmlView *canvas = createView(SRCDIR "/data/horizontal-spacing.qml"); canvas->execute(); - qApp->processEvents(); QmlGraphicsRectangle *one = canvas->root()->findChild<QmlGraphicsRectangle*>("one"); QVERIFY(one != 0); @@ -123,30 +122,31 @@ void tst_QmlGraphicsPositioners::test_horizontal_animated() QmlView *canvas = createView(SRCDIR "/data/horizontal-animated.qml"); canvas->execute(); - qApp->processEvents(); - //Note that they animate in QmlGraphicsRectangle *one = canvas->root()->findChild<QmlGraphicsRectangle*>("one"); QVERIFY(one != 0); - QCOMPARE(one->x(), -100.0); QmlGraphicsRectangle *two = canvas->root()->findChild<QmlGraphicsRectangle*>("two"); QVERIFY(two != 0); - QCOMPARE(two->x(), -100.0); QmlGraphicsRectangle *three = canvas->root()->findChild<QmlGraphicsRectangle*>("three"); QVERIFY(three != 0); + + //Note that they animate in + QCOMPARE(one->x(), -100.0); + QCOMPARE(two->x(), -100.0); QCOMPARE(three->x(), -100.0); - QTest::qWait(300);//Let the animation complete + //QTRY_COMPARE used instead of waiting for the expected time of animation completion + //Note that this means the duration of the animation is NOT tested - QCOMPARE(one->x(), 0.0); - QCOMPARE(one->y(), 0.0); - QCOMPARE(two->opacity(), 0.0); - QCOMPARE(two->x(), -100.0);//Not 'in' yet - QCOMPARE(two->y(), 0.0); - QCOMPARE(three->x(), 50.0); - QCOMPARE(three->y(), 0.0); + QTRY_COMPARE(one->x(), 0.0); + QTRY_COMPARE(one->y(), 0.0); + QTRY_COMPARE(two->opacity(), 0.0); + QTRY_COMPARE(two->x(), -100.0);//Not 'in' yet + QTRY_COMPARE(two->y(), 0.0); + QTRY_COMPARE(three->x(), 50.0); + QTRY_COMPARE(three->y(), 0.0); //Add 'two' two->setOpacity(1.0); @@ -154,9 +154,9 @@ void tst_QmlGraphicsPositioners::test_horizontal_animated() QTest::qWait(0);//Let the animation start QCOMPARE(two->x(), -100.0); QCOMPARE(three->x(), 50.0); - QTest::qWait(300);//Let the animation complete - QCOMPARE(two->x(), 50.0); - QCOMPARE(three->x(), 100.0); + + QTRY_COMPARE(two->x(), 50.0); + QTRY_COMPARE(three->x(), 100.0); } void tst_QmlGraphicsPositioners::test_vertical() @@ -164,7 +164,6 @@ void tst_QmlGraphicsPositioners::test_vertical() QmlView *canvas = createView(SRCDIR "/data/vertical.qml"); canvas->execute(); - qApp->processEvents(); QmlGraphicsRectangle *one = canvas->root()->findChild<QmlGraphicsRectangle*>("one"); QVERIFY(one != 0); @@ -188,7 +187,6 @@ void tst_QmlGraphicsPositioners::test_vertical_spacing() QmlView *canvas = createView(SRCDIR "/data/vertical-spacing.qml"); canvas->execute(); - qApp->processEvents(); QmlGraphicsRectangle *one = canvas->root()->findChild<QmlGraphicsRectangle*>("one"); QVERIFY(one != 0); @@ -212,9 +210,7 @@ void tst_QmlGraphicsPositioners::test_vertical_animated() QmlView *canvas = createView(SRCDIR "/data/vertical-animated.qml"); canvas->execute(); - qApp->processEvents(); - QTest::qWait(0);//Let the animation start //Note that they animate in QmlGraphicsRectangle *one = canvas->root()->findChild<QmlGraphicsRectangle*>("one"); QVERIFY(one != 0); @@ -228,25 +224,26 @@ void tst_QmlGraphicsPositioners::test_vertical_animated() QVERIFY(three != 0); QCOMPARE(three->y(), -100.0); - QTest::qWait(300);//Let the animation complete + //QTRY_COMPARE used instead of waiting for the expected time of animation completion + //Note that this means the duration of the animation is NOT tested - QCOMPARE(one->y(), 0.0); - QCOMPARE(one->x(), 0.0); - QCOMPARE(two->opacity(), 0.0); - QCOMPARE(two->y(), -100.0);//Not 'in' yet - QCOMPARE(two->x(), 0.0); - QCOMPARE(three->y(), 50.0); - QCOMPARE(three->x(), 0.0); + QTRY_COMPARE(one->y(), 0.0); + QTRY_COMPARE(one->x(), 0.0); + QTRY_COMPARE(two->opacity(), 0.0); + QTRY_COMPARE(two->y(), -100.0);//Not 'in' yet + QTRY_COMPARE(two->x(), 0.0); + QTRY_COMPARE(three->y(), 50.0); + QTRY_COMPARE(three->x(), 0.0); //Add 'two' two->setOpacity(1.0); - QCOMPARE(two->opacity(), 1.0); + QTRY_COMPARE(two->opacity(), 1.0); QTest::qWait(0);//Let the animation start QCOMPARE(two->y(), -100.0); QCOMPARE(three->y(), 50.0); - QTest::qWait(300);//Let the animation complete - QCOMPARE(two->y(), 50.0); - QCOMPARE(three->y(), 100.0); + + QTRY_COMPARE(two->y(), 50.0); + QTRY_COMPARE(three->y(), 100.0); } @@ -255,7 +252,6 @@ void tst_QmlGraphicsPositioners::test_grid() QmlView *canvas = createView("data/grid.qml"); canvas->execute(); - qApp->processEvents(); QmlGraphicsRectangle *one = canvas->root()->findChild<QmlGraphicsRectangle*>("one"); QVERIFY(one != 0); @@ -285,7 +281,6 @@ void tst_QmlGraphicsPositioners::test_grid_spacing() QmlView *canvas = createView("data/grid-spacing.qml"); canvas->execute(); - qApp->processEvents(); QmlGraphicsRectangle *one = canvas->root()->findChild<QmlGraphicsRectangle*>("one"); QVERIFY(one != 0); @@ -314,9 +309,7 @@ void tst_QmlGraphicsPositioners::test_grid_animated() { QmlView *canvas = createView(SRCDIR "/data/grid-animated.qml"); canvas->execute(); - qApp->processEvents(); - QTest::qWait(0);//Let the animation start //Note that all animate in QmlGraphicsRectangle *one = canvas->root()->findChild<QmlGraphicsRectangle*>("one"); QVERIFY(one != 0); @@ -343,19 +336,20 @@ void tst_QmlGraphicsPositioners::test_grid_animated() QCOMPARE(five->x(), -100.0); QCOMPARE(five->y(), -100.0); - QTest::qWait(300);//Let the animation complete - - QCOMPARE(one->y(), 0.0); - QCOMPARE(one->x(), 0.0); - QCOMPARE(two->opacity(), 0.0); - QCOMPARE(two->y(), -100.0); - QCOMPARE(two->x(), -100.0); - QCOMPARE(three->y(), 0.0); - QCOMPARE(three->x(), 50.0); - QCOMPARE(four->y(), 0.0); - QCOMPARE(four->x(), 100.0); - QCOMPARE(five->y(), 50.0); - QCOMPARE(five->x(), 0.0); + //QTRY_COMPARE used instead of waiting for the expected time of animation completion + //Note that this means the duration of the animation is NOT tested + + QTRY_COMPARE(one->y(), 0.0); + QTRY_COMPARE(one->x(), 0.0); + QTRY_COMPARE(two->opacity(), 0.0); + QTRY_COMPARE(two->y(), -100.0); + QTRY_COMPARE(two->x(), -100.0); + QTRY_COMPARE(three->y(), 0.0); + QTRY_COMPARE(three->x(), 50.0); + QTRY_COMPARE(four->y(), 0.0); + QTRY_COMPARE(four->x(), 100.0); + QTRY_COMPARE(five->y(), 50.0); + QTRY_COMPARE(five->x(), 0.0); //Add 'two' two->setOpacity(1.0); @@ -371,17 +365,17 @@ void tst_QmlGraphicsPositioners::test_grid_animated() QCOMPARE(four->y(), 0.0); QCOMPARE(five->x(), 0.0); QCOMPARE(five->y(), 50.0); - QTest::qWait(300);//Let the animation complete - QCOMPARE(two->x(), 50.0); - QCOMPARE(two->y(), 0.0); - QCOMPARE(one->x(), 0.0); - QCOMPARE(one->y(), 0.0); - QCOMPARE(three->x(), 100.0); - QCOMPARE(three->y(), 0.0); - QCOMPARE(four->x(), 0.0); - QCOMPARE(four->y(), 50.0); - QCOMPARE(five->x(), 50.0); - QCOMPARE(five->y(), 50.0); + //Let the animation complete + QTRY_COMPARE(two->x(), 50.0); + QTRY_COMPARE(two->y(), 0.0); + QTRY_COMPARE(one->x(), 0.0); + QTRY_COMPARE(one->y(), 0.0); + QTRY_COMPARE(three->x(), 100.0); + QTRY_COMPARE(three->y(), 0.0); + QTRY_COMPARE(four->x(), 0.0); + QTRY_COMPARE(four->y(), 50.0); + QTRY_COMPARE(five->x(), 50.0); + QTRY_COMPARE(five->y(), 50.0); } @@ -390,7 +384,6 @@ void tst_QmlGraphicsPositioners::test_repeater() QmlView *canvas = createView("data/repeater.qml"); canvas->execute(); - qApp->processEvents(); QmlGraphicsRectangle *one = canvas->root()->findChild<QmlGraphicsRectangle*>("one"); QVERIFY(one != 0); diff --git a/tests/auto/declarative/qmlgraphicstextinput/data/navigation.qml b/tests/auto/declarative/qmlgraphicstextinput/data/navigation.qml index 7a2e914..493db5b 100644 --- a/tests/auto/declarative/qmlgraphicstextinput/data/navigation.qml +++ b/tests/auto/declarative/qmlgraphicstextinput/data/navigation.qml @@ -11,6 +11,7 @@ Rectangle { } TextInput { id: input; focus: true + text: "Needs some text" KeyNavigation.left: firstItem KeyNavigation.right: lastItem KeyNavigation.up: firstItem diff --git a/tests/auto/declarative/qmlgraphicstextinput/data/validators.qml b/tests/auto/declarative/qmlgraphicstextinput/data/validators.qml index 673790d..0c81548 100644 --- a/tests/auto/declarative/qmlgraphicstextinput/data/validators.qml +++ b/tests/auto/declarative/qmlgraphicstextinput/data/validators.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { property var intInput: intInput diff --git a/tests/auto/declarative/qmlgraphicstextinput/tst_qmlgraphicstextinput.cpp b/tests/auto/declarative/qmlgraphicstextinput/tst_qmlgraphicstextinput.cpp index 906dbc2..b7ae4a2 100644 --- a/tests/auto/declarative/qmlgraphicstextinput/tst_qmlgraphicstextinput.cpp +++ b/tests/auto/declarative/qmlgraphicstextinput/tst_qmlgraphicstextinput.cpp @@ -508,6 +508,7 @@ void tst_qmlgraphicstextinput::inputMethodHints() /* TextInput element should only handle left/right keys until the cursor reaches the extent of the text, then they should ignore the keys. + */ void tst_qmlgraphicstextinput::navigation() { @@ -518,14 +519,24 @@ void tst_qmlgraphicstextinput::navigation() QVERIFY(canvas->root() != 0); - QmlGraphicsItem *input = qobject_cast<QmlGraphicsItem *>(qvariant_cast<QObject *>(canvas->root()->property("myInput"))); + QmlGraphicsTextInput *input = qobject_cast<QmlGraphicsTextInput *>(qvariant_cast<QObject *>(canvas->root()->property("myInput"))); QVERIFY(input != 0); + input->setCursorPosition(0); QTRY_VERIFY(input->hasFocus() == true); simulateKey(canvas, Qt::Key_Left); QVERIFY(input->hasFocus() == false); simulateKey(canvas, Qt::Key_Right); QVERIFY(input->hasFocus() == true); + //QT-2944: If text is selected, then we should deselect first. + input->setCursorPosition(input->text().length()); + input->setSelectionStart(0); + input->setSelectionEnd(input->text().length()); + QVERIFY(input->selectionStart() != input->selectionEnd()); + simulateKey(canvas, Qt::Key_Right); + QVERIFY(input->selectionStart() == input->selectionEnd()); + QVERIFY(input->selectionStart() == input->text().length()); + QVERIFY(input->hasFocus() == true); simulateKey(canvas, Qt::Key_Right); QVERIFY(input->hasFocus() == false); simulateKey(canvas, Qt::Key_Left); diff --git a/tests/auto/declarative/qmlgraphicswebview/data/newwindows.qml b/tests/auto/declarative/qmlgraphicswebview/data/newwindows.qml index b8524af..0bc8263 100644 --- a/tests/auto/declarative/qmlgraphicswebview/data/newwindows.qml +++ b/tests/auto/declarative/qmlgraphicswebview/data/newwindows.qml @@ -17,6 +17,7 @@ Grid { WebView { id: webView + width: 150 // force predictable for test newWindowComponent: webViewPage newWindowParent: pages url: "newwindows.html" diff --git a/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp b/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp index 6996a6c..d48f11d 100644 --- a/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp +++ b/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp @@ -304,6 +304,9 @@ void tst_qmlgraphicswebview::multipleWindows() QmlGraphicsGrid *grid = qobject_cast<QmlGraphicsGrid*>(component.create()); QVERIFY(grid != 0); QTRY_COMPARE(grid->children().count(), 2+5); // Component, Loader, 5 WebViews + QmlGraphicsItem* popup = qobject_cast<QmlGraphicsItem*>(grid->children().at(3)); // first popup after Component, Loaded, original. + QVERIFY(popup != 0); + QTRY_COMPARE(popup->x(), 150.0); } void tst_qmlgraphicswebview::loadError() diff --git a/tests/auto/declarative/qmlnumberformatter/tst_qmlnumberformatter.cpp b/tests/auto/declarative/qmlnumberformatter/tst_qmlnumberformatter.cpp index bf71625..f8ac76c 100644 --- a/tests/auto/declarative/qmlnumberformatter/tst_qmlnumberformatter.cpp +++ b/tests/auto/declarative/qmlnumberformatter/tst_qmlnumberformatter.cpp @@ -45,12 +45,12 @@ #include <private/qnumberformat_p.h> #include <private/qmlnumberformatter_p.h> -class tst_numberformat : public QObject +class tst_qmlnumberformatter : public QObject { Q_OBJECT public: - tst_numberformat(); - + tst_qmlnumberformatter(); + void init() {} void initTestCase() {} @@ -67,7 +67,7 @@ private: QStringList texts; }; -tst_numberformat::tst_numberformat() +tst_qmlnumberformatter::tst_qmlnumberformatter() { strings << "100.0" << "12345" @@ -177,7 +177,7 @@ tst_numberformat::tst_numberformat() << "texts.size()" << texts.size(); } -void tst_numberformat::text_data() +void tst_qmlnumberformatter::text_data() { QTest::addColumn<QString>("string"); QTest::addColumn<QString>("format"); @@ -194,7 +194,7 @@ void tst_numberformat::text_data() } -void tst_numberformat::text() +void tst_qmlnumberformatter::text() { QFETCH(QString, string); QFETCH(QString, format); @@ -217,6 +217,6 @@ void tst_numberformat::text() delete formatter; } -QTEST_MAIN(tst_numberformat) +QTEST_MAIN(tst_qmlnumberformatter) #include "tst_qmlnumberformatter.moc" diff --git a/tests/auto/declarative/qmlstates/tst_qmlstates.cpp b/tests/auto/declarative/qmlstates/tst_qmlstates.cpp index fc348a5..2274889 100644 --- a/tests/auto/declarative/qmlstates/tst_qmlstates.cpp +++ b/tests/auto/declarative/qmlstates/tst_qmlstates.cpp @@ -46,11 +46,11 @@ #include <private/qmlpropertychanges_p.h> #include <private/qmlstategroup_p.h> -class tst_states : public QObject +class tst_qmlstates : public QObject { Q_OBJECT public: - tst_states() {} + tst_qmlstates() {} private: static QByteArray fullDataPath(const QString &path); @@ -81,12 +81,12 @@ private slots: void nonExistantProperty(); }; -QByteArray tst_states::fullDataPath(const QString &path) +QByteArray tst_qmlstates::fullDataPath(const QString &path) { return QUrl::fromLocalFile(SRCDIR + path).toString().toUtf8(); } -void tst_states::basicChanges() +void tst_qmlstates::basicChanges() { QmlEngine engine; @@ -156,7 +156,7 @@ void tst_states::basicChanges() } } -void tst_states::basicExtension() +void tst_qmlstates::basicExtension() { QmlEngine engine; @@ -220,7 +220,7 @@ void tst_states::basicExtension() } } -void tst_states::basicBinding() +void tst_qmlstates::basicBinding() { QmlEngine engine; @@ -346,7 +346,7 @@ Q_SIGNALS: QML_DECLARE_TYPE(MyRect) QML_DEFINE_TYPE(Qt.test, 1, 0, MyRectangle,MyRect); -void tst_states::signalOverride() +void tst_qmlstates::signalOverride() { QmlEngine engine; @@ -383,7 +383,7 @@ void tst_states::signalOverride() } } -void tst_states::signalOverrideCrash() +void tst_qmlstates::signalOverrideCrash() { QmlEngine engine; @@ -395,7 +395,7 @@ void tst_states::signalOverrideCrash() rect->doSomething(); } -void tst_states::parentChange() +void tst_qmlstates::parentChange() { QmlEngine engine; @@ -462,7 +462,7 @@ void tst_states::parentChange() } } -void tst_states::parentChangeErrors() +void tst_qmlstates::parentChangeErrors() { QmlEngine engine; @@ -499,7 +499,7 @@ void tst_states::parentChangeErrors() } } -void tst_states::anchorChanges() +void tst_qmlstates::anchorChanges() { QmlEngine engine; @@ -527,7 +527,7 @@ void tst_states::anchorChanges() delete rect; } -void tst_states::anchorChanges2() +void tst_qmlstates::anchorChanges2() { QmlEngine engine; @@ -548,7 +548,7 @@ void tst_states::anchorChanges2() delete rect; } -void tst_states::anchorChanges3() +void tst_qmlstates::anchorChanges3() { QmlEngine engine; @@ -594,7 +594,7 @@ void tst_states::anchorChanges3() delete rect; } -void tst_states::anchorChanges4() +void tst_qmlstates::anchorChanges4() { QmlEngine engine; @@ -625,7 +625,7 @@ void tst_states::anchorChanges4() delete rect; } -void tst_states::anchorChanges5() +void tst_qmlstates::anchorChanges5() { QmlEngine engine; @@ -656,7 +656,7 @@ void tst_states::anchorChanges5() delete rect; } -void tst_states::script() +void tst_qmlstates::script() { QmlEngine engine; @@ -675,7 +675,7 @@ void tst_states::script() } } -void tst_states::restoreEntryValues() +void tst_qmlstates::restoreEntryValues() { QmlEngine engine; @@ -692,7 +692,7 @@ void tst_states::restoreEntryValues() QCOMPARE(rect->color(),QColor("blue")); } -void tst_states::explicitChanges() +void tst_qmlstates::explicitChanges() { QmlEngine engine; @@ -722,7 +722,7 @@ void tst_states::explicitChanges() QCOMPARE(rect->color(),QColor("yellow")); } -void tst_states::propertyErrors() +void tst_qmlstates::propertyErrors() { QmlEngine engine; QmlComponent rectComponent(&engine, SRCDIR "/data/propertyErrors.qml"); @@ -736,7 +736,7 @@ void tst_states::propertyErrors() rect->setState("blue"); } -void tst_states::incorrectRestoreBug() +void tst_qmlstates::incorrectRestoreBug() { QmlEngine engine; @@ -762,7 +762,7 @@ void tst_states::incorrectRestoreBug() QCOMPARE(rect->color(),QColor("green")); } -void tst_states::autoStateAtStartupRestoreBug() +void tst_qmlstates::autoStateAtStartupRestoreBug() { QmlEngine engine; @@ -779,7 +779,7 @@ void tst_states::autoStateAtStartupRestoreBug() delete obj; } -void tst_states::deletingChange() +void tst_qmlstates::deletingChange() { QmlEngine engine; @@ -811,7 +811,7 @@ void tst_states::deletingChange() delete rect; } -void tst_states::deletingState() +void tst_qmlstates::deletingState() { QmlEngine engine; @@ -842,7 +842,7 @@ void tst_states::deletingState() delete rect; } -void tst_states::tempState() +void tst_qmlstates::tempState() { QmlEngine engine; @@ -856,7 +856,7 @@ void tst_states::tempState() QCOMPARE(rect->state(), QLatin1String("idle")); } -void tst_states::illegalTempState() +void tst_qmlstates::illegalTempState() { QmlEngine engine; @@ -869,7 +869,7 @@ void tst_states::illegalTempState() QCOMPARE(rect->state(), QLatin1String("placed")); } -void tst_states::nonExistantProperty() +void tst_qmlstates::nonExistantProperty() { QmlEngine engine; @@ -882,6 +882,6 @@ void tst_states::nonExistantProperty() QCOMPARE(rect->state(), QLatin1String("blue")); } -QTEST_MAIN(tst_states) +QTEST_MAIN(tst_qmlstates) #include "tst_qmlstates.moc" diff --git a/tests/auto/declarative/qmlvaluetypes/tst_qmlvaluetypes.cpp b/tests/auto/declarative/qmlvaluetypes/tst_qmlvaluetypes.cpp index 49655db..61ac93d 100644 --- a/tests/auto/declarative/qmlvaluetypes/tst_qmlvaluetypes.cpp +++ b/tests/auto/declarative/qmlvaluetypes/tst_qmlvaluetypes.cpp @@ -46,11 +46,11 @@ #include <private/qmlvaluetype_p.h> #include "testtypes.h" -class tst_valuetypes : public QObject +class tst_qmlvaluetypes : public QObject { Q_OBJECT public: - tst_valuetypes() {} + tst_qmlvaluetypes() {} private slots: void point(); @@ -84,7 +84,7 @@ inline QUrl TEST_FILE(const QString &filename) return QUrl::fromLocalFile(QLatin1String(SRCDIR) + QLatin1String("/data/") + filename); } -void tst_valuetypes::point() +void tst_qmlvaluetypes::point() { { QmlComponent component(&engine, TEST_FILE("point_read.qml")); @@ -109,7 +109,7 @@ void tst_valuetypes::point() } } -void tst_valuetypes::pointf() +void tst_qmlvaluetypes::pointf() { { QmlComponent component(&engine, TEST_FILE("pointf_read.qml")); @@ -134,7 +134,7 @@ void tst_valuetypes::pointf() } } -void tst_valuetypes::size() +void tst_qmlvaluetypes::size() { { QmlComponent component(&engine, TEST_FILE("size_read.qml")); @@ -159,7 +159,7 @@ void tst_valuetypes::size() } } -void tst_valuetypes::sizef() +void tst_qmlvaluetypes::sizef() { { QmlComponent component(&engine, TEST_FILE("sizef_read.qml")); @@ -184,7 +184,7 @@ void tst_valuetypes::sizef() } } -void tst_valuetypes::rect() +void tst_qmlvaluetypes::rect() { { QmlComponent component(&engine, TEST_FILE("rect_read.qml")); @@ -211,7 +211,7 @@ void tst_valuetypes::rect() } } -void tst_valuetypes::rectf() +void tst_qmlvaluetypes::rectf() { { QmlComponent component(&engine, TEST_FILE("rectf_read.qml")); @@ -238,7 +238,7 @@ void tst_valuetypes::rectf() } } -void tst_valuetypes::vector3d() +void tst_qmlvaluetypes::vector3d() { { QmlComponent component(&engine, TEST_FILE("vector3d_read.qml")); @@ -264,7 +264,7 @@ void tst_valuetypes::vector3d() } } -void tst_valuetypes::font() +void tst_qmlvaluetypes::font() { { QmlComponent component(&engine, TEST_FILE("font_read.qml")); @@ -337,7 +337,7 @@ void tst_valuetypes::font() } // Test bindings can write to value types -void tst_valuetypes::bindingAssignment() +void tst_qmlvaluetypes::bindingAssignment() { QmlComponent component(&engine, TEST_FILE("bindingAssignment.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); @@ -353,7 +353,7 @@ void tst_valuetypes::bindingAssignment() } // Test bindings can read from value types -void tst_valuetypes::bindingRead() +void tst_qmlvaluetypes::bindingRead() { QmlComponent component(&engine, TEST_FILE("bindingRead.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); @@ -369,7 +369,7 @@ void tst_valuetypes::bindingRead() } // Test static values can assign to value types -void tst_valuetypes::staticAssignment() +void tst_qmlvaluetypes::staticAssignment() { QmlComponent component(&engine, TEST_FILE("staticAssignment.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); @@ -381,7 +381,7 @@ void tst_valuetypes::staticAssignment() } // Test scripts can read/write value types -void tst_valuetypes::scriptAccess() +void tst_qmlvaluetypes::scriptAccess() { QmlComponent component(&engine, TEST_FILE("scriptAccess.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); @@ -395,7 +395,7 @@ void tst_valuetypes::scriptAccess() } // Test that assigning a constant from script removes any binding -void tst_valuetypes::autoBindingRemoval() +void tst_qmlvaluetypes::autoBindingRemoval() { { QmlComponent component(&engine, TEST_FILE("autoBindingRemoval.qml")); @@ -466,7 +466,7 @@ void tst_valuetypes::autoBindingRemoval() } // Test that property value sources assign to value types -void tst_valuetypes::valueSources() +void tst_qmlvaluetypes::valueSources() { QmlComponent component(&engine, TEST_FILE("valueSources.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); @@ -489,7 +489,7 @@ static void checkNoErrors(QmlComponent& component) } // Test that property value interceptors can be applied to value types -void tst_valuetypes::valueInterceptors() +void tst_qmlvaluetypes::valueInterceptors() { QmlComponent component(&engine, TEST_FILE("valueInterceptors.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); @@ -507,7 +507,7 @@ void tst_valuetypes::valueInterceptors() } // Test that you can't assign a binding to the "root" value type, and a sub-property -void tst_valuetypes::bindingConflict() +void tst_qmlvaluetypes::bindingConflict() { QmlComponent component(&engine, TEST_FILE("bindingConflict.qml")); QCOMPARE(component.isError(), true); @@ -524,7 +524,7 @@ void tst_valuetypes::bindingConflict() // Test that accessing a reference to a valuetype after the owning object is deleted // doesn't crash -void tst_valuetypes::deletedObject() +void tst_qmlvaluetypes::deletedObject() { QmlComponent component(&engine, TEST_FILE("deletedObject.qml")); QTest::ignoreMessage(QtDebugMsg, "Test: 2"); @@ -542,7 +542,7 @@ void tst_valuetypes::deletedObject() } // Test that value types can be assigned to another value type property in a binding -void tst_valuetypes::bindingVariantCopy() +void tst_qmlvaluetypes::bindingVariantCopy() { QmlComponent component(&engine, TEST_FILE("bindingVariantCopy.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); @@ -554,7 +554,7 @@ void tst_valuetypes::bindingVariantCopy() } // Test that value types can be assigned to another value type property in script -void tst_valuetypes::scriptVariantCopy() +void tst_qmlvaluetypes::scriptVariantCopy() { QmlComponent component(&engine, TEST_FILE("scriptVariantCopy.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); @@ -571,7 +571,7 @@ void tst_valuetypes::scriptVariantCopy() // Test that the value type classes can be used manually -void tst_valuetypes::cppClasses() +void tst_qmlvaluetypes::cppClasses() { CPP_TEST(QmlPointValueType, QPoint(19, 33)); CPP_TEST(QmlPointFValueType, QPointF(33.6, -23)); @@ -583,6 +583,6 @@ void tst_valuetypes::cppClasses() CPP_TEST(QmlFontValueType, QFont("Helvetica")); } -QTEST_MAIN(tst_valuetypes) +QTEST_MAIN(tst_qmlvaluetypes) #include "tst_qmlvaluetypes.moc" diff --git a/tests/auto/declarative/qmlxmlhttprequest/tst_qmlxmlhttprequest.cpp b/tests/auto/declarative/qmlxmlhttprequest/tst_qmlxmlhttprequest.cpp index df5442c..96f9ec6 100644 --- a/tests/auto/declarative/qmlxmlhttprequest/tst_qmlxmlhttprequest.cpp +++ b/tests/auto/declarative/qmlxmlhttprequest/tst_qmlxmlhttprequest.cpp @@ -48,11 +48,11 @@ #define SERVER_PORT 14445 -class tst_xmlhttprequest : public QObject +class tst_qmlxmlhttprequest : public QObject { Q_OBJECT public: - tst_xmlhttprequest() {} + tst_qmlxmlhttprequest() {} private slots: void initTestCase() { @@ -123,7 +123,7 @@ inline QUrl TEST_FILE(const QString &filename) } // Test that the dom exception codes are correct -void tst_xmlhttprequest::domExceptionCodes() +void tst_qmlxmlhttprequest::domExceptionCodes() { QmlComponent component(&engine, TEST_FILE("domExceptionCodes.qml")); QObject *object = component.create(); @@ -160,7 +160,7 @@ void tst_xmlhttprequest::domExceptionCodes() } while (false) -void tst_xmlhttprequest::callbackException_data() +void tst_qmlxmlhttprequest::callbackException_data() { QTest::addColumn<QString>("which"); QTest::addColumn<int>("line"); @@ -170,7 +170,7 @@ void tst_xmlhttprequest::callbackException_data() QTest::newRow("on-done") << "4" << 15; } -void tst_xmlhttprequest::callbackException() +void tst_qmlxmlhttprequest::callbackException() { // Test exception reporting for exceptions thrown at various points. @@ -194,7 +194,7 @@ void tst_xmlhttprequest::callbackException() // Test that the state value properties on the XMLHttpRequest constructor have the correct values. // ### WebKit does not do this, but it seems to fit the standard and QML better -void tst_xmlhttprequest::staticStateValues() +void tst_qmlxmlhttprequest::staticStateValues() { QmlComponent component(&engine, TEST_FILE("staticStateValues.qml")); QObject *object = component.create(); @@ -210,7 +210,7 @@ void tst_xmlhttprequest::staticStateValues() } // Test that the state value properties on instances have the correct values. -void tst_xmlhttprequest::instanceStateValues() +void tst_qmlxmlhttprequest::instanceStateValues() { QmlComponent component(&engine, TEST_FILE("instanceStateValues.qml")); QObject *object = component.create(); @@ -226,7 +226,7 @@ void tst_xmlhttprequest::instanceStateValues() } // Test calling constructor -void tst_xmlhttprequest::constructor() +void tst_qmlxmlhttprequest::constructor() { QmlComponent component(&engine, TEST_FILE("constructor.qml")); QObject *object = component.create(); @@ -239,7 +239,7 @@ void tst_xmlhttprequest::constructor() } // Test that all the properties are set correctly before any request is sent -void tst_xmlhttprequest::defaultState() +void tst_qmlxmlhttprequest::defaultState() { QmlComponent component(&engine, TEST_FILE("defaultState.qml")); QObject *object = component.create(); @@ -255,7 +255,7 @@ void tst_xmlhttprequest::defaultState() } // Test valid XMLHttpRequest.open() calls -void tst_xmlhttprequest::open() +void tst_qmlxmlhttprequest::open() { // Relative url { @@ -353,7 +353,7 @@ void tst_xmlhttprequest::open() } // Test that calling XMLHttpRequest.open() with an invalid method raises an exception -void tst_xmlhttprequest::open_invalid_method() +void tst_qmlxmlhttprequest::open_invalid_method() { QmlComponent component(&engine, TEST_FILE("open_invalid_method.qml")); QObject *object = component.create(); @@ -365,7 +365,7 @@ void tst_xmlhttprequest::open_invalid_method() } // Test that calling XMLHttpRequest.open() with sync raises an exception -void tst_xmlhttprequest::open_sync() +void tst_qmlxmlhttprequest::open_sync() { QmlComponent component(&engine, TEST_FILE("open_sync.qml")); QObject *object = component.create(); @@ -377,7 +377,7 @@ void tst_xmlhttprequest::open_sync() } // Calling with incorrect arg count raises an exception -void tst_xmlhttprequest::open_arg_count() +void tst_qmlxmlhttprequest::open_arg_count() { { QmlComponent component(&engine, TEST_FILE("open_arg_count.1.qml")); @@ -401,7 +401,7 @@ void tst_xmlhttprequest::open_arg_count() } // Test valid setRequestHeader() calls -void tst_xmlhttprequest::setRequestHeader() +void tst_qmlxmlhttprequest::setRequestHeader() { TestHTTPServer server(SERVER_PORT); QVERIFY(server.isValid()); @@ -421,7 +421,7 @@ void tst_xmlhttprequest::setRequestHeader() } // Test setting headers before open() throws exception -void tst_xmlhttprequest::setRequestHeader_unsent() +void tst_qmlxmlhttprequest::setRequestHeader_unsent() { QmlComponent component(&engine, TEST_FILE("setRequestHeader_unsent.qml")); QObject *object = component.create(); @@ -432,7 +432,7 @@ void tst_xmlhttprequest::setRequestHeader_unsent() delete object; } -void tst_xmlhttprequest::setRequestHeader_illegalName_data() +void tst_qmlxmlhttprequest::setRequestHeader_illegalName_data() { QTest::addColumn<QString>("name"); @@ -461,7 +461,7 @@ void tst_xmlhttprequest::setRequestHeader_illegalName_data() } // Tests that using illegal header names has no effect -void tst_xmlhttprequest::setRequestHeader_illegalName() +void tst_qmlxmlhttprequest::setRequestHeader_illegalName() { QFETCH(QString, name); @@ -491,7 +491,7 @@ void tst_xmlhttprequest::setRequestHeader_illegalName() } // Test that attempting to set a header after a request is sent throws an exception -void tst_xmlhttprequest::setRequestHeader_sent() +void tst_qmlxmlhttprequest::setRequestHeader_sent() { TestHTTPServer server(SERVER_PORT); QVERIFY(server.isValid()); @@ -513,7 +513,7 @@ void tst_xmlhttprequest::setRequestHeader_sent() } // Invalid arg count throws exception -void tst_xmlhttprequest::setRequestHeader_args() +void tst_qmlxmlhttprequest::setRequestHeader_args() { QmlComponent component(&engine, TEST_FILE("setRequestHeader_args.qml")); QObject *object = component.create(); @@ -525,7 +525,7 @@ void tst_xmlhttprequest::setRequestHeader_args() } // Test that calling send() in UNSENT state throws an exception -void tst_xmlhttprequest::send_unsent() +void tst_qmlxmlhttprequest::send_unsent() { QmlComponent component(&engine, TEST_FILE("send_unsent.qml")); QObject *object = component.create(); @@ -537,7 +537,7 @@ void tst_xmlhttprequest::send_unsent() } // Test attempting to resend a sent request throws an exception -void tst_xmlhttprequest::send_alreadySent() +void tst_qmlxmlhttprequest::send_alreadySent() { QmlComponent component(&engine, TEST_FILE("send_alreadySent.qml")); QObject *object = component.create(); @@ -550,7 +550,7 @@ void tst_xmlhttprequest::send_alreadySent() } // Test that send for a GET or HEAD ignores data -void tst_xmlhttprequest::send_ignoreData() +void tst_qmlxmlhttprequest::send_ignoreData() { { TestHTTPServer server(SERVER_PORT); @@ -592,7 +592,7 @@ void tst_xmlhttprequest::send_ignoreData() } // Test that send()'ing data works -void tst_xmlhttprequest::send_withdata() +void tst_qmlxmlhttprequest::send_withdata() { // No content-type { @@ -729,7 +729,7 @@ void tst_xmlhttprequest::send_withdata() } // Test abort() has no effect in unsent state -void tst_xmlhttprequest::abort_unsent() +void tst_qmlxmlhttprequest::abort_unsent() { QmlComponent component(&engine, TEST_FILE("abort_unsent.qml")); QObject *object = component.beginCreate(engine.rootContext()); @@ -750,7 +750,7 @@ void tst_xmlhttprequest::abort_unsent() } // Test abort() cancels an open (but unsent) request -void tst_xmlhttprequest::abort_opened() +void tst_qmlxmlhttprequest::abort_opened() { QmlComponent component(&engine, TEST_FILE("abort_opened.qml")); QObject *object = component.beginCreate(engine.rootContext()); @@ -771,7 +771,7 @@ void tst_xmlhttprequest::abort_opened() } // Test abort() aborts in progress send -void tst_xmlhttprequest::abort() +void tst_qmlxmlhttprequest::abort() { TestHTTPServer server(SERVER_PORT); QVERIFY(server.isValid()); @@ -795,7 +795,7 @@ void tst_xmlhttprequest::abort() delete object; } -void tst_xmlhttprequest::getResponseHeader() +void tst_qmlxmlhttprequest::getResponseHeader() { QmlEngine engine; // Avoid cookie contamination @@ -835,7 +835,7 @@ void tst_xmlhttprequest::getResponseHeader() } // Test getResponseHeader throws an exception in an invalid state -void tst_xmlhttprequest::getResponseHeader_unsent() +void tst_qmlxmlhttprequest::getResponseHeader_unsent() { QmlComponent component(&engine, TEST_FILE("getResponseHeader_unsent.qml")); QObject *object = component.create(); @@ -847,7 +847,7 @@ void tst_xmlhttprequest::getResponseHeader_unsent() } // Test getResponseHeader throws an exception in an invalid state -void tst_xmlhttprequest::getResponseHeader_sent() +void tst_qmlxmlhttprequest::getResponseHeader_sent() { QmlComponent component(&engine, TEST_FILE("getResponseHeader_sent.qml")); QObject *object = component.create(); @@ -859,7 +859,7 @@ void tst_xmlhttprequest::getResponseHeader_sent() } // Invalid arg count throws exception -void tst_xmlhttprequest::getResponseHeader_args() +void tst_qmlxmlhttprequest::getResponseHeader_args() { QmlComponent component(&engine, TEST_FILE("getResponseHeader_args.qml")); QObject *object = component.create(); @@ -870,7 +870,7 @@ void tst_xmlhttprequest::getResponseHeader_args() delete object; } -void tst_xmlhttprequest::getAllResponseHeaders() +void tst_qmlxmlhttprequest::getAllResponseHeaders() { QmlEngine engine; // Avoid cookie contamination @@ -903,7 +903,7 @@ void tst_xmlhttprequest::getAllResponseHeaders() } // Test getAllResponseHeaders throws an exception in an invalid state -void tst_xmlhttprequest::getAllResponseHeaders_unsent() +void tst_qmlxmlhttprequest::getAllResponseHeaders_unsent() { QmlComponent component(&engine, TEST_FILE("getAllResponseHeaders_unsent.qml")); QObject *object = component.create(); @@ -915,7 +915,7 @@ void tst_xmlhttprequest::getAllResponseHeaders_unsent() } // Test getAllResponseHeaders throws an exception in an invalid state -void tst_xmlhttprequest::getAllResponseHeaders_sent() +void tst_qmlxmlhttprequest::getAllResponseHeaders_sent() { QmlComponent component(&engine, TEST_FILE("getAllResponseHeaders_sent.qml")); QObject *object = component.create(); @@ -927,7 +927,7 @@ void tst_xmlhttprequest::getAllResponseHeaders_sent() } // Invalid arg count throws exception -void tst_xmlhttprequest::getAllResponseHeaders_args() +void tst_qmlxmlhttprequest::getAllResponseHeaders_args() { QmlComponent component(&engine, TEST_FILE("getAllResponseHeaders_args.qml")); QObject *object = component.create(); @@ -938,7 +938,7 @@ void tst_xmlhttprequest::getAllResponseHeaders_args() delete object; } -void tst_xmlhttprequest::status() +void tst_qmlxmlhttprequest::status() { { TestHTTPServer server(SERVER_PORT); @@ -995,7 +995,7 @@ void tst_xmlhttprequest::status() } } -void tst_xmlhttprequest::statusText() +void tst_qmlxmlhttprequest::statusText() { { TestHTTPServer server(SERVER_PORT); @@ -1052,7 +1052,7 @@ void tst_xmlhttprequest::statusText() } } -void tst_xmlhttprequest::responseText() +void tst_qmlxmlhttprequest::responseText() { { TestHTTPServer server(SERVER_PORT); @@ -1138,7 +1138,7 @@ void tst_xmlhttprequest::responseText() // Test that calling hte XMLHttpRequest methods on a non-XMLHttpRequest object // throws an exception -void tst_xmlhttprequest::invalidMethodUsage() +void tst_qmlxmlhttprequest::invalidMethodUsage() { QmlComponent component(&engine, TEST_FILE("invalidMethodUsage.qml")); QObject *object = component.create(); @@ -1162,7 +1162,7 @@ void tst_xmlhttprequest::invalidMethodUsage() } // Test that XMLHttpRequest transparently redirects -void tst_xmlhttprequest::redirects() +void tst_qmlxmlhttprequest::redirects() { { TestHTTPServer server(SERVER_PORT); @@ -1227,7 +1227,7 @@ void tst_xmlhttprequest::redirects() } } -void tst_xmlhttprequest::responseXML_invalid() +void tst_qmlxmlhttprequest::responseXML_invalid() { QmlComponent component(&engine, TEST_FILE("responseXML_invalid.qml")); QObject *object = component.create(); @@ -1241,7 +1241,7 @@ void tst_xmlhttprequest::responseXML_invalid() } // Test the Document DOM element -void tst_xmlhttprequest::document() +void tst_qmlxmlhttprequest::document() { QmlComponent component(&engine, TEST_FILE("document.qml")); QObject *object = component.create(); @@ -1255,7 +1255,7 @@ void tst_xmlhttprequest::document() } // Test the Element DOM element -void tst_xmlhttprequest::element() +void tst_qmlxmlhttprequest::element() { QmlComponent component(&engine, TEST_FILE("element.qml")); QObject *object = component.create(); @@ -1269,7 +1269,7 @@ void tst_xmlhttprequest::element() } // Test the Attr DOM element -void tst_xmlhttprequest::attr() +void tst_qmlxmlhttprequest::attr() { QmlComponent component(&engine, TEST_FILE("attr.qml")); QObject *object = component.create(); @@ -1283,7 +1283,7 @@ void tst_xmlhttprequest::attr() } // Test the Text DOM element -void tst_xmlhttprequest::text() +void tst_qmlxmlhttprequest::text() { QmlComponent component(&engine, TEST_FILE("text.qml")); QObject *object = component.create(); @@ -1297,7 +1297,7 @@ void tst_xmlhttprequest::text() } // Test the CDataSection DOM element -void tst_xmlhttprequest::cdata() +void tst_qmlxmlhttprequest::cdata() { QmlComponent component(&engine, TEST_FILE("cdata.qml")); QObject *object = component.create(); @@ -1310,6 +1310,6 @@ void tst_xmlhttprequest::cdata() delete object; } -QTEST_MAIN(tst_xmlhttprequest) +QTEST_MAIN(tst_qmlxmlhttprequest) #include "tst_qmlxmlhttprequest.moc" diff --git a/tests/auto/declarative/shared/debugutil.cpp b/tests/auto/declarative/shared/debugutil.cpp index aa0cd31..0010508 100644 --- a/tests/auto/declarative/shared/debugutil.cpp +++ b/tests/auto/declarative/shared/debugutil.cpp @@ -47,6 +47,8 @@ #include "debugutil_p.h" +#include <iostream> + bool QmlDebugTest::waitForSignal(QObject *receiver, const char *member, int timeout) { QEventLoop loop; QTimer timer; @@ -117,21 +119,22 @@ void QmlDebugTestClient::messageReceived(const QByteArray &ba) tst_QmlDebug_Thread::tst_QmlDebug_Thread(QmlDebugTestData *data, QmlTestFactory *factory) - : m_ready(false), m_data(data), m_factory(factory) + : m_data(data), m_factory(factory) { } void tst_QmlDebug_Thread::run() { - QTest::qWait(1000); + bool ok = false; QmlDebugConnection conn; conn.connectToHost("127.0.0.1", 3768); - bool ok = conn.waitForConnected(5000); + ok = conn.waitForConnected(); Q_ASSERT(ok); - while (!m_ready) - QTest::qWait(100); + QEventLoop loop; + connect(m_data, SIGNAL(engineCreated()), &loop, SLOT(quit())); + loop.exec(); m_data->conn = &conn; @@ -139,10 +142,10 @@ void tst_QmlDebug_Thread::run() QObject *test = m_factory->createTest(m_data); Q_ASSERT(test); int code = QTest::qExec(test, QCoreApplication::arguments()); + delete test; emit testsFinished(code); } - int QmlDebugTest::runTests(QmlTestFactory *factory, const QList<QByteArray> &qml) { qputenv("QML_DEBUG_SERVER_PORT", "3768"); @@ -152,7 +155,8 @@ int QmlDebugTest::runTests(QmlTestFactory *factory, const QList<QByteArray> &qml tst_QmlDebug_Thread thread(&data, factory); QObject::connect(&thread, SIGNAL(testsFinished(int)), &data, SLOT(testsFinished(int))); - thread.start(); + + QmlDebugService::notifyOnServerStart(&thread, "start"); QmlEngine engine; // blocks until client connects @@ -165,7 +169,7 @@ int QmlDebugTest::runTests(QmlTestFactory *factory, const QList<QByteArray> &qml // start the test data.engine = &engine; - thread.m_ready = true; + emit data.engineCreated(); loop.exec(); thread.wait(); @@ -173,4 +177,3 @@ int QmlDebugTest::runTests(QmlTestFactory *factory, const QList<QByteArray> &qml return data.exitCode; } - diff --git a/tests/auto/declarative/shared/debugutil_p.h b/tests/auto/declarative/shared/debugutil_p.h index 313d16c..6f23899 100644 --- a/tests/auto/declarative/shared/debugutil_p.h +++ b/tests/auto/declarative/shared/debugutil_p.h @@ -51,6 +51,15 @@ #include <private/qmldebugservice_p.h> #include <private/qmlgraphicsitem_p.h> +class QmlTestFactory; + +class QmlDebugTest +{ +public: + static bool waitForSignal(QObject *receiver, const char *member, int timeout = 5000); + + static int runTests(QmlTestFactory *factory, const QList<QByteArray> &qml = QList<QByteArray>()); +}; class QmlDebugTestData : public QObject { @@ -68,8 +77,14 @@ public: QList<QmlGraphicsItem *> items; +signals: + void engineCreated(); + public slots: void testsFinished(int code); + +private: + friend class QmlDebugTest; }; @@ -82,14 +97,6 @@ public: virtual QObject *createTest(QmlDebugTestData *data) = 0; }; - -namespace QmlDebugTest { - - bool waitForSignal(QObject *receiver, const char *member, int timeout = 5000); - - int runTests(QmlTestFactory *factory, const QList<QByteArray> &qml = QList<QByteArray>()); -} - class QmlDebugTestService : public QmlDebugService { Q_OBJECT @@ -132,8 +139,6 @@ public: void run(); - bool m_ready; - signals: void testsFinished(int); |