diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2010-02-23 01:36:05 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2010-02-23 01:36:05 (GMT) |
commit | 27f35a9cb588ad1dd595fafedc27e5a216bebf48 (patch) | |
tree | 26aeebf20b725a340ad58b3411257fed7b626423 /tests/auto | |
parent | d7c472e23b678b2898d34a37166e61402818e271 (diff) | |
parent | 14447cbbf7ee93e03286112b5b27d20961fd9551 (diff) | |
download | Qt-27f35a9cb588ad1dd595fafedc27e5a216bebf48.zip Qt-27f35a9cb588ad1dd595fafedc27e5a216bebf48.tar.gz Qt-27f35a9cb588ad1dd595fafedc27e5a216bebf48.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-qml
Diffstat (limited to 'tests/auto')
218 files changed, 1485 insertions, 1152 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index a2c682b..7ba6243 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -460,17 +460,16 @@ SUBDIRS += \ qplugin \ qpluginloader \ qscrollbar \ - qsharedmemory \ qsidebar \ qsizegrip \ qsqldriver \ - qsystemsemaphore \ qtconcurrentfilter \ qtconcurrentiteratekernel \ qtconcurrentmap \ qtconcurrentrun \ qtconcurrentthreadengine \ qthreadpool \ + qtipc \ qtokenautomaton \ qtouchevent \ qwidget_window \ @@ -534,15 +533,16 @@ SUBDIRS += checkxmlfiles \ xmlpatternsdiagnosticsts \ xmlpatternsschema \ xmlpatternsschemats \ + xmlpatternssdk \ xmlpatternsvalidator \ xmlpatternsview \ xmlpatternsxqts \ xmlpatternsxslts -xmlpatternsdiagnosticsts.depends = xmlpatternsxqts -xmlpatternsview.depends = xmlpatternsxqts -xmlpatternsxslts.depends = xmlpatternsxqts -xmlpatternsschemats.depends = xmlpatternsxqts +xmlpatternsdiagnosticsts.depends = xmlpatternssdk +xmlpatternsview.depends = xmlpatternssdk +xmlpatternsxslts.depends = xmlpatternssdk +xmlpatternsschemats.depends = xmlpatternssdk } unix:!embedded:contains(QT_CONFIG, dbus):SUBDIRS += \ diff --git a/tests/auto/compilerwarnings/compilerwarnings.qrc b/tests/auto/compilerwarnings/compilerwarnings.qrc index 40fa8f1..3fa313c 100644 --- a/tests/auto/compilerwarnings/compilerwarnings.qrc +++ b/tests/auto/compilerwarnings/compilerwarnings.qrc @@ -1,5 +1,5 @@ <!DOCTYPE RCC><RCC version="1.0"> <qresource> - <file>test.cpp</file> + <file>test_cpp.txt</file> </qresource> </RCC> diff --git a/tests/auto/compilerwarnings/test.cpp b/tests/auto/compilerwarnings/test_cpp.txt index 62b35eb..62b35eb 100644 --- a/tests/auto/compilerwarnings/test.cpp +++ b/tests/auto/compilerwarnings/test_cpp.txt diff --git a/tests/auto/compilerwarnings/tst_compilerwarnings.cpp b/tests/auto/compilerwarnings/tst_compilerwarnings.cpp index 27624e9..f910a18 100644 --- a/tests/auto/compilerwarnings/tst_compilerwarnings.cpp +++ b/tests/auto/compilerwarnings/tst_compilerwarnings.cpp @@ -148,7 +148,7 @@ void tst_CompilerWarnings::warnings() if (tmpSourceFile.isEmpty()) { tmpQSourceFile.open(QIODevice::ReadWrite | QIODevice::Truncate); tmpSourceFile = tmpQSourceFile.fileName(); - QFile cppSource(":/test.cpp"); + QFile cppSource(":/test_cpp.txt"); bool openResult = cppSource.open(QIODevice::ReadOnly); if (openResult) { @@ -158,7 +158,7 @@ void tst_CompilerWarnings::warnings() } } tmpQSourceFile.close(); - QVERIFY2(openResult, "Need resource temporary \"test.cpp\""); + QVERIFY2(openResult, "Need resource temporary \"test_cpp.txt\""); QStringList args; QString compilerName; diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index 45b5218..645f794 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -29,7 +29,7 @@ SUBDIRS += \ qmlgraphicsitem \ # Cover qmlgraphicslistview \ # Cover qmlgraphicsloader \ # Cover - qmlgraphicsmouseregion \ # Cover + qmlgraphicsmousearea \ # Cover qmlgraphicsparticles \ # Cover qmlgraphicspathview \ # Cover qmlgraphicspositioners \ # Cover @@ -40,7 +40,6 @@ SUBDIRS += \ qmlinstruction \ # Cover qmllanguage \ # Cover qmllist \ # Cover - qmllistaccessor \ # Cover qmllistmodel \ # Cover qmlmetaproperty \ # Cover qmlmetatype \ # Cover diff --git a/tests/auto/declarative/qmlanimations/data/badtype4.qml b/tests/auto/declarative/qmlanimations/data/badtype4.qml index 2ffed37..e80762f 100644 --- a/tests/auto/declarative/qmlanimations/data/badtype4.qml +++ b/tests/auto/declarative/qmlanimations/data/badtype4.qml @@ -10,7 +10,7 @@ Rectangle { color: "red" width: 50; height: 50 x: 100; y: 100 - MouseRegion { + MouseArea { anchors.fill: parent onClicked: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1"; } diff --git a/tests/auto/declarative/qmlanimations/data/dotproperty.qml b/tests/auto/declarative/qmlanimations/data/dotproperty.qml index 08bb5d8..9f0e699 100644 --- a/tests/auto/declarative/qmlanimations/data/dotproperty.qml +++ b/tests/auto/declarative/qmlanimations/data/dotproperty.qml @@ -9,7 +9,7 @@ Rectangle { color: "red" width: 50; height: 50 x: 100; y: 100 - MouseRegion { + MouseArea { anchors.fill: parent onClicked: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1"; } diff --git a/tests/auto/declarative/qmlanimations/data/mixedtype1.qml b/tests/auto/declarative/qmlanimations/data/mixedtype1.qml index b46270c..6770366 100644 --- a/tests/auto/declarative/qmlanimations/data/mixedtype1.qml +++ b/tests/auto/declarative/qmlanimations/data/mixedtype1.qml @@ -10,7 +10,7 @@ Rectangle { color: "red" width: 50; height: 50 x: 100; y: 100 - MouseRegion { + MouseArea { anchors.fill: parent onClicked: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1"; } diff --git a/tests/auto/declarative/qmlanimations/data/mixedtype2.qml b/tests/auto/declarative/qmlanimations/data/mixedtype2.qml index 15537f1..80c9473 100644 --- a/tests/auto/declarative/qmlanimations/data/mixedtype2.qml +++ b/tests/auto/declarative/qmlanimations/data/mixedtype2.qml @@ -10,7 +10,7 @@ Rectangle { color: "red" width: 50; height: 50 x: 100; y: 100 - MouseRegion { + MouseArea { anchors.fill: parent onClicked: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1"; } diff --git a/tests/auto/declarative/qmlanimations/data/propertiesTransition.qml b/tests/auto/declarative/qmlanimations/data/propertiesTransition.qml index 2f7fd4a..b13b94b 100644 --- a/tests/auto/declarative/qmlanimations/data/propertiesTransition.qml +++ b/tests/auto/declarative/qmlanimations/data/propertiesTransition.qml @@ -22,7 +22,7 @@ Rectangle { NumberAnimation { targets: theRect; properties: "x" } } - MouseRegion { + MouseArea { anchors.fill: parent onClicked: parent.state = "moved" } diff --git a/tests/auto/declarative/qmlanimations/data/propertiesTransition2.qml b/tests/auto/declarative/qmlanimations/data/propertiesTransition2.qml index ae59157..033c5c1 100644 --- a/tests/auto/declarative/qmlanimations/data/propertiesTransition2.qml +++ b/tests/auto/declarative/qmlanimations/data/propertiesTransition2.qml @@ -22,7 +22,7 @@ Rectangle { NumberAnimation { target: theRect; property: "y"; to: 200 } } - MouseRegion { + MouseArea { anchors.fill: parent onClicked: parent.state = "moved" } diff --git a/tests/auto/declarative/qmlanimations/data/propertiesTransition3.qml b/tests/auto/declarative/qmlanimations/data/propertiesTransition3.qml index 5aaaab8..d0704c9 100644 --- a/tests/auto/declarative/qmlanimations/data/propertiesTransition3.qml +++ b/tests/auto/declarative/qmlanimations/data/propertiesTransition3.qml @@ -22,7 +22,7 @@ Rectangle { NumberAnimation { targets: theRect; properties: "y" } } - MouseRegion { + MouseArea { anchors.fill: parent onClicked: parent.state = "moved" } diff --git a/tests/auto/declarative/qmlanimations/data/propertiesTransition4.qml b/tests/auto/declarative/qmlanimations/data/propertiesTransition4.qml index b7ebb1b..e70c95c 100644 --- a/tests/auto/declarative/qmlanimations/data/propertiesTransition4.qml +++ b/tests/auto/declarative/qmlanimations/data/propertiesTransition4.qml @@ -22,7 +22,7 @@ Rectangle { NumberAnimation { target: theRect; properties: "x" } } - MouseRegion { + MouseArea { anchors.fill: parent onClicked: parent.state = "moved" } diff --git a/tests/auto/declarative/qmlanimations/data/propertiesTransition5.qml b/tests/auto/declarative/qmlanimations/data/propertiesTransition5.qml index 9034fc5..b9e27da 100644 --- a/tests/auto/declarative/qmlanimations/data/propertiesTransition5.qml +++ b/tests/auto/declarative/qmlanimations/data/propertiesTransition5.qml @@ -22,7 +22,7 @@ Rectangle { NumberAnimation { targets: theRect; property: "x" } } - MouseRegion { + MouseArea { anchors.fill: parent onClicked: parent.state = "moved" } diff --git a/tests/auto/declarative/qmlanimations/data/propertiesTransition6.qml b/tests/auto/declarative/qmlanimations/data/propertiesTransition6.qml index 3d8be51..7417ed1 100644 --- a/tests/auto/declarative/qmlanimations/data/propertiesTransition6.qml +++ b/tests/auto/declarative/qmlanimations/data/propertiesTransition6.qml @@ -22,7 +22,7 @@ Rectangle { NumberAnimation { targets: theItem; properties: "x" } } - MouseRegion { + MouseArea { anchors.fill: parent onClicked: parent.state = "moved" } diff --git a/tests/auto/declarative/qmlbehaviors/data/binding.qml b/tests/auto/declarative/qmlbehaviors/data/binding.qml index e0c3321..201da37 100644 --- a/tests/auto/declarative/qmlbehaviors/data/binding.qml +++ b/tests/auto/declarative/qmlbehaviors/data/binding.qml @@ -9,9 +9,9 @@ Rectangle { objectName: "MyRect" width: 100; height: 100; color: "green" x: basex - x: Behavior { NumberAnimation { duration: 200; } } + x: Behavior { NumberAnimation { duration: 500; } } } - MouseRegion { + MouseArea { id: clicker anchors.fill: parent } diff --git a/tests/auto/declarative/qmlbehaviors/data/color.qml b/tests/auto/declarative/qmlbehaviors/data/color.qml index 6598703..91dbbd1 100644 --- a/tests/auto/declarative/qmlbehaviors/data/color.qml +++ b/tests/auto/declarative/qmlbehaviors/data/color.qml @@ -7,9 +7,9 @@ Rectangle { objectName: "MyRect" width: 100; height: 100; color: "green" - color: Behavior { ColorAnimation { duration: 200; } } + color: Behavior { ColorAnimation { duration: 500; } } } - MouseRegion { + MouseArea { id: clicker anchors.fill: parent } diff --git a/tests/auto/declarative/qmlbehaviors/data/cpptrigger.qml b/tests/auto/declarative/qmlbehaviors/data/cpptrigger.qml index ba507c4..8d032f0 100644 --- a/tests/auto/declarative/qmlbehaviors/data/cpptrigger.qml +++ b/tests/auto/declarative/qmlbehaviors/data/cpptrigger.qml @@ -6,6 +6,6 @@ Rectangle { id: rect objectName: "MyRect" width: 100; height: 100; color: "green" - x: Behavior { NumberAnimation { duration: 200; } } + x: Behavior { NumberAnimation { duration: 500; } } } } diff --git a/tests/auto/declarative/qmlbehaviors/data/disabled.qml b/tests/auto/declarative/qmlbehaviors/data/disabled.qml index e7b8d51..3c7078a 100644 --- a/tests/auto/declarative/qmlbehaviors/data/disabled.qml +++ b/tests/auto/declarative/qmlbehaviors/data/disabled.qml @@ -12,7 +12,7 @@ Rectangle { NumberAnimation { duration: 200; } } } - MouseRegion { + MouseArea { id: clicker anchors.fill: parent } diff --git a/tests/auto/declarative/qmlbehaviors/data/empty.qml b/tests/auto/declarative/qmlbehaviors/data/empty.qml index 412e26c..95d934a 100644 --- a/tests/auto/declarative/qmlbehaviors/data/empty.qml +++ b/tests/auto/declarative/qmlbehaviors/data/empty.qml @@ -8,7 +8,7 @@ Rectangle { width: 100; height: 100; color: "green" x: Behavior {} } - MouseRegion { + MouseArea { id: clicker anchors.fill: parent } diff --git a/tests/auto/declarative/qmlbehaviors/data/explicit.qml b/tests/auto/declarative/qmlbehaviors/data/explicit.qml index ba36d93..1b2025a 100644 --- a/tests/auto/declarative/qmlbehaviors/data/explicit.qml +++ b/tests/auto/declarative/qmlbehaviors/data/explicit.qml @@ -8,10 +8,10 @@ Rectangle { width: 100; height: 100; color: "green" x: Behavior { objectName: "MyBehavior"; - NumberAnimation { target: rect; property: "x"; duration: 200; } + NumberAnimation { target: rect; property: "x"; duration: 500; } } } - MouseRegion { + MouseArea { id: clicker anchors.fill: parent } diff --git a/tests/auto/declarative/qmlbehaviors/data/groupProperty.qml b/tests/auto/declarative/qmlbehaviors/data/groupProperty.qml index 4f127c1..14883d4 100644 --- a/tests/auto/declarative/qmlbehaviors/data/groupProperty.qml +++ b/tests/auto/declarative/qmlbehaviors/data/groupProperty.qml @@ -6,9 +6,9 @@ Rectangle { id: rect objectName: "MyRect" width: 100; height: 100; color: "green" - pos: Behavior { PropertyAnimation { duration: 200; } } + pos: Behavior { PropertyAnimation { duration: 500; } } } - MouseRegion { + MouseArea { id: clicker anchors.fill: parent } diff --git a/tests/auto/declarative/qmlbehaviors/data/groupProperty2.qml b/tests/auto/declarative/qmlbehaviors/data/groupProperty2.qml index 19d70b6..b43ddbc 100644 --- a/tests/auto/declarative/qmlbehaviors/data/groupProperty2.qml +++ b/tests/auto/declarative/qmlbehaviors/data/groupProperty2.qml @@ -6,9 +6,9 @@ Rectangle { id: rect objectName: "MyRect" width: 100; height: 100; color: "green" - pos.x: Behavior { NumberAnimation { duration: 200; } } + pos.x: Behavior { NumberAnimation { duration: 500; } } } - MouseRegion { + MouseArea { id: clicker anchors.fill: parent } diff --git a/tests/auto/declarative/qmlbehaviors/data/nonSelecting2.qml b/tests/auto/declarative/qmlbehaviors/data/nonSelecting2.qml index 59cbd1a..f267a05 100644 --- a/tests/auto/declarative/qmlbehaviors/data/nonSelecting2.qml +++ b/tests/auto/declarative/qmlbehaviors/data/nonSelecting2.qml @@ -11,7 +11,7 @@ Rectangle { NumberAnimation { targets: rect; properties: "y"; duration: 200; } } } - MouseRegion { + MouseArea { id: clicker anchors.fill: parent } diff --git a/tests/auto/declarative/qmlbehaviors/data/parent.qml b/tests/auto/declarative/qmlbehaviors/data/parent.qml index 4f4911b..7c7fdcb 100644 --- a/tests/auto/declarative/qmlbehaviors/data/parent.qml +++ b/tests/auto/declarative/qmlbehaviors/data/parent.qml @@ -8,7 +8,7 @@ Rectangle { width: 100; height: 100; color: "green" parent: Behavior { SequentialAnimation { - PauseAnimation { duration: 200 } + PauseAnimation { duration: 500 } PropertyAction {} } } diff --git a/tests/auto/declarative/qmlbehaviors/data/reassignedAnimation.qml b/tests/auto/declarative/qmlbehaviors/data/reassignedAnimation.qml index 693a595..ba744b1 100644 --- a/tests/auto/declarative/qmlbehaviors/data/reassignedAnimation.qml +++ b/tests/auto/declarative/qmlbehaviors/data/reassignedAnimation.qml @@ -12,7 +12,7 @@ Rectangle { NumberAnimation { duration: 1000 } } } - MouseRegion { + MouseArea { id: clicker anchors.fill: parent } diff --git a/tests/auto/declarative/qmlbehaviors/data/scripttrigger.qml b/tests/auto/declarative/qmlbehaviors/data/scripttrigger.qml index 4383a0b..a91ca88 100644 --- a/tests/auto/declarative/qmlbehaviors/data/scripttrigger.qml +++ b/tests/auto/declarative/qmlbehaviors/data/scripttrigger.qml @@ -11,6 +11,6 @@ Rectangle { id: rect objectName: "MyRect" width: 100; height: 100; color: "green" - x: Behavior { NumberAnimation { duration: 200; } } + x: Behavior { NumberAnimation { duration: 500; } } } } diff --git a/tests/auto/declarative/qmlbehaviors/data/simple.qml b/tests/auto/declarative/qmlbehaviors/data/simple.qml index 37c3915..ac98ed0 100644 --- a/tests/auto/declarative/qmlbehaviors/data/simple.qml +++ b/tests/auto/declarative/qmlbehaviors/data/simple.qml @@ -8,10 +8,10 @@ Rectangle { width: 100; height: 100; color: "green" x: Behavior { objectName: "MyBehavior"; - NumberAnimation { duration: 200; } + NumberAnimation { duration: 500; } } } - MouseRegion { + MouseArea { id: clicker anchors.fill: parent } diff --git a/tests/auto/declarative/qmlbehaviors/tst_qmlbehaviors.cpp b/tests/auto/declarative/qmlbehaviors/tst_qmlbehaviors.cpp index 99ec728..e31b600 100644 --- a/tests/auto/declarative/qmlbehaviors/tst_qmlbehaviors.cpp +++ b/tests/auto/declarative/qmlbehaviors/tst_qmlbehaviors.cpp @@ -79,7 +79,7 @@ void tst_qmlbehaviors::simpleBehavior() QVERIFY(qobject_cast<QmlBehavior*>(rect->findChild<QmlBehavior*>("MyBehavior"))->animation()); rect->setState("moved"); - QTest::qWait(100); + QTest::qWait(200); qreal x = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect"))->x(); QVERIFY(x > 0 && x < 200); //i.e. the behavior has been triggered } @@ -92,7 +92,7 @@ void tst_qmlbehaviors::scriptTriggered() QVERIFY(rect); rect->setColor(QColor("red")); - QTest::qWait(100); + QTest::qWait(200); qreal x = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect"))->x(); QVERIFY(x > 0 && x < 200); //i.e. the behavior has been triggered } @@ -108,7 +108,7 @@ void tst_qmlbehaviors::cppTriggered() QVERIFY(innerRect); innerRect->setProperty("x", 200); - QTest::qWait(100); + QTest::qWait(200); qreal x = innerRect->x(); QVERIFY(x > 0 && x < 200); //i.e. the behavior has been triggered } @@ -132,7 +132,7 @@ void tst_qmlbehaviors::colorBehavior() QVERIFY(rect); rect->setState("red"); - QTest::qWait(100); + QTest::qWait(200); QColor color = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect"))->color(); QVERIFY(color != QColor("red") && color != QColor("green")); //i.e. the behavior has been triggered } @@ -145,11 +145,11 @@ void tst_qmlbehaviors::parentBehavior() QVERIFY(rect); rect->setState("reparented"); - QTest::qWait(100); + QTest::qWait(200); QmlGraphicsItem *newParent = rect->findChild<QmlGraphicsItem*>("NewParent"); QmlGraphicsItem *parent = rect->findChild<QmlGraphicsRectangle*>("MyRect")->parentItem(); QVERIFY(parent != newParent); - QTest::qWait(300); + QTest::qWait(600); parent = rect->findChild<QmlGraphicsRectangle*>("MyRect")->parentItem(); QVERIFY(parent == newParent); } @@ -162,29 +162,29 @@ void tst_qmlbehaviors::replaceBinding() QVERIFY(rect); rect->setState("moved"); - QTest::qWait(100); + QTest::qWait(200); QmlGraphicsRectangle *innerRect = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect")); QVERIFY(innerRect); qreal x = innerRect->x(); QVERIFY(x > 0 && x < 200); //i.e. the behavior has been triggered - QTest::qWait(300); + QTest::qWait(600); QCOMPARE(innerRect->x(), (qreal)200); rect->setProperty("basex", 10); QCOMPARE(innerRect->x(), (qreal)200); rect->setProperty("movedx", 210); - QTest::qWait(300); + QTest::qWait(600); QCOMPARE(innerRect->x(), (qreal)210); rect->setState(""); - QTest::qWait(100); + QTest::qWait(200); x = innerRect->x(); QVERIFY(x > 10 && x < 210); //i.e. the behavior has been triggered - QTest::qWait(300); + QTest::qWait(600); QCOMPARE(innerRect->x(), (qreal)10); rect->setProperty("movedx", 200); QCOMPARE(innerRect->x(), (qreal)10); rect->setProperty("basex", 20); - QTest::qWait(300); + QTest::qWait(600); QCOMPARE(innerRect->x(), (qreal)20); } @@ -197,7 +197,7 @@ void tst_qmlbehaviors::group() QVERIFY(rect); rect->setState("moved"); - QTest::qWait(100); + QTest::qWait(200); qreal x = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect"))->x(); QVERIFY(x > 0 && x < 200); //i.e. the behavior has been triggered } @@ -209,7 +209,7 @@ void tst_qmlbehaviors::group() QVERIFY(rect); rect->setState("moved"); - QTest::qWait(100); + QTest::qWait(200); qreal x = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect"))->x(); QVERIFY(x > 0 && x < 200); //i.e. the behavior has been triggered } @@ -236,7 +236,7 @@ void tst_qmlbehaviors::explicitSelection() QVERIFY(rect); rect->setState("moved"); - QTest::qWait(100); + QTest::qWait(200); qreal x = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect"))->x(); QVERIFY(x > 0 && x < 200); //i.e. the behavior has been triggered } diff --git a/tests/auto/declarative/qmldebug/tst_qmldebug.cpp b/tests/auto/declarative/qmldebug/tst_qmldebug.cpp index 2e668ad..ba07331 100644 --- a/tests/auto/declarative/qmldebug/tst_qmldebug.cpp +++ b/tests/auto/declarative/qmldebug/tst_qmldebug.cpp @@ -825,7 +825,7 @@ int main(int argc, char *argv[]) "width: 10; height: 20; scale: blueRect.scale;" "Rectangle { id: blueRect; width: 500; height: 600; color: \"blue\"; }" "Text { color: blueRect.color; }" - "MouseRegion {" + "MouseArea {" "onEntered: { console.log('hello') }" "}" "}"; diff --git a/tests/auto/declarative/qmlecmascript/data/listProperties.qml b/tests/auto/declarative/qmlecmascript/data/listProperties.qml index cae1721..810f9b6 100644 --- a/tests/auto/declarative/qmlecmascript/data/listProperties.qml +++ b/tests/auto/declarative/qmlecmascript/data/listProperties.qml @@ -9,12 +9,6 @@ MyQmlObject { QtObject { property int a: 11 } ] - objectQmlListProperty: [ - QtObject { property int a: 10 }, - QtObject { property int a: 1 }, - QtObject { property int a: 39 } - ] - Script { function calcTest1() { var rv = 0; @@ -24,21 +18,10 @@ MyQmlObject { return rv; } - function calcTest2() { - var rv = 0; - for (var ii = 0; ii < root.objectQmlListProperty.length; ++ii) { - rv += root.objectQmlListProperty[ii].a; - } - return rv; - } } property int test1: calcTest1(); property int test2: root.objectListProperty.length - property int test3: calcTest2(); - property int test4: root.objectQmlListProperty.length - property bool test5: root.objectQmlListProperty[1] != undefined - property bool test6: root.objectQmlListProperty[100] == undefined - property bool test7: root.objectListProperty[1] != undefined - property bool test8: root.objectListProperty[100] == undefined + property bool test3: root.objectListProperty[1] != undefined + property bool test4: root.objectListProperty[100] == undefined } diff --git a/tests/auto/declarative/qmlecmascript/testtypes.h b/tests/auto/declarative/qmlecmascript/testtypes.h index 330664f..0af72cb 100644 --- a/tests/auto/declarative/qmlecmascript/testtypes.h +++ b/tests/auto/declarative/qmlecmascript/testtypes.h @@ -77,8 +77,7 @@ class MyQmlObject : public QObject Q_PROPERTY(int value READ value WRITE setValue) Q_PROPERTY(QString stringProperty READ stringProperty WRITE setStringProperty NOTIFY stringChanged) Q_PROPERTY(QObject *objectProperty READ objectProperty WRITE setObjectProperty NOTIFY objectChanged) - Q_PROPERTY(QmlList<QObject *> *objectQmlListProperty READ objectQmlListProperty CONSTANT) - Q_PROPERTY(QList<QObject *> *objectListProperty READ objectListProperty CONSTANT) + Q_PROPERTY(QmlListProperty<QObject> objectListProperty READ objectListProperty CONSTANT) Q_PROPERTY(int resettableProperty READ resettableProperty WRITE setResettableProperty RESET resetProperty) public: @@ -107,8 +106,7 @@ public: emit objectChanged(); } - QmlList<QObject *> *objectQmlListProperty() { return &m_objectQmlList; } - QList<QObject *> *objectListProperty() { return &m_objectQList; } + QmlListProperty<QObject> objectListProperty() { return QmlListProperty<QObject>(this, m_objectQList); } bool methodCalled() const { return m_methodCalled; } bool methodIntCalled() const { return m_methodIntCalled; } @@ -150,7 +148,6 @@ private: QObject *m_object; QString m_string; - QmlConcreteList<QObject *> m_objectQmlList; QList<QObject *> m_objectQList; int m_value; int m_resetProperty; @@ -162,11 +159,11 @@ QML_DECLARE_TYPE(MyQmlObject); class MyQmlContainer : public QObject { Q_OBJECT - Q_PROPERTY(QList<MyQmlObject*>* children READ children CONSTANT) + Q_PROPERTY(QmlListProperty<MyQmlObject> children READ children CONSTANT) public: MyQmlContainer() {} - QList<MyQmlObject*> *children() { return &m_children; } + QmlListProperty<MyQmlObject> children() { return QmlListProperty<MyQmlObject>(this, m_children); } private: QList<MyQmlObject*> m_children; diff --git a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp index 0ef836f..b30ad1c 100644 --- a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp +++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp @@ -365,7 +365,6 @@ void tst_qmlecmascript::basicExpressions() QCOMPARE(expr.value(), result); } -Q_DECLARE_METATYPE(QList<QObject *>); void tst_qmlecmascript::arrayExpressions() { QObject obj1; @@ -985,12 +984,8 @@ void tst_qmlecmascript::listProperties() QCOMPARE(object->property("test1").toInt(), 21); QCOMPARE(object->property("test2").toInt(), 2); - QCOMPARE(object->property("test3").toInt(), 50); - QCOMPARE(object->property("test4").toInt(), 3); - QCOMPARE(object->property("test5").toBool(), true); - QCOMPARE(object->property("test6").toBool(), true); - QCOMPARE(object->property("test7").toBool(), true); - QCOMPARE(object->property("test8").toBool(), true); + QCOMPARE(object->property("test3").toBool(), true); + QCOMPARE(object->property("test4").toBool(), true); } void tst_qmlecmascript::exceptionClearsOnReeval() @@ -1612,7 +1607,9 @@ void tst_qmlecmascript::listToVariant() QObject *object = component.create(&context); QVERIFY(object != 0); - QCOMPARE(object->property("test"), QVariant::fromValue(container.children())); + QVariant v = object->property("test"); + QCOMPARE(v.userType(), qMetaTypeId<QmlListReference>()); + QVERIFY(qvariant_cast<QmlListReference>(v).object() == &container); delete object; } diff --git a/tests/auto/declarative/qmlgraphicsgridview/tst_qmlgraphicsgridview.cpp b/tests/auto/declarative/qmlgraphicsgridview/tst_qmlgraphicsgridview.cpp index 00127e5..2520d4a 100644 --- a/tests/auto/declarative/qmlgraphicsgridview/tst_qmlgraphicsgridview.cpp +++ b/tests/auto/declarative/qmlgraphicsgridview/tst_qmlgraphicsgridview.cpp @@ -645,45 +645,29 @@ void tst_QmlGraphicsGridView::currentIndex() QCOMPARE(gridview->viewportY(), 0.0); // Test keys + qApp->setActiveWindow(canvas); canvas->show(); canvas->setFocus(); qApp->processEvents(); - QEvent wa(QEvent::WindowActivate); - QApplication::sendEvent(canvas, &wa); - QFocusEvent fe(QEvent::FocusIn); - QApplication::sendEvent(canvas, &fe); - - QKeyEvent key(QEvent::KeyPress, Qt::Key_Down, Qt::NoModifier, "", false, 1); - QApplication::sendEvent(canvas, &key); - QVERIFY(key.isAccepted()); + QTest::keyClick(canvas, Qt::Key_Down); QCOMPARE(gridview->currentIndex(), 3); - key = QKeyEvent(QEvent::KeyPress, Qt::Key_Up, Qt::NoModifier, "", false, 1); - QApplication::sendEvent(canvas, &key); - QVERIFY(key.isAccepted()); + QTest::keyClick(canvas, Qt::Key_Up); QCOMPARE(gridview->currentIndex(), 0); gridview->setFlow(QmlGraphicsGridView::TopToBottom); - key = QKeyEvent(QEvent::KeyPress, Qt::Key_Right, Qt::NoModifier, "", false, 1); - QApplication::sendEvent(canvas, &key); - QVERIFY(key.isAccepted()); + QTest::keyClick(canvas, Qt::Key_Right); QCOMPARE(gridview->currentIndex(), 5); - key = QKeyEvent(QEvent::KeyPress, Qt::Key_Left, Qt::NoModifier, "", false, 1); - QApplication::sendEvent(canvas, &key); - QVERIFY(key.isAccepted()); + QTest::keyClick(canvas, Qt::Key_Left); QCOMPARE(gridview->currentIndex(), 0); - key = QKeyEvent(QEvent::KeyPress, Qt::Key_Down, Qt::NoModifier, "", false, 1); - QApplication::sendEvent(canvas, &key); - QVERIFY(key.isAccepted()); + QTest::keyClick(canvas, Qt::Key_Down); QCOMPARE(gridview->currentIndex(), 1); - key = QKeyEvent(QEvent::KeyPress, Qt::Key_Up, Qt::NoModifier, "", false, 1); - QApplication::sendEvent(canvas, &key); - QVERIFY(key.isAccepted()); + QTest::keyClick(canvas, Qt::Key_Up); QCOMPARE(gridview->currentIndex(), 0); diff --git a/tests/auto/declarative/qmlgraphicsmouseregion/data/dragproperties.qml b/tests/auto/declarative/qmlgraphicsmousearea/data/dragproperties.qml index 5acb3e4..4cd78da 100644 --- a/tests/auto/declarative/qmlgraphicsmouseregion/data/dragproperties.qml +++ b/tests/auto/declarative/qmlgraphicsmousearea/data/dragproperties.qml @@ -14,7 +14,7 @@ Rectangle { height: 100 opacity: (whiteRect.width-blackRect.x+whiteRect.height-blackRect.y-199)/200 Text { text: blackRect.opacity} - MouseRegion { + MouseArea { objectName: "mouseregion" anchors.fill: parent drag.target: blackRect @@ -25,4 +25,4 @@ Rectangle { drag.maximumY: whiteRect.height-blackRect.height } } - }
\ No newline at end of file + } diff --git a/tests/auto/declarative/qmlgraphicsmouseregion/qmlgraphicsmouseregion.pro b/tests/auto/declarative/qmlgraphicsmousearea/qmlgraphicsmousearea.pro index 7a7c8bd..f85bf0f 100644 --- a/tests/auto/declarative/qmlgraphicsmouseregion/qmlgraphicsmouseregion.pro +++ b/tests/auto/declarative/qmlgraphicsmousearea/qmlgraphicsmousearea.pro @@ -3,7 +3,7 @@ contains(QT_CONFIG,declarative): QT += declarative gui network macx:CONFIG -= app_bundle HEADERS += ../shared/testhttpserver.h -SOURCES += tst_qmlgraphicsmouseregion.cpp ../shared/testhttpserver.cpp +SOURCES += tst_qmlgraphicsmousearea.cpp ../shared/testhttpserver.cpp # Define SRCDIR equal to test's source directory DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/qmlgraphicsmouseregion/tst_qmlgraphicsmouseregion.cpp b/tests/auto/declarative/qmlgraphicsmousearea/tst_qmlgraphicsmousearea.cpp index 82da9c8..869a7bd 100644 --- a/tests/auto/declarative/qmlgraphicsmouseregion/tst_qmlgraphicsmouseregion.cpp +++ b/tests/auto/declarative/qmlgraphicsmousearea/tst_qmlgraphicsmousearea.cpp @@ -41,10 +41,10 @@ #include <QtTest/QtTest> #include <QtTest/QSignalSpy> -#include <private/qmlgraphicsmouseregion_p.h> +#include <private/qmlgraphicsmousearea_p.h> #include <QtDeclarative/qmlview.h> -class tst_QmlGraphicsMouseRegion: public QObject +class tst_QmlGraphicsMouseArea: public QObject { Q_OBJECT private slots: @@ -53,7 +53,7 @@ private: QmlView *createView(const QString &filename); }; -void tst_QmlGraphicsMouseRegion::dragProperties() +void tst_QmlGraphicsMouseArea::dragProperties() { QmlView *canvas = createView(SRCDIR "/data/dragproperties.qml"); canvas->execute(); @@ -61,7 +61,7 @@ void tst_QmlGraphicsMouseRegion::dragProperties() canvas->setFocus(); QVERIFY(canvas->rootObject() != 0); - QmlGraphicsMouseRegion *mouseRegion = canvas->rootObject()->findChild<QmlGraphicsMouseRegion*>("mouseregion"); + QmlGraphicsMouseArea *mouseRegion = canvas->rootObject()->findChild<QmlGraphicsMouseArea*>("mouseregion"); QmlGraphicsDrag *drag = mouseRegion->drag(); QVERIFY(mouseRegion != 0); QVERIFY(drag != 0); @@ -124,7 +124,7 @@ void tst_QmlGraphicsMouseRegion::dragProperties() QCOMPARE(ymaxSpy.count(),1); } -QmlView *tst_QmlGraphicsMouseRegion::createView(const QString &filename) +QmlView *tst_QmlGraphicsMouseArea::createView(const QString &filename) { QmlView *canvas = new QmlView(0); canvas->setFixedSize(240,320); @@ -134,6 +134,6 @@ QmlView *tst_QmlGraphicsMouseRegion::createView(const QString &filename) return canvas; } -QTEST_MAIN(tst_QmlGraphicsMouseRegion) +QTEST_MAIN(tst_QmlGraphicsMouseArea) -#include "tst_qmlgraphicsmouseregion.moc" +#include "tst_qmlgraphicsmousearea.moc" diff --git a/tests/auto/declarative/qmlgraphicspathview/tst_qmlgraphicspathview.cpp b/tests/auto/declarative/qmlgraphicspathview/tst_qmlgraphicspathview.cpp index 072f740..b986a64 100644 --- a/tests/auto/declarative/qmlgraphicspathview/tst_qmlgraphicspathview.cpp +++ b/tests/auto/declarative/qmlgraphicspathview/tst_qmlgraphicspathview.cpp @@ -268,31 +268,31 @@ void tst_QmlGraphicsPathView::path() QCOMPARE(obj->startY(), 100.); QVERIFY(obj->path() != QPainterPath()); - QList<QmlGraphicsPathElement*> *list = obj->pathElements(); - QCOMPARE(list->count(), 5); + QmlListReference list(obj, "pathElements"); + QCOMPARE(list.count(), 5); - QmlGraphicsPathAttribute* attr = qobject_cast<QmlGraphicsPathAttribute*>(list->at(0)); + QmlGraphicsPathAttribute* attr = qobject_cast<QmlGraphicsPathAttribute*>(list.at(0)); QVERIFY(attr != 0); QCOMPARE(attr->name(), QString("scale")); QCOMPARE(attr->value(), 1.0); - QmlGraphicsPathQuad* quad = qobject_cast<QmlGraphicsPathQuad*>(list->at(1)); + QmlGraphicsPathQuad* quad = qobject_cast<QmlGraphicsPathQuad*>(list.at(1)); QVERIFY(quad != 0); QCOMPARE(quad->x(), 120.); QCOMPARE(quad->y(), 25.); QCOMPARE(quad->controlX(), 260.); QCOMPARE(quad->controlY(), 75.); - QmlGraphicsPathPercent* perc = qobject_cast<QmlGraphicsPathPercent*>(list->at(2)); + QmlGraphicsPathPercent* perc = qobject_cast<QmlGraphicsPathPercent*>(list.at(2)); QVERIFY(perc != 0); QCOMPARE(perc->value(), 0.3); - QmlGraphicsPathLine* line = qobject_cast<QmlGraphicsPathLine*>(list->at(3)); + QmlGraphicsPathLine* line = qobject_cast<QmlGraphicsPathLine*>(list.at(3)); QVERIFY(line != 0); QCOMPARE(line->x(), 120.); QCOMPARE(line->y(), 100.); - QmlGraphicsPathCubic* cubic = qobject_cast<QmlGraphicsPathCubic*>(list->at(4)); + QmlGraphicsPathCubic* cubic = qobject_cast<QmlGraphicsPathCubic*>(list.at(4)); QVERIFY(cubic != 0); QCOMPARE(cubic->x(), 180.); QCOMPARE(cubic->y(), 0.); diff --git a/tests/auto/declarative/qmlgraphicsrepeater/tst_qmlgraphicsrepeater.cpp b/tests/auto/declarative/qmlgraphicsrepeater/tst_qmlgraphicsrepeater.cpp index 9e3a028..c971840 100644 --- a/tests/auto/declarative/qmlgraphicsrepeater/tst_qmlgraphicsrepeater.cpp +++ b/tests/auto/declarative/qmlgraphicsrepeater/tst_qmlgraphicsrepeater.cpp @@ -188,14 +188,14 @@ void tst_QmlGraphicsRepeater::objectList() { QmlView *canvas = createView(SRCDIR "/data/objlist.qml"); - QObjectList* data = new QObjectList; + QObjectList data; for(int i=0; i<100; i++){ - *data << new QObject(); - data->back()->setProperty("idx", i); + data << new QObject(); + data.back()->setProperty("idx", i); } QmlContext *ctxt = canvas->rootContext(); - ctxt->setContextProperty("testData", QVariant::fromValue<QObjectList*>(data)); + ctxt->setContextProperty("testData", QVariant::fromValue(data)); canvas->execute(); qApp->processEvents(); diff --git a/tests/auto/declarative/qmlinstruction/tst_qmlinstruction.cpp b/tests/auto/declarative/qmlinstruction/tst_qmlinstruction.cpp index 9c753ce..38d024a 100644 --- a/tests/auto/declarative/qmlinstruction/tst_qmlinstruction.cpp +++ b/tests/auto/declarative/qmlinstruction/tst_qmlinstruction.cpp @@ -421,13 +421,6 @@ void tst_qmlinstruction::dump() { QmlInstruction i; - i.line = 37; - i.type = QmlInstruction::StoreObjectQmlList; - data->bytecode << i; - } - - { - QmlInstruction i; i.line = 38; i.type = QmlInstruction::StoreObjectQList; data->bytecode << i; @@ -450,15 +443,6 @@ void tst_qmlinstruction::dump() { QmlInstruction i; - i.line = 41; - i.type = QmlInstruction::FetchQmlList; - i.fetchQmlList.property = 31; - i.fetchQmlList.type = 3; - data->bytecode << i; - } - - { - QmlInstruction i; i.line = 42; i.type = QmlInstruction::FetchQList; i.fetch.property = 32; @@ -569,20 +553,18 @@ void tst_qmlinstruction::dump() << "34\t\t34\tSTORE_VALUE_SOURCE\t29\t4" << "35\t\t35\tSTORE_VALUE_INTERCEPTOR\t30\t-4" << "36\t\t36\tBEGIN\t\t\t4" - << "37\t\t37\tSTORE_OBJECT_QMLLIST" - << "38\t\t38\tSTORE_OBJECT_QLIST" - << "39\t\t39\tASSIGN_OBJECT_LIST" - << "40\t\t40\tFETCH_ATTACHED\t\t23" - << "41\t\t41\tFETCH_QMLLIST\t\t31\t3" - << "42\t\t42\tFETCH_QLIST\t\t32" - << "43\t\t43\tFETCH\t\t\t33" - << "44\t\t44\tFETCH_VALUE\t\t34\t6" - << "45\t\t45\tPOP" - << "46\t\t46\tPOP_QLIST" - << "47\t\t47\tPOP_VALUE\t\t35\t8" - << "48\t\t48\tDEFER\t\t\t7" - << "49\t\tNA\tDEFER\t\t\t7" - << "50\t\t50\tXXX UNKOWN INSTRUCTION\t49" + << "37\t\t38\tSTORE_OBJECT_QLIST" + << "38\t\t39\tASSIGN_OBJECT_LIST" + << "39\t\t40\tFETCH_ATTACHED\t\t23" + << "40\t\t42\tFETCH_QLIST\t\t32" + << "41\t\t43\tFETCH\t\t\t33" + << "42\t\t44\tFETCH_VALUE\t\t34\t6" + << "43\t\t45\tPOP" + << "44\t\t46\tPOP_QLIST" + << "45\t\t47\tPOP_VALUE\t\t35\t8" + << "46\t\t48\tDEFER\t\t\t7" + << "47\t\tNA\tDEFER\t\t\t7" + << "48\t\t50\tXXX UNKOWN INSTRUCTION\t47" << "-------------------------------------------------------------------------------"; messages = QStringList(); diff --git a/tests/auto/declarative/qmllanguage/data/interfaceQmlList.qml b/tests/auto/declarative/qmllanguage/data/interfaceQmlList.qml deleted file mode 100644 index 8392bea..0000000 --- a/tests/auto/declarative/qmllanguage/data/interfaceQmlList.qml +++ /dev/null @@ -1,7 +0,0 @@ -import Test 1.0 -MyContainer { - qmllistInterfaces: [ - MyQmlObject {}, - MyQmlObject {} - ] -} diff --git a/tests/auto/declarative/qmllanguage/data/listAssignment.1.errors.txt b/tests/auto/declarative/qmllanguage/data/listAssignment.1.errors.txt deleted file mode 100644 index d68d487..0000000 --- a/tests/auto/declarative/qmllanguage/data/listAssignment.1.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:24:Cannot assign primitives to lists diff --git a/tests/auto/declarative/qmllanguage/data/listAssignment.1.qml b/tests/auto/declarative/qmllanguage/data/listAssignment.1.qml deleted file mode 100644 index 4240425..0000000 --- a/tests/auto/declarative/qmllanguage/data/listAssignment.1.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyContainer { - qmllistInterfaces: 1 -} diff --git a/tests/auto/declarative/qmllanguage/data/listItemDeleteSelf.qml b/tests/auto/declarative/qmllanguage/data/listItemDeleteSelf.qml index 779c6d4..32b5b6c 100644 --- a/tests/auto/declarative/qmllanguage/data/listItemDeleteSelf.qml +++ b/tests/auto/declarative/qmllanguage/data/listItemDeleteSelf.qml @@ -23,7 +23,7 @@ Item { width: 200; height: 50 Text { text: name } Text { text: '$'+cost; anchors.right: parent.right } - MouseRegion { + MouseArea { anchors.fill: parent onClicked: fruitModel.remove(index) } diff --git a/tests/auto/declarative/qmllanguage/testtypes.h b/tests/auto/declarative/qmllanguage/testtypes.h index 0dc957f..27b45e4 100644 --- a/tests/auto/declarative/qmllanguage/testtypes.h +++ b/tests/auto/declarative/qmllanguage/testtypes.h @@ -447,22 +447,19 @@ QML_DECLARE_TYPE(MyTypeObject); class MyContainer : public QObject { Q_OBJECT - Q_PROPERTY(QList<QObject*>* children READ children) - Q_PROPERTY(QList<MyInterface*>* qlistInterfaces READ qlistInterfaces) - Q_PROPERTY(QmlList<MyInterface*>* qmllistInterfaces READ qmllistInterfaces) + Q_PROPERTY(QmlListProperty<QObject> children READ children) + Q_PROPERTY(QmlListProperty<MyInterface> qlistInterfaces READ qlistInterfaces) Q_CLASSINFO("DefaultProperty", "children"); public: MyContainer() {} - QList<QObject*> *children() { return &m_children; } - QList<MyInterface *> *qlistInterfaces() { return &m_interfaces; } - QmlList<MyInterface *> *qmllistInterfaces() { return &m_qmlinterfaces; } - const QmlConcreteList<MyInterface *> &qmllistAccessor() const { return m_qmlinterfaces; } + QmlListProperty<QObject> children() { return QmlListProperty<QObject>(this, m_children); } + QList<QObject *> *getChildren() { return &m_children; } + QmlListProperty<MyInterface> qlistInterfaces() { return QmlListProperty<MyInterface>(this, m_interfaces); } + QList<MyInterface *> *getQListInterfaces() { return &m_interfaces; } -private: QList<QObject*> m_children; QList<MyInterface *> m_interfaces; - QmlConcreteList<MyInterface *> m_qmlinterfaces; }; QML_DECLARE_TYPE(MyContainer); @@ -534,12 +531,12 @@ namespace MyNamespace { class MySecondNamespacedType : public QObject { Q_OBJECT - Q_PROPERTY(QmlList<MyNamespace::MyNamespacedType *> *list READ list); + Q_PROPERTY(QmlListProperty<MyNamespace::MyNamespacedType> list READ list); public: - QmlList<MyNamespacedType *> *list() { return &m_list; } + QmlListProperty<MyNamespacedType> list() { return QmlListProperty<MyNamespacedType>(this, m_list); } private: - QmlConcreteList<MyNamespacedType *> m_list; + QList<MyNamespacedType *> m_list; }; } QML_DECLARE_TYPE(MyNamespace::MyNamespacedType); diff --git a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp index c4636f3..4090e1d 100644 --- a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp +++ b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp @@ -76,7 +76,6 @@ private slots: void simpleObject(); void simpleContainer(); void interfaceProperty(); - void interfaceQmlList(); void interfaceQList(); void assignObjectToSignal(); void assignObjectToVariant(); @@ -233,7 +232,6 @@ void tst_qmllanguage::errors_data() QTest::newRow("readOnly.2") << "readOnly.2.qml" << "readOnly.2.errors.txt" << false; QTest::newRow("readOnly.3") << "readOnly.3.qml" << "readOnly.3.errors.txt" << false; - QTest::newRow("listAssignment.1") << "listAssignment.1.qml" << "listAssignment.1.errors.txt" << false; QTest::newRow("listAssignment.2") << "listAssignment.2.qml" << "listAssignment.2.errors.txt" << false; QTest::newRow("listAssignment.3") << "listAssignment.3.qml" << "listAssignment.3.errors.txt" << false; @@ -354,7 +352,7 @@ void tst_qmllanguage::simpleContainer() VERIFY_ERRORS(0); MyContainer *container= qobject_cast<MyContainer*>(component.create()); QVERIFY(container != 0); - QCOMPARE(container->children()->count(),2); + QCOMPARE(container->getChildren()->count(),2); } void tst_qmllanguage::interfaceProperty() @@ -367,26 +365,15 @@ void tst_qmllanguage::interfaceProperty() QVERIFY(object->interface()->id == 913); } -void tst_qmllanguage::interfaceQmlList() -{ - QmlComponent component(&engine, TEST_FILE("interfaceQmlList.qml")); - VERIFY_ERRORS(0); - MyContainer *container= qobject_cast<MyContainer*>(component.create()); - QVERIFY(container != 0); - QVERIFY(container->qmllistAccessor().count() == 2); - for(int ii = 0; ii < 2; ++ii) - QVERIFY(container->qmllistAccessor().at(ii)->id == 913); -} - void tst_qmllanguage::interfaceQList() { QmlComponent component(&engine, TEST_FILE("interfaceQList.qml")); VERIFY_ERRORS(0); MyContainer *container= qobject_cast<MyContainer*>(component.create()); QVERIFY(container != 0); - QVERIFY(container->qlistInterfaces()->count() == 2); + QVERIFY(container->getQListInterfaces()->count() == 2); for(int ii = 0; ii < 2; ++ii) - QVERIFY(container->qlistInterfaces()->at(ii)->id == 913); + QVERIFY(container->getQListInterfaces()->at(ii)->id == 913); } void tst_qmllanguage::assignObjectToSignal() @@ -425,8 +412,8 @@ void tst_qmllanguage::assignQmlComponent() VERIFY_ERRORS(0); MyContainer *object = qobject_cast<MyContainer *>(component.create()); QVERIFY(object != 0); - QVERIFY(object->children()->count() == 1); - QObject *child = object->children()->at(0); + QVERIFY(object->getChildren()->count() == 1); + QObject *child = object->getChildren()->at(0); QCOMPARE(child->property("x"), QVariant(10)); QCOMPARE(child->property("y"), QVariant(11)); } @@ -504,7 +491,7 @@ void tst_qmllanguage::rootAsQmlComponent() MyContainer *object = qobject_cast<MyContainer *>(component.create()); QVERIFY(object != 0); QCOMPARE(object->property("x"), QVariant(11)); - QCOMPARE(object->children()->count(), 2); + QCOMPARE(object->getChildren()->count(), 2); } // Tests that components can be specified inline @@ -514,8 +501,8 @@ void tst_qmllanguage::inlineQmlComponents() VERIFY_ERRORS(0); MyContainer *object = qobject_cast<MyContainer *>(component.create()); QVERIFY(object != 0); - QCOMPARE(object->children()->count(), 1); - QmlComponent *comp = qobject_cast<QmlComponent *>(object->children()->at(0)); + QCOMPARE(object->getChildren()->count(), 1); + QmlComponent *comp = qobject_cast<QmlComponent *>(object->getChildren()->at(0)); QVERIFY(comp != 0); MyQmlObject *compObject = qobject_cast<MyQmlObject *>(comp->create()); QVERIFY(compObject != 0); @@ -529,9 +516,9 @@ void tst_qmllanguage::idProperty() VERIFY_ERRORS(0); MyContainer *object = qobject_cast<MyContainer *>(component.create()); QVERIFY(object != 0); - QCOMPARE(object->children()->count(), 1); + QCOMPARE(object->getChildren()->count(), 1); MyTypeObject *child = - qobject_cast<MyTypeObject *>(object->children()->at(0)); + qobject_cast<MyTypeObject *>(object->getChildren()->at(0)); QVERIFY(child != 0); QCOMPARE(child->id(), QString("myObjectId")); QCOMPARE(object->property("object"), QVariant::fromValue((QObject *)child)); @@ -1034,13 +1021,13 @@ void tst_qmllanguage::defaultPropertyListOrder() MyContainer *container = qobject_cast<MyContainer *>(component.create()); QVERIFY(container != 0); - QCOMPARE(container->children()->count(), 6); - QCOMPARE(container->children()->at(0)->property("index"), QVariant(0)); - QCOMPARE(container->children()->at(1)->property("index"), QVariant(1)); - QCOMPARE(container->children()->at(2)->property("index"), QVariant(2)); - QCOMPARE(container->children()->at(3)->property("index"), QVariant(3)); - QCOMPARE(container->children()->at(4)->property("index"), QVariant(4)); - QCOMPARE(container->children()->at(5)->property("index"), QVariant(5)); + QCOMPARE(container->getChildren()->count(), 6); + QCOMPARE(container->getChildren()->at(0)->property("index"), QVariant(0)); + QCOMPARE(container->getChildren()->at(1)->property("index"), QVariant(1)); + QCOMPARE(container->getChildren()->at(2)->property("index"), QVariant(2)); + QCOMPARE(container->getChildren()->at(3)->property("index"), QVariant(3)); + QCOMPARE(container->getChildren()->at(4)->property("index"), QVariant(4)); + QCOMPARE(container->getChildren()->at(5)->property("index"), QVariant(5)); } void tst_qmllanguage::declaredPropertyValues() diff --git a/tests/auto/declarative/qmllist/data/MyType.qml b/tests/auto/declarative/qmllist/data/MyType.qml new file mode 100644 index 0000000..d08f35b --- /dev/null +++ b/tests/auto/declarative/qmllist/data/MyType.qml @@ -0,0 +1,5 @@ +import Qt 4.6 + +QtObject { + property int a +} diff --git a/tests/auto/declarative/qmllist/data/engineTypes.qml b/tests/auto/declarative/qmllist/data/engineTypes.qml new file mode 100644 index 0000000..670aee4 --- /dev/null +++ b/tests/auto/declarative/qmllist/data/engineTypes.qml @@ -0,0 +1,9 @@ +import Qt 4.6 + +QtObject { + property list<MyType> myList + + myList: [ MyType { a: 1 }, + MyType { a: 9 } ] + +} diff --git a/tests/auto/declarative/qmllist/data/variantToList.qml b/tests/auto/declarative/qmllist/data/variantToList.qml new file mode 100644 index 0000000..0c2d0aa --- /dev/null +++ b/tests/auto/declarative/qmllist/data/variantToList.qml @@ -0,0 +1,10 @@ +import Qt 4.6 + +QtObject { + property list<QtObject> myList; + myList: QtObject {} + + property var value: myList + property int test: value.length +} + diff --git a/tests/auto/declarative/qmllist/tst_qmllist.cpp b/tests/auto/declarative/qmllist/tst_qmllist.cpp index 4ffbbb8..76def1c 100644 --- a/tests/auto/declarative/qmllist/tst_qmllist.cpp +++ b/tests/auto/declarative/qmllist/tst_qmllist.cpp @@ -38,9 +38,27 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ + #include <qtest.h> +#include <QUrl> +#include <QFileInfo> +#include <QDir> +#include <QmlEngine> +#include <QmlComponent> #include <QtDeclarative/qml.h> #include <QtDeclarative/qmlprivate.h> +#include <QDebug> + +inline QUrl TEST_FILE(const QString &filename) +{ + QFileInfo fileInfo(__FILE__); + return QUrl::fromLocalFile(fileInfo.absoluteDir().filePath("data/" + filename)); +} + +inline QUrl TEST_FILE(const char *filename) +{ + return TEST_FILE(QLatin1String(filename)); +} class tst_QmlList : public QObject { @@ -49,28 +67,506 @@ public: tst_QmlList() {} private slots: - void interface(); + void qmllistreference(); + void qmllistreference_invalid(); + void isValid(); + void object(); + void listElementType(); + void canAppend(); + void canAt(); + void canClear(); + void canCount(); + void append(); + void at(); + void clear(); + void count(); + void copy(); + void qmlmetaproperty(); + void engineTypes(); + void variantToList(); }; -void tst_QmlList::interface() +class TestType : public QObject +{ + Q_OBJECT + Q_PROPERTY(QmlListProperty<TestType> data READ dataProperty); + Q_PROPERTY(int intProperty READ intProperty); + +public: + TestType() : property(this, data) {} + QmlListProperty<TestType> dataProperty() { return property; } + int intProperty() const { return 10; } + + QList<TestType *> data; + QmlListProperty<TestType> property; +}; +QML_DECLARE_TYPE(TestType); +QML_DEFINE_NOCREATE_TYPE(TestType); + +void tst_QmlList::qmllistreference() +{ + TestType tt; + + QmlListReference r(&tt, "data"); + QVERIFY(r.isValid() == true); + QCOMPARE(r.count(), 0); + + tt.data.append(&tt); + QCOMPARE(r.count(), 1); +} + +void tst_QmlList::qmllistreference_invalid() +{ + TestType tt; + + // Invalid + { + QmlListReference r; + QVERIFY(r.isValid() == false); + QVERIFY(r.object() == 0); + QVERIFY(r.listElementType() == 0); + QVERIFY(r.canAt() == false); + QVERIFY(r.canClear() == false); + QVERIFY(r.canCount() == false); + QVERIFY(r.append(0) == false); + QVERIFY(r.at(10) == 0); + QVERIFY(r.clear() == false); + QVERIFY(r.count() == 0); + } + + // Non-property + { + QmlListReference r(&tt, "blah"); + QVERIFY(r.isValid() == false); + QVERIFY(r.object() == 0); + QVERIFY(r.listElementType() == 0); + QVERIFY(r.canAt() == false); + QVERIFY(r.canClear() == false); + QVERIFY(r.canCount() == false); + QVERIFY(r.append(0) == false); + QVERIFY(r.at(10) == 0); + QVERIFY(r.clear() == false); + QVERIFY(r.count() == 0); + } + + // Non-list property + { + QmlListReference r(&tt, "intProperty"); + QVERIFY(r.isValid() == false); + QVERIFY(r.object() == 0); + QVERIFY(r.listElementType() == 0); + QVERIFY(r.canAt() == false); + QVERIFY(r.canClear() == false); + QVERIFY(r.canCount() == false); + QVERIFY(r.append(0) == false); + QVERIFY(r.at(10) == 0); + QVERIFY(r.clear() == false); + QVERIFY(r.count() == 0); + } +} + +void tst_QmlList::isValid() +{ + TestType *tt = new TestType; + + { + QmlListReference ref; + QVERIFY(ref.isValid() == false); + } + + { + QmlListReference ref(tt, "blah"); + QVERIFY(ref.isValid() == false); + } + + { + QmlListReference ref(tt, "data"); + QVERIFY(ref.isValid() == true); + delete tt; + QVERIFY(ref.isValid() == false); + } +} + +void tst_QmlList::object() +{ + TestType *tt = new TestType; + + { + QmlListReference ref; + QVERIFY(ref.object() == 0); + } + + { + QmlListReference ref(tt, "blah"); + QVERIFY(ref.object() == 0); + } + + { + QmlListReference ref(tt, "data"); + QVERIFY(ref.object() == tt); + delete tt; + QVERIFY(ref.object() == 0); + } +} + +void tst_QmlList::listElementType() +{ + TestType *tt = new TestType; + + { + QmlListReference ref; + QVERIFY(ref.listElementType() == 0); + } + + { + QmlListReference ref(tt, "blah"); + QVERIFY(ref.listElementType() == 0); + } + + { + QmlListReference ref(tt, "data"); + QVERIFY(ref.listElementType() == &TestType::staticMetaObject); + delete tt; + QVERIFY(ref.listElementType() == 0); + } +} + +void tst_QmlList::canAppend() +{ + TestType *tt = new TestType; + + { + QmlListReference ref; + QVERIFY(ref.canAppend() == false); + } + + { + QmlListReference ref(tt, "blah"); + QVERIFY(ref.canAppend() == false); + } + + { + QmlListReference ref(tt, "data"); + QVERIFY(ref.canAppend() == true); + delete tt; + QVERIFY(ref.canAppend() == false); + } + + { + TestType tt; + tt.property.append = 0; + QmlListReference ref(&tt, "data"); + QVERIFY(ref.canAppend() == false); + } +} + +void tst_QmlList::canAt() +{ + TestType *tt = new TestType; + + { + QmlListReference ref; + QVERIFY(ref.canAt() == false); + } + + { + QmlListReference ref(tt, "blah"); + QVERIFY(ref.canAt() == false); + } + + { + QmlListReference ref(tt, "data"); + QVERIFY(ref.canAt() == true); + delete tt; + QVERIFY(ref.canAt() == false); + } + + { + TestType tt; + tt.property.at = 0; + QmlListReference ref(&tt, "data"); + QVERIFY(ref.canAt() == false); + } +} + +void tst_QmlList::canClear() +{ + TestType *tt = new TestType; + + { + QmlListReference ref; + QVERIFY(ref.canClear() == false); + } + + { + QmlListReference ref(tt, "blah"); + QVERIFY(ref.canClear() == false); + } + + { + QmlListReference ref(tt, "data"); + QVERIFY(ref.canClear() == true); + delete tt; + QVERIFY(ref.canClear() == false); + } + + { + TestType tt; + tt.property.clear = 0; + QmlListReference ref(&tt, "data"); + QVERIFY(ref.canClear() == false); + } +} + +void tst_QmlList::canCount() +{ + TestType *tt = new TestType; + + { + QmlListReference ref; + QVERIFY(ref.canCount() == false); + } + + { + QmlListReference ref(tt, "blah"); + QVERIFY(ref.canCount() == false); + } + + { + QmlListReference ref(tt, "data"); + QVERIFY(ref.canCount() == true); + delete tt; + QVERIFY(ref.canCount() == false); + } + + { + TestType tt; + tt.property.count = 0; + QmlListReference ref(&tt, "data"); + QVERIFY(ref.canCount() == false); + } +} + +void tst_QmlList::append() +{ + TestType *tt = new TestType; + QObject object; + + { + QmlListReference ref; + QVERIFY(ref.append(tt) == false); + } + + { + QmlListReference ref(tt, "blah"); + QVERIFY(ref.append(tt) == false); + } + + { + QmlListReference ref(tt, "data"); + QVERIFY(ref.append(tt) == true); + QVERIFY(tt->data.count() == 1); + QVERIFY(tt->data.at(0) == tt); + QVERIFY(ref.append(&object) == false); + QVERIFY(tt->data.count() == 1); + QVERIFY(tt->data.at(0) == tt); + QVERIFY(ref.append(0) == true); + QVERIFY(tt->data.count() == 2); + QVERIFY(tt->data.at(0) == tt); + QVERIFY(tt->data.at(1) == 0); + delete tt; + QVERIFY(ref.append(0) == false); + } + + { + TestType tt; + tt.property.append = 0; + QmlListReference ref(&tt, "data"); + QVERIFY(ref.append(&tt) == false); + } +} + +void tst_QmlList::at() +{ + TestType *tt = new TestType; + tt->data.append(tt); + tt->data.append(0); + tt->data.append(tt); + + { + QmlListReference ref; + QVERIFY(ref.at(0) == 0); + } + + { + QmlListReference ref(tt, "blah"); + QVERIFY(ref.at(0) == 0); + } + + { + QmlListReference ref(tt, "data"); + QVERIFY(ref.at(0) == tt); + QVERIFY(ref.at(1) == 0); + QVERIFY(ref.at(2) == tt); + delete tt; + QVERIFY(ref.at(0) == 0); + } + + { + TestType tt; + tt.data.append(&tt); + tt.property.at = 0; + QmlListReference ref(&tt, "data"); + QVERIFY(ref.at(0) == 0); + } +} + +void tst_QmlList::clear() +{ + TestType *tt = new TestType; + tt->data.append(tt); + tt->data.append(0); + tt->data.append(tt); + + { + QmlListReference ref; + QVERIFY(ref.clear() == false); + } + + { + QmlListReference ref(tt, "blah"); + QVERIFY(ref.clear() == false); + } + + { + QmlListReference ref(tt, "data"); + QVERIFY(ref.clear() == true); + QVERIFY(tt->data.count() == 0); + delete tt; + QVERIFY(ref.clear() == false); + } + + { + TestType tt; + tt.property.clear = 0; + QmlListReference ref(&tt, "data"); + QVERIFY(ref.clear() == false); + } +} + +void tst_QmlList::count() +{ + TestType *tt = new TestType; + tt->data.append(tt); + tt->data.append(0); + tt->data.append(tt); + + { + QmlListReference ref; + QVERIFY(ref.count() == 0); + } + + { + QmlListReference ref(tt, "blah"); + QVERIFY(ref.count() == 0); + } + + { + QmlListReference ref(tt, "data"); + QVERIFY(ref.count() == 3); + tt->data.removeAt(1); + QVERIFY(ref.count() == 2); + delete tt; + QVERIFY(ref.count() == 0); + } + + { + TestType tt; + tt.data.append(&tt); + tt.property.count = 0; + QmlListReference ref(&tt, "data"); + QVERIFY(ref.count() == 0); + } +} + +void tst_QmlList::copy() +{ + TestType tt; + tt.data.append(&tt); + tt.data.append(0); + tt.data.append(&tt); + + QmlListReference *r1 = new QmlListReference(&tt, "data"); + QVERIFY(r1->count() == 3); + + QmlListReference r2(*r1); + QmlListReference r3; + r3 = *r1; + + QVERIFY(r2.count() == 3); + QVERIFY(r3.count() == 3); + + delete r1; + + QVERIFY(r2.count() == 3); + QVERIFY(r3.count() == 3); + + tt.data.removeAt(2); + + QVERIFY(r2.count() == 2); + QVERIFY(r3.count() == 2); +} + +void tst_QmlList::qmlmetaproperty() +{ + TestType tt; + tt.data.append(&tt); + tt.data.append(0); + tt.data.append(&tt); + + QmlMetaProperty prop(&tt, QLatin1String("data")); + QVariant v = prop.read(); + QVERIFY(v.userType() == qMetaTypeId<QmlListReference>()); + QmlListReference ref = qvariant_cast<QmlListReference>(v); + QVERIFY(ref.count() == 3); + QVERIFY(ref.listElementType() == &TestType::staticMetaObject); +} + +void tst_QmlList::engineTypes() +{ + QmlEngine engine; + QmlComponent component(&engine, TEST_FILE("engineTypes.qml")); + + QObject *o = component.create(); + QVERIFY(o); + + QmlMetaProperty p1(o, QLatin1String("myList")); + QVERIFY(p1.propertyCategory() == QmlMetaProperty::Normal); + + QmlMetaProperty p2(o, QLatin1String("myList"), engine.rootContext()); + QVERIFY(p2.propertyCategory() == QmlMetaProperty::List); + QVariant v = p2.read(); + QVERIFY(v.userType() == qMetaTypeId<QmlListReference>()); + QmlListReference ref = qvariant_cast<QmlListReference>(v); + QVERIFY(ref.count() == 2); + QVERIFY(ref.listElementType()); + QVERIFY(ref.listElementType() != &QObject::staticMetaObject); + + delete o; +} + +void tst_QmlList::variantToList() { - QmlConcreteList<QObject*> list; - QObject *obj = new QObject; - obj->setObjectName("foo"); - list.append(obj); - QVERIFY(list.count() == 1); - QCOMPARE(list.at(0), obj); + QmlEngine engine; + QmlComponent component(&engine, TEST_FILE("variantToList.qml")); - QmlPrivate::ListInterface *li = (QmlPrivate::ListInterface*)&list; + QObject *o = component.create(); + QVERIFY(o); - void *ptr[1]; - li->at(0, ptr); - QVERIFY(li->count() == 1); - QCOMPARE(ptr[0], obj); + QVERIFY(o->property("value").userType() == qMetaTypeId<QmlListReference>()); + QCOMPARE(o->property("test").toInt(), 1); - li->removeAt(0); - QVERIFY(li->count() == 0); - QVERIFY(list.count() == 0); + delete o; } QTEST_MAIN(tst_QmlList) diff --git a/tests/auto/declarative/qmllistaccessor/qmllistaccessor.pro b/tests/auto/declarative/qmllistaccessor/qmllistaccessor.pro deleted file mode 100644 index ce2915e..0000000 --- a/tests/auto/declarative/qmllistaccessor/qmllistaccessor.pro +++ /dev/null @@ -1,5 +0,0 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative -macx:CONFIG -= app_bundle - -SOURCES += tst_qmllistaccessor.cpp diff --git a/tests/auto/declarative/qmllistaccessor/tst_qmllistaccessor.cpp b/tests/auto/declarative/qmllistaccessor/tst_qmllistaccessor.cpp deleted file mode 100644 index 3efe847..0000000 --- a/tests/auto/declarative/qmllistaccessor/tst_qmllistaccessor.cpp +++ /dev/null @@ -1,452 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include <qtest.h> -#include <QtDeclarative/qml.h> -#include <private/qmllistaccessor_p.h> -#include <QDebug> - -class tst_QmlListAccessor : public QObject -{ - Q_OBJECT -public: - tst_QmlListAccessor() {} - -private slots: - void invalid(); - void qmllist(); - void qlist(); - void qstringlist(); - void qvariantlist(); - void qobject(); - void instance(); - void integer(); -}; - -void tst_QmlListAccessor::invalid() -{ - QmlListAccessor accessor; - - QCOMPARE(accessor.list(), QVariant()); - QVERIFY(!accessor.isValid()); - QCOMPARE(accessor.type(), QmlListAccessor::Invalid); - - QCOMPARE(accessor.count(), 0); - QVERIFY(!accessor.append(QVariant(10))); - QVERIFY(!accessor.insert(0, QVariant(10))); - QVERIFY(!accessor.removeAt(0)); - QVERIFY(!accessor.clear()); - - accessor.setList(QVariant()); - - QCOMPARE(accessor.list(), QVariant()); - QVERIFY(!accessor.isValid()); - QCOMPARE(accessor.type(), QmlListAccessor::Invalid); - - QCOMPARE(accessor.count(), 0); - QVERIFY(!accessor.append(QVariant(10))); - QVERIFY(!accessor.insert(0, QVariant(10))); - QVERIFY(!accessor.removeAt(0)); - QVERIFY(!accessor.clear()); -} - -void tst_QmlListAccessor::qmllist() -{ - QmlConcreteList<QObject*> list; - QObject *obj = new QObject(this); - QObject *obj2 = new QObject(this); - QObject *obj3 = new QObject(this); - - list.append(obj); - QVERIFY(list.count() == 1); - QCOMPARE(list.at(0), obj); - - QmlListAccessor accessor; - accessor.setList(qVariantFromValue((QmlList<QObject*>*)&list)); - QCOMPARE(accessor.list(), qVariantFromValue((QmlList<QObject*>*)&list)); - - // type - QCOMPARE(accessor.type(), QmlListAccessor::QmlList); - - // isValid - QVERIFY(accessor.isValid()); - - // count - QCOMPARE(accessor.count(), 1); - - // at - QCOMPARE(qvariant_cast<QObject*>(accessor.at(0)), obj); - - // append - accessor.append(qVariantFromValue(obj2)); - QVERIFY(accessor.isValid()); - QCOMPARE(accessor.count(), 2); - QCOMPARE(qvariant_cast<QObject*>(accessor.at(1)), obj2); - QCOMPARE(list.count(), 2); - QCOMPARE(list.at(0), obj); - QCOMPARE(list.at(1), obj2); - - // insert - accessor.insert(1, qVariantFromValue(obj3)); - QVERIFY(accessor.isValid()); - QCOMPARE(accessor.count(), 3); - QCOMPARE(qvariant_cast<QObject*>(accessor.at(1)), obj3); - QCOMPARE(list.count(), 3); - QCOMPARE(list.at(0), obj); - QCOMPARE(list.at(1), obj3); - QCOMPARE(list.at(2), obj2); - - // removeAt - accessor.removeAt(1); - QVERIFY(accessor.isValid()); - QCOMPARE(accessor.count(), 2); - QCOMPARE(qvariant_cast<QObject*>(accessor.at(1)), obj2); - QCOMPARE(list.count(), 2); - QCOMPARE(list.at(0), obj); - QCOMPARE(list.at(1), obj2); - - // clear - accessor.clear(); - QVERIFY(accessor.isValid()); - QCOMPARE(accessor.count(), 0); - QCOMPARE(list.count(), 0); -} - -void tst_QmlListAccessor::qlist() -{ - QList<QObject*> list; - QObject *obj = new QObject(this); - QObject *obj2 = new QObject(this); - QObject *obj3 = new QObject(this); - - list.append(obj); - QVERIFY(list.count() == 1); - QCOMPARE(list.at(0), obj); - - QmlListAccessor accessor; - accessor.setList(qVariantFromValue((QList<QObject*>*)&list)); - QCOMPARE(accessor.list(), qVariantFromValue((QList<QObject*>*)&list)); - - // type - QCOMPARE(accessor.type(), QmlListAccessor::QListPtr); - - // isValid - QVERIFY(accessor.isValid()); - - // count - QCOMPARE(accessor.count(), 1); - - // at - QCOMPARE(qvariant_cast<QObject*>(accessor.at(0)), obj); - - // append - accessor.append(qVariantFromValue(obj2)); - QVERIFY(accessor.isValid()); - QCOMPARE(accessor.count(), 2); - QCOMPARE(qvariant_cast<QObject*>(accessor.at(1)), obj2); - QCOMPARE(list.count(), 2); - QCOMPARE(list.at(0), obj); - QCOMPARE(list.at(1), obj2); - - // insert - accessor.insert(1, qVariantFromValue(obj3)); - QVERIFY(accessor.isValid()); - QCOMPARE(accessor.count(), 3); - QCOMPARE(qvariant_cast<QObject*>(accessor.at(1)), obj3); - QCOMPARE(list.count(), 3); - QCOMPARE(list.at(0), obj); - QCOMPARE(list.at(1), obj3); - QCOMPARE(list.at(2), obj2); - - // removeAt - accessor.removeAt(1); - QVERIFY(accessor.isValid()); - QCOMPARE(accessor.count(), 2); - QCOMPARE(qvariant_cast<QObject*>(accessor.at(1)), obj2); - QCOMPARE(list.count(), 2); - QCOMPARE(list.at(0), obj); - QCOMPARE(list.at(1), obj2); - - // clear - accessor.clear(); - QVERIFY(accessor.isValid()); - QCOMPARE(accessor.count(), 0); - QCOMPARE(list.count(), 0); -} - -void tst_QmlListAccessor::qstringlist() -{ - QStringList list; - list.append(QLatin1String("Item1")); - list.append(QLatin1String("Item2")); - QVERIFY(list.count() == 2); - - QmlListAccessor accessor; - accessor.setList(list); - - // type - QCOMPARE(accessor.type(), QmlListAccessor::StringList); - - // isValid - QVERIFY(accessor.isValid()); - - // count - QVERIFY(accessor.count() == 2); - - // at - QCOMPARE(qvariant_cast<QString>(accessor.at(0)), QLatin1String("Item1")); - QCOMPARE(qvariant_cast<QString>(accessor.at(1)), QLatin1String("Item2")); - - // append - QVERIFY(!accessor.append(QVariant("Item3"))); - QVERIFY(accessor.isValid()); - QVERIFY(accessor.count() == 2); - QCOMPARE(qvariant_cast<QString>(accessor.at(0)), QLatin1String("Item1")); - QCOMPARE(qvariant_cast<QString>(accessor.at(1)), QLatin1String("Item2")); - - // insert - QVERIFY(!accessor.insert(1, QVariant("MiddleItem"))); - QVERIFY(accessor.isValid()); - QVERIFY(accessor.count() == 2); - QCOMPARE(qvariant_cast<QString>(accessor.at(0)), QLatin1String("Item1")); - QCOMPARE(qvariant_cast<QString>(accessor.at(1)), QLatin1String("Item2")); - - // removeAt - QVERIFY(!accessor.removeAt(1)); - QVERIFY(accessor.isValid()); - QVERIFY(accessor.count() == 2); - QCOMPARE(qvariant_cast<QString>(accessor.at(0)), QLatin1String("Item1")); - QCOMPARE(qvariant_cast<QString>(accessor.at(1)), QLatin1String("Item2")); - - // clear - QVERIFY(!accessor.clear()); - QVERIFY(accessor.isValid()); - QVERIFY(accessor.count() == 2); - QCOMPARE(qvariant_cast<QString>(accessor.at(0)), QLatin1String("Item1")); - QCOMPARE(qvariant_cast<QString>(accessor.at(1)), QLatin1String("Item2")); -} - -void tst_QmlListAccessor::qvariantlist() -{ - QVariantList list; - list.append(QLatin1String("Item1")); - list.append(QLatin1String("Item2")); - QVERIFY(list.count() == 2); - - QmlListAccessor accessor; - accessor.setList(list); - - // type - QCOMPARE(accessor.type(), QmlListAccessor::VariantList); - - // isValid - QVERIFY(accessor.isValid()); - - // count - QVERIFY(accessor.count() == 2); - - // at - QCOMPARE(qvariant_cast<QString>(accessor.at(0)), QLatin1String("Item1")); - QCOMPARE(qvariant_cast<QString>(accessor.at(1)), QLatin1String("Item2")); - - // append - QVERIFY(!accessor.append(QVariant("Item3"))); - QVERIFY(accessor.isValid()); - QVERIFY(accessor.count() == 2); - QCOMPARE(qvariant_cast<QString>(accessor.at(0)), QLatin1String("Item1")); - QCOMPARE(qvariant_cast<QString>(accessor.at(1)), QLatin1String("Item2")); - - // insert - QVERIFY(!accessor.insert(1, QVariant("MiddleItem"))); - QVERIFY(accessor.isValid()); - QVERIFY(accessor.count() == 2); - QCOMPARE(qvariant_cast<QString>(accessor.at(0)), QLatin1String("Item1")); - QCOMPARE(qvariant_cast<QString>(accessor.at(1)), QLatin1String("Item2")); - - // removeAt - QVERIFY(!accessor.removeAt(1)); - QVERIFY(accessor.isValid()); - QVERIFY(accessor.count() == 2); - QCOMPARE(qvariant_cast<QString>(accessor.at(0)), QLatin1String("Item1")); - QCOMPARE(qvariant_cast<QString>(accessor.at(1)), QLatin1String("Item2")); - - // clear - QVERIFY(!accessor.clear()); - QVERIFY(accessor.isValid()); - QVERIFY(accessor.count() == 2); - QCOMPARE(qvariant_cast<QString>(accessor.at(0)), QLatin1String("Item1")); - QCOMPARE(qvariant_cast<QString>(accessor.at(1)), QLatin1String("Item2")); -} - -void tst_QmlListAccessor::qobject() -{ - QObject *obj = new QObject(this); - - QmlListAccessor accessor; - accessor.setList(qVariantFromValue(obj)); - - // type - QCOMPARE(accessor.type(), QmlListAccessor::Instance); - - // isValid - QVERIFY(accessor.isValid()); - - // count - QVERIFY(accessor.count() == 1); - - // at - QCOMPARE(accessor.at(0), qVariantFromValue(obj)); - - // append - QVERIFY(!accessor.append(qVariantFromValue((QObject *)0))); - QVERIFY(accessor.isValid()); - QVERIFY(accessor.count() == 1); - QCOMPARE(accessor.at(0), qVariantFromValue(obj)); - - // insert - QVERIFY(!accessor.insert(0, qVariantFromValue((QObject *)0))); - QVERIFY(accessor.isValid()); - QVERIFY(accessor.count() == 1); - QCOMPARE(accessor.at(0), qVariantFromValue(obj)); - - // removeAt - QVERIFY(!accessor.removeAt(0)); - QVERIFY(accessor.isValid()); - QVERIFY(accessor.count() == 1); - QCOMPARE(accessor.at(0), qVariantFromValue(obj)); - - // clear - QVERIFY(!accessor.clear()); - QVERIFY(accessor.isValid()); - QVERIFY(accessor.count() == 1); - QCOMPARE(accessor.at(0), qVariantFromValue(obj)); -} - -void tst_QmlListAccessor::instance() -{ - QRect r; - - QmlListAccessor accessor; - accessor.setList(r); - - // type - QCOMPARE(accessor.type(), QmlListAccessor::Instance); - - // isValid - QVERIFY(accessor.isValid()); - - // count - QVERIFY(accessor.count() == 1); - - // at - QCOMPARE(accessor.at(0), qVariantFromValue(r)); - - // append - QVERIFY(!accessor.append(qVariantFromValue(r))); - QVERIFY(accessor.isValid()); - QVERIFY(accessor.count() == 1); - QCOMPARE(accessor.at(0), qVariantFromValue(r)); - - // insert - QVERIFY(!accessor.insert(0, qVariantFromValue(r))); - QVERIFY(accessor.isValid()); - QVERIFY(accessor.count() == 1); - QCOMPARE(accessor.at(0), qVariantFromValue(r)); - - // removeAt - QVERIFY(!accessor.removeAt(0)); - QVERIFY(accessor.isValid()); - QVERIFY(accessor.count() == 1); - QCOMPARE(accessor.at(0), qVariantFromValue(r)); - - // clear - QVERIFY(!accessor.clear()); - QVERIFY(accessor.isValid()); - QVERIFY(accessor.count() == 1); - QCOMPARE(accessor.at(0), qVariantFromValue(r)); -} - -void tst_QmlListAccessor::integer() -{ - int r = 13; - - QmlListAccessor accessor; - accessor.setList(r); - - // type - QCOMPARE(accessor.type(), QmlListAccessor::Integer); - - // isValid - QVERIFY(accessor.isValid()); - - // count - QVERIFY(accessor.count() == 13); - - // at - QCOMPARE(accessor.at(4), qVariantFromValue(4)); - - // append - QVERIFY(!accessor.append(qVariantFromValue(r))); - QVERIFY(accessor.isValid()); - QVERIFY(accessor.count() == 13); - QCOMPARE(accessor.at(4), qVariantFromValue(4)); - - // insert - QVERIFY(!accessor.insert(0, qVariantFromValue(r))); - QVERIFY(accessor.isValid()); - QVERIFY(accessor.count() == 13); - QCOMPARE(accessor.at(4), qVariantFromValue(4)); - - // removeAt - QVERIFY(!accessor.removeAt(0)); - QVERIFY(accessor.isValid()); - QVERIFY(accessor.count() == 13); - QCOMPARE(accessor.at(4), qVariantFromValue(4)); - - // clear - QVERIFY(!accessor.clear()); - QVERIFY(accessor.isValid()); - QVERIFY(accessor.count() == 13); - QCOMPARE(accessor.at(4), qVariantFromValue(4)); -} - -QTEST_MAIN(tst_QmlListAccessor) - -#include "tst_qmllistaccessor.moc" diff --git a/tests/auto/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp b/tests/auto/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp index 91ff727..050cd3f 100644 --- a/tests/auto/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp +++ b/tests/auto/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp @@ -73,13 +73,11 @@ private: class MyContainer : public QObject { Q_OBJECT - Q_PROPERTY(QList<MyQmlObject*>* children READ children) - Q_PROPERTY(QmlList<MyQmlObject*>* qmlChildren READ qmlChildren) + Q_PROPERTY(QmlListProperty<MyQmlObject> children READ children) public: MyContainer() {} - QList<MyQmlObject*> *children() { return &m_children; } - QmlConcreteList<MyQmlObject *> *qmlChildren() { return &m_qmlChildren; } + QmlListProperty<MyQmlObject> children() { return QmlListProperty<MyQmlObject>(this, m_children); } static MyAttached *qmlAttachedProperties(QObject *o) { return new MyAttached(o); @@ -87,7 +85,6 @@ public: private: QList<MyQmlObject*> m_children; - QmlConcreteList<MyQmlObject *> m_qmlChildren; }; QML_DECLARE_TYPE(MyContainer); @@ -118,7 +115,6 @@ private slots: // Functionality void writeObjectToList(); void writeListToList(); - void writeObjectToQmlList(); //writeToReadOnly(); @@ -1078,13 +1074,14 @@ void tst_qmlmetaproperty::writeObjectToList() containerComponent.setData("import Test 1.0\nMyContainer { children: MyQmlObject {} }", QUrl()); MyContainer *container = qobject_cast<MyContainer*>(containerComponent.create()); QVERIFY(container != 0); - QVERIFY(container->children()->size() == 1); + QmlListReference list(container, "children"); + QVERIFY(list.count() == 1); MyQmlObject *object = new MyQmlObject; QmlMetaProperty prop(container, "children"); prop.write(qVariantFromValue(object)); - QCOMPARE(container->children()->size(), 2); - QCOMPARE(container->children()->at(1), object); + QCOMPARE(list.count(), 1); + QCOMPARE(list.at(0), object); } Q_DECLARE_METATYPE(QList<QObject *>); @@ -1094,13 +1091,14 @@ void tst_qmlmetaproperty::writeListToList() containerComponent.setData("import Test 1.0\nMyContainer { children: MyQmlObject {} }", QUrl()); MyContainer *container = qobject_cast<MyContainer*>(containerComponent.create()); QVERIFY(container != 0); - QVERIFY(container->children()->size() == 1); + QmlListReference list(container, "children"); + QVERIFY(list.count() == 1); QList<QObject*> objList; objList << new MyQmlObject() << new MyQmlObject() << new MyQmlObject() << new MyQmlObject(); QmlMetaProperty prop(container, "children"); prop.write(qVariantFromValue(objList)); - QCOMPARE(container->children()->size(), 4); + QCOMPARE(list.count(), 4); //XXX need to try this with read/write prop (for read-only it correctly doesn't write) /*QList<MyQmlObject*> typedObjList; @@ -1109,21 +1107,6 @@ void tst_qmlmetaproperty::writeListToList() QCOMPARE(container->children()->size(), 1);*/ } -void tst_qmlmetaproperty::writeObjectToQmlList() -{ - QmlComponent containerComponent(&engine); - containerComponent.setData("import Test 1.0\nMyContainer { qmlChildren: MyQmlObject {} }", QUrl()); - MyContainer *container = qobject_cast<MyContainer*>(containerComponent.create()); - QVERIFY(container != 0); - QVERIFY(container->qmlChildren()->size() == 1); - - MyQmlObject *object = new MyQmlObject; - QmlMetaProperty prop(container, "qmlChildren"); - prop.write(qVariantFromValue(object)); - QCOMPARE(container->qmlChildren()->size(), 2); - QCOMPARE(container->qmlChildren()->at(1), object); -} - void tst_qmlmetaproperty::crashOnValueProperty() { QmlEngine *engine = new QmlEngine; diff --git a/tests/auto/declarative/qmlmetatype/tst_qmlmetatype.cpp b/tests/auto/declarative/qmlmetatype/tst_qmlmetatype.cpp index 6d1887f..750ccf8 100644 --- a/tests/auto/declarative/qmlmetatype/tst_qmlmetatype.cpp +++ b/tests/auto/declarative/qmlmetatype/tst_qmlmetatype.cpp @@ -67,10 +67,6 @@ private slots: void qmlPropertyValueInterceptorCast(); void isList(); - void isQmlList(); - - void listCount(); - void listAt(); void defaultObject(); }; @@ -346,85 +342,12 @@ void tst_qmlmetatype::qmlPropertyValueInterceptorCast() void tst_qmlmetatype::isList() { - QCOMPARE(QmlMetaType::isList(QVariant()), false); QCOMPARE(QmlMetaType::isList(QVariant::Invalid), false); QCOMPARE(QmlMetaType::isList(QVariant::Int), false); - QCOMPARE(QmlMetaType::isList(QVariant(10)), false); - - QList<TestType *> list; - QmlConcreteList<TestType *> qmllist; - - QCOMPARE(QmlMetaType::isList(qMetaTypeId<QList<TestType *>*>()), true); - QCOMPARE(QmlMetaType::isList(QVariant::fromValue(&list)), true); - QCOMPARE(QmlMetaType::isList(qMetaTypeId<QmlList<TestType *>*>()), false); - QCOMPARE(QmlMetaType::isList(QVariant::fromValue((QmlList<TestType *>*)&qmllist)), false); -} -void tst_qmlmetatype::isQmlList() -{ - QCOMPARE(QmlMetaType::isQmlList(QVariant::Invalid), false); - QCOMPARE(QmlMetaType::isQmlList(QVariant::Int), false); - - QCOMPARE(QmlMetaType::isQmlList(qMetaTypeId<QList<TestType *>*>()), false); - QCOMPARE(QmlMetaType::isQmlList(qMetaTypeId<QmlList<TestType *>*>()), true); -} + QmlListProperty<TestType> list; -void tst_qmlmetatype::listCount() -{ - QCOMPARE(QmlMetaType::listCount(QVariant()), 0); - QCOMPARE(QmlMetaType::listCount(QVariant(10)), 0); - - QList<TestType *> list; - QVariant listVar = QVariant::fromValue(&list); - QmlConcreteList<TestType *> qmllist; - QVariant qmllistVar = QVariant::fromValue((QmlList<TestType *>*)&qmllist); - - QCOMPARE(QmlMetaType::listCount(listVar), 0); - QCOMPARE(QmlMetaType::listCount(qmllistVar), 0); - - list.append(0); list.append(0); list.append(0); - qmllist.append(0); qmllist.append(0); qmllist.append(0); - - QCOMPARE(QmlMetaType::listCount(listVar), 3); - QCOMPARE(QmlMetaType::listCount(qmllistVar), 0); -} - -void tst_qmlmetatype::listAt() -{ - QCOMPARE(QmlMetaType::listAt(QVariant(), 0), QVariant()); - QCOMPARE(QmlMetaType::listAt(QVariant(10), 0), QVariant()); - QCOMPARE(QmlMetaType::listAt(QVariant(), 10), QVariant()); - QCOMPARE(QmlMetaType::listAt(QVariant(10), 10), QVariant()); - QCOMPARE(QmlMetaType::listAt(QVariant(), -10), QVariant()); - QCOMPARE(QmlMetaType::listAt(QVariant(10), -10), QVariant()); - - QList<TestType *> list; - QVariant listVar = QVariant::fromValue(&list); - QmlConcreteList<TestType *> qmllist; - QVariant qmllistVar = QVariant::fromValue((QmlList<TestType *>*)&qmllist); - - QCOMPARE(QmlMetaType::listAt(listVar, 0), QVariant()); - QCOMPARE(QmlMetaType::listAt(listVar, 2), QVariant()); - QCOMPARE(QmlMetaType::listAt(listVar, -1), QVariant()); - - QCOMPARE(QmlMetaType::listAt(qmllistVar, 0), QVariant()); - QCOMPARE(QmlMetaType::listAt(qmllistVar, 2), QVariant()); - QCOMPARE(QmlMetaType::listAt(qmllistVar, -1), QVariant()); - - TestType ttype; - QVariant ttypeVar = QVariant::fromValue(&ttype); - QVariant nullttypeVar = QVariant::fromValue((TestType *)0); - - list.append(0); list.append(&ttype); list.append(0); - qmllist.append(0); qmllist.append(&ttype); qmllist.append(0); - - QCOMPARE(QmlMetaType::listAt(listVar, 0), nullttypeVar); - QCOMPARE(QmlMetaType::listAt(listVar, 1), ttypeVar); - QCOMPARE(QmlMetaType::listAt(listVar, -1), QVariant()); - - QCOMPARE(QmlMetaType::listAt(qmllistVar, 0), QVariant()); - QCOMPARE(QmlMetaType::listAt(qmllistVar, 2), QVariant()); - QCOMPARE(QmlMetaType::listAt(qmllistVar, -1), QVariant()); + QCOMPARE(QmlMetaType::isList(qMetaTypeId<QmlListProperty<TestType> >()), true); } void tst_qmlmetatype::defaultObject() diff --git a/tests/auto/declarative/qmlstates/data/illegalTempState.qml b/tests/auto/declarative/qmlstates/data/illegalTempState.qml index 2702be4..0dc39ae 100644 --- a/tests/auto/declarative/qmlstates/data/illegalTempState.qml +++ b/tests/auto/declarative/qmlstates/data/illegalTempState.qml @@ -14,7 +14,7 @@ Rectangle { } ] - MouseRegion { + MouseArea { anchors.fill: parent onClicked: card.state = "placed" } diff --git a/tests/auto/declarative/qmlstates/data/legalTempState.qml b/tests/auto/declarative/qmlstates/data/legalTempState.qml index 54c97b9..9be984c 100644 --- a/tests/auto/declarative/qmlstates/data/legalTempState.qml +++ b/tests/auto/declarative/qmlstates/data/legalTempState.qml @@ -16,7 +16,7 @@ Rectangle { } ] - MouseRegion { + MouseArea { anchors.fill: parent onClicked: card.state = "placed" } diff --git a/tests/auto/declarative/qmlstates/data/parentChange.qml b/tests/auto/declarative/qmlstates/data/parentChange.qml index 087da6b..b8c7818 100644 --- a/tests/auto/declarative/qmlstates/data/parentChange.qml +++ b/tests/auto/declarative/qmlstates/data/parentChange.qml @@ -12,7 +12,7 @@ Rectangle { color: "red" } } - MouseRegion { + MouseArea { id: clickable anchors.fill: parent } diff --git a/tests/auto/declarative/qmlstates/data/parentChange2.qml b/tests/auto/declarative/qmlstates/data/parentChange2.qml index f0b00f5..8b23591 100644 --- a/tests/auto/declarative/qmlstates/data/parentChange2.qml +++ b/tests/auto/declarative/qmlstates/data/parentChange2.qml @@ -15,7 +15,7 @@ Rectangle { color: "red" } } - MouseRegion { + MouseArea { id: clickable anchors.fill: parent } diff --git a/tests/auto/declarative/qmlstates/data/parentChange3.qml b/tests/auto/declarative/qmlstates/data/parentChange3.qml index 2aa507c..ddf9268 100644 --- a/tests/auto/declarative/qmlstates/data/parentChange3.qml +++ b/tests/auto/declarative/qmlstates/data/parentChange3.qml @@ -16,7 +16,7 @@ Rectangle { color: "red" } } - MouseRegion { + MouseArea { id: clickable anchors.fill: parent } diff --git a/tests/auto/declarative/qmlstates/data/parentChange4.qml b/tests/auto/declarative/qmlstates/data/parentChange4.qml index d00274b..34d667a 100644 --- a/tests/auto/declarative/qmlstates/data/parentChange4.qml +++ b/tests/auto/declarative/qmlstates/data/parentChange4.qml @@ -9,7 +9,7 @@ Rectangle { width: 100; height: 100 color: "red" } - MouseRegion { + MouseArea { id: clickable anchors.fill: parent } diff --git a/tests/auto/declarative/qmlstates/data/parentChange5.qml b/tests/auto/declarative/qmlstates/data/parentChange5.qml index f75e2a3..56bdd89 100644 --- a/tests/auto/declarative/qmlstates/data/parentChange5.qml +++ b/tests/auto/declarative/qmlstates/data/parentChange5.qml @@ -9,7 +9,7 @@ Rectangle { width: 100; height: 100 color: "red" } - MouseRegion { + MouseArea { id: clickable anchors.fill: parent } diff --git a/tests/auto/declarative/qmlstates/tst_qmlstates.cpp b/tests/auto/declarative/qmlstates/tst_qmlstates.cpp index 81145a8..b910c85 100644 --- a/tests/auto/declarative/qmlstates/tst_qmlstates.cpp +++ b/tests/auto/declarative/qmlstates/tst_qmlstates.cpp @@ -407,8 +407,12 @@ void tst_qmlstates::parentChange() QmlGraphicsRectangle *innerRect = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect")); QVERIFY(innerRect != 0); - qmlExecuteDeferred(rect->states()->at(0)); - QmlParentChange *pChange = qobject_cast<QmlParentChange*>(rect->states()->at(0)->changes()->at(0)); + QmlListReference list(rect, "states"); + QmlState *state = qobject_cast<QmlState*>(list.at(0)); + QVERIFY(state != 0); + + qmlExecuteDeferred(state); + QmlParentChange *pChange = qobject_cast<QmlParentChange*>(state->operationAt(0)); QVERIFY(pChange != 0); QmlGraphicsItem *nParent = qobject_cast<QmlGraphicsItem*>(rect->findChild<QmlGraphicsItem*>("NewParent")); QVERIFY(nParent != 0); @@ -510,8 +514,12 @@ void tst_qmlstates::anchorChanges() QmlGraphicsRectangle *innerRect = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect")); QVERIFY(innerRect != 0); - qmlExecuteDeferred(rect->states()->at(0)); - QmlAnchorChanges *aChanges = qobject_cast<QmlAnchorChanges*>(rect->states()->at(0)->changes()->at(0)); + QmlListReference list(rect, "states"); + QmlState *state = qobject_cast<QmlState*>(list.at(0)); + QVERIFY(state != 0); + + qmlExecuteDeferred(state); + QmlAnchorChanges *aChanges = qobject_cast<QmlAnchorChanges*>(state->operationAt(0)); QVERIFY(aChanges != 0); rect->setState("right"); @@ -565,8 +573,12 @@ void tst_qmlstates::anchorChanges3() QmlGraphicsItem *bottomGuideline = qobject_cast<QmlGraphicsItem*>(rect->findChild<QmlGraphicsItem*>("BottomGuideline")); QVERIFY(bottomGuideline != 0); - qmlExecuteDeferred(rect->states()->at(0)); - QmlAnchorChanges *aChanges = qobject_cast<QmlAnchorChanges*>(rect->states()->at(0)->changes()->at(0)); + QmlListReference list(rect, "states"); + QmlState *state = qobject_cast<QmlState*>(list.at(0)); + QVERIFY(state != 0); + + qmlExecuteDeferred(state); + QmlAnchorChanges *aChanges = qobject_cast<QmlAnchorChanges*>(state->operationAt(0)); QVERIFY(aChanges != 0); rect->setState("reanchored"); @@ -611,8 +623,12 @@ void tst_qmlstates::anchorChanges4() QmlGraphicsItem *bottomGuideline = qobject_cast<QmlGraphicsItem*>(rect->findChild<QmlGraphicsItem*>("BottomGuideline")); QVERIFY(bottomGuideline != 0); - qmlExecuteDeferred(rect->states()->at(0)); - QmlAnchorChanges *aChanges = qobject_cast<QmlAnchorChanges*>(rect->states()->at(0)->changes()->at(0)); + QmlListReference list(rect, "states"); + QmlState *state = qobject_cast<QmlState*>(list.at(0)); + QVERIFY(state != 0); + + qmlExecuteDeferred(state); + QmlAnchorChanges *aChanges = qobject_cast<QmlAnchorChanges*>(state->operationAt(0)); QVERIFY(aChanges != 0); rect->setState("reanchored"); @@ -642,8 +658,12 @@ void tst_qmlstates::anchorChanges5() QmlGraphicsItem *bottomGuideline = qobject_cast<QmlGraphicsItem*>(rect->findChild<QmlGraphicsItem*>("BottomGuideline")); QVERIFY(bottomGuideline != 0); - qmlExecuteDeferred(rect->states()->at(0)); - QmlAnchorChanges *aChanges = qobject_cast<QmlAnchorChanges*>(rect->states()->at(0)->changes()->at(0)); + QmlListReference list(rect, "states"); + QmlState *state = qobject_cast<QmlState*>(list.at(0)); + QVERIFY(state != 0); + + qmlExecuteDeferred(state); + QmlAnchorChanges *aChanges = qobject_cast<QmlAnchorChanges*>(state->operationAt(0)); QVERIFY(aChanges != 0); rect->setState("reanchored"); @@ -700,7 +720,11 @@ void tst_qmlstates::explicitChanges() QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(rectComponent.create()); QVERIFY(rect != 0); - qmlExecuteDeferred(rect->states()->at(0)); + QmlListReference list(rect, "states"); + QmlState *state = qobject_cast<QmlState*>(list.at(0)); + QVERIFY(state != 0); + + qmlExecuteDeferred(state); QmlPropertyChanges *changes = qobject_cast<QmlPropertyChanges*>(rect->findChild<QmlPropertyChanges*>("changes")); QVERIFY(changes != 0); QVERIFY(changes->isExplicit()); @@ -802,7 +826,7 @@ void tst_qmlstates::deletingChange() QmlState *state = rect->findChild<QmlState*>(); QVERIFY(state != 0); qmlExecuteDeferred(state); - QCOMPARE(state->changes()->count(), 1); + QCOMPARE(state->operationCount(), 1); rect->setState("blue"); QCOMPARE(rect->color(),QColor("red")); diff --git a/tests/auto/declarative/visual/Package_Views/packageviews.qml b/tests/auto/declarative/visual/Package_Views/packageviews.qml index dcfe7de..b577e45 100644 --- a/tests/auto/declarative/visual/Package_Views/packageviews.qml +++ b/tests/auto/declarative/visual/Package_Views/packageviews.qml @@ -29,14 +29,14 @@ Rectangle { delegate: Package { Rectangle { id: listItem; Package.name: "list"; width:root.width/2; height: 50; color: "transparent"; border.color: "white" - MouseRegion { + MouseArea { anchors.fill: parent onClicked: myState.state = myState.state == "list" ? "grid" : "list" } } Rectangle { id: gridItem; Package.name: "grid"; width:50; height: 50; color: "transparent"; border.color: "white" - MouseRegion { + MouseArea { anchors.fill: parent onClicked: myState.state = myState.state == "list" ? "grid" : "list" } diff --git a/tests/auto/declarative/visual/animation/bindinganimation/bindinganimation.qml b/tests/auto/declarative/visual/animation/bindinganimation/bindinganimation.qml index 5230ca4..70c14cf 100644 --- a/tests/auto/declarative/visual/animation/bindinganimation/bindinganimation.qml +++ b/tests/auto/declarative/visual/animation/bindinganimation/bindinganimation.qml @@ -20,7 +20,7 @@ Rectangle { x: 50 + 50 } PropertyChanges { - target: myMouseRegion + target: myMouseArea onClicked: page.state = '' } } @@ -32,8 +32,8 @@ Rectangle { } } ] - MouseRegion { - id: myMouseRegion + MouseArea { + id: myMouseArea anchors.fill: parent onClicked: { page.state= 'hello' } } diff --git a/tests/auto/declarative/visual/animation/colorAnimation/colorAnimation.qml b/tests/auto/declarative/visual/animation/colorAnimation/colorAnimation.qml index 0e98d7e..f205ae8 100644 --- a/tests/auto/declarative/visual/animation/colorAnimation/colorAnimation.qml +++ b/tests/auto/declarative/visual/animation/colorAnimation/colorAnimation.qml @@ -34,7 +34,7 @@ Rectangle { } } ] - MouseRegion { + MouseArea { anchors.fill: parent onClicked: { mainrect.state = 'second' } } diff --git a/tests/auto/declarative/visual/animation/easing/easing.qml b/tests/auto/declarative/visual/animation/easing/easing.qml index f81400b..9c814eb 100644 --- a/tests/auto/declarative/visual/animation/easing/easing.qml +++ b/tests/auto/declarative/visual/animation/easing/easing.qml @@ -186,7 +186,7 @@ Rectangle { } } } - MouseRegion { + MouseArea { id: mouse anchors.fill: layout } diff --git a/tests/auto/declarative/visual/animation/parallelAnimation/parallelAnimation.qml b/tests/auto/declarative/visual/animation/parallelAnimation/parallelAnimation.qml index 7021e05..1980b91 100644 --- a/tests/auto/declarative/visual/animation/parallelAnimation/parallelAnimation.qml +++ b/tests/auto/declarative/visual/animation/parallelAnimation/parallelAnimation.qml @@ -14,7 +14,7 @@ Rectangle { color: "red" } - MouseRegion { + MouseArea { anchors.fill: parent onClicked: parent.state = "state1" } diff --git a/tests/auto/declarative/visual/animation/parentAction/parentAction.qml b/tests/auto/declarative/visual/animation/parentAction/parentAction.qml index e4f4406..eb3103e 100644 --- a/tests/auto/declarative/visual/animation/parentAction/parentAction.qml +++ b/tests/auto/declarative/visual/animation/parentAction/parentAction.qml @@ -15,7 +15,7 @@ Rectangle { color: "red" } } - MouseRegion { + MouseArea { id: clickable anchors.fill: parent } diff --git a/tests/auto/declarative/visual/animation/propertyAction/propertyAction.qml b/tests/auto/declarative/visual/animation/propertyAction/propertyAction.qml index 68671e1..593f495 100644 --- a/tests/auto/declarative/visual/animation/propertyAction/propertyAction.qml +++ b/tests/auto/declarative/visual/animation/propertyAction/propertyAction.qml @@ -7,7 +7,7 @@ Rectangle { width: 100; height: 100 color: "red" } - MouseRegion { + MouseArea { id: clickable anchors.fill: parent } diff --git a/tests/auto/declarative/visual/animation/reanchor/reanchor.qml b/tests/auto/declarative/visual/animation/reanchor/reanchor.qml index 359346f..d80631f 100644 --- a/tests/auto/declarative/visual/animation/reanchor/reanchor.qml +++ b/tests/auto/declarative/visual/animation/reanchor/reanchor.qml @@ -19,7 +19,7 @@ Rectangle { Item { id: topGuideline2; y: 50 } Item { id: bottomGuideline2; y: 175 } - MouseRegion { + MouseArea { id: wholeArea anchors.fill: parent onClicked: { @@ -55,7 +55,7 @@ Rectangle { NumberAnimation { properties: "x,y,width,height" } } - MouseRegion { + MouseArea { width: 50; height: 50 anchors.right: parent.right anchors.bottom: parent.bottom diff --git a/tests/auto/declarative/visual/animation/scriptAction/scriptAction.qml b/tests/auto/declarative/visual/animation/scriptAction/scriptAction.qml index f121906..30d587a 100644 --- a/tests/auto/declarative/visual/animation/scriptAction/scriptAction.qml +++ b/tests/auto/declarative/visual/animation/scriptAction/scriptAction.qml @@ -7,7 +7,7 @@ Rectangle { width: 100; height: 100 color: "red" } - MouseRegion { + MouseArea { id: clickable anchors.fill: parent } diff --git a/tests/auto/declarative/visual/qmlgraphicsflickable/flickable-vertical.qml b/tests/auto/declarative/visual/qmlgraphicsflickable/flickable-vertical.qml index cc15755..6204aa9 100644 --- a/tests/auto/declarative/visual/qmlgraphicsflickable/flickable-vertical.qml +++ b/tests/auto/declarative/visual/qmlgraphicsflickable/flickable-vertical.qml @@ -25,7 +25,7 @@ Rectangle { Repeater { model: list Rectangle { width: 300; height: 200; color: mr.pressed ? "black" : dayColor - MouseRegion { + MouseArea { id: mr anchors.fill: parent } @@ -49,7 +49,7 @@ Rectangle { height: 48 y: parent.height - 50 color: "red" - MouseRegion { + MouseArea { anchors.fill: parent onClicked: flick.interactive = flick.interactive ? false : true } @@ -62,7 +62,7 @@ Rectangle { x: 66 y: parent.height - 50 color: "green" - MouseRegion { + MouseArea { anchors.fill: parent onClicked: flick.pressDelay = flick.pressDelay > 0 ? 0 : 500 } @@ -75,7 +75,7 @@ Rectangle { x: 130 y: parent.height - 50 color: "yellow" - MouseRegion { + MouseArea { anchors.fill: parent onClicked: flick.overShoot = flick.overShoot > 0 ? 0 : 30 } diff --git a/tests/auto/declarative/visual/qmlgraphicspathview/test-pathview.qml b/tests/auto/declarative/visual/qmlgraphicspathview/test-pathview.qml index 70018b6..0adfa02 100644 --- a/tests/auto/declarative/visual/qmlgraphicspathview/test-pathview.qml +++ b/tests/auto/declarative/visual/qmlgraphicspathview/test-pathview.qml @@ -22,7 +22,7 @@ Rectangle { width: 85; height: 85; color: lColor scale: wrapper.PathView.scale - MouseRegion { anchors.fill: parent } + MouseArea { anchors.fill: parent } transform: Rotation { id: itemRotation; origin.x: wrapper.width/2; origin.y: wrapper.height/2 diff --git a/tests/auto/declarative/visual/qmlmouseregion/drag.qml b/tests/auto/declarative/visual/qmlmouseregion/drag.qml index ab4c280..dbb2a24 100644 --- a/tests/auto/declarative/visual/qmlmouseregion/drag.qml +++ b/tests/auto/declarative/visual/qmlmouseregion/drag.qml @@ -8,7 +8,7 @@ Rectangle{ id: draggable width:40; height:40; color: "lightsteelblue" y:20 - MouseRegion{ + MouseArea{ anchors.fill: parent drag.target: draggable drag.axis: "XandYAxis" diff --git a/tests/auto/declarative/visual/qmlmouseregion/mouseregion.qml b/tests/auto/declarative/visual/qmlmouseregion/mouseregion.qml index ab4223d..3c722d0 100644 --- a/tests/auto/declarative/visual/qmlmouseregion/mouseregion.qml +++ b/tests/auto/declarative/visual/qmlmouseregion/mouseregion.qml @@ -9,7 +9,7 @@ Rectangle { Rectangle { width: 98; height: 48 color: "red" - MouseRegion { + MouseArea { id: mr1 anchors.fill: parent enabled: false @@ -22,7 +22,7 @@ Rectangle { x: 100 width: 98; height: 48 color: "red" - MouseRegion { + MouseArea { id: mr2 anchors.fill: parent acceptedButtons: Qt.RightButton @@ -42,7 +42,7 @@ Rectangle { x: 200 width: 98; height: 48 color: "red" - MouseRegion { + MouseArea { id: mr3 anchors.fill: parent onPressAndHold: { @@ -56,7 +56,7 @@ Rectangle { x: 300 width: 98; height: 48 color: "red" - MouseRegion { + MouseArea { id: mr4 anchors.fill: parent onPressed: { @@ -74,7 +74,7 @@ Rectangle { y: 50 width: 98; height: 48 color: "red" - MouseRegion { + MouseArea { id: mr5 anchors.fill: parent hoverEnabled: true @@ -93,7 +93,7 @@ Rectangle { y: 50 width: 98; height: 48 color: "red" - MouseRegion { + MouseArea { id: mr6 anchors.fill: parent onClicked: { @@ -111,7 +111,7 @@ Rectangle { y: 50 width: 98; height: 48 color: "red" - MouseRegion { + MouseArea { id: mr7 anchors.fill: parent enabled: false diff --git a/tests/auto/declarative/visual/qmlspringfollow/follow.qml b/tests/auto/declarative/visual/qmlspringfollow/follow.qml index 8a713a2..a85a778 100644 --- a/tests/auto/declarative/visual/qmlspringfollow/follow.qml +++ b/tests/auto/declarative/visual/qmlspringfollow/follow.qml @@ -44,7 +44,7 @@ Rectangle { } // Follow mouse - MouseRegion { + MouseArea { id: mouseRegion anchors.fill: parent Rectangle { diff --git a/tests/auto/declarative/visual/selftest_noimages/selftest_noimages.qml b/tests/auto/declarative/visual/selftest_noimages/selftest_noimages.qml index 21a19bc..da7f9b6 100644 --- a/tests/auto/declarative/visual/selftest_noimages/selftest_noimages.qml +++ b/tests/auto/declarative/visual/selftest_noimages/selftest_noimages.qml @@ -2,7 +2,7 @@ import Qt 4.6 Text { property string error: "not pressed" text: (new Date()).valueOf() - MouseRegion { + MouseArea { anchors.fill: parent onPressed: error="" } diff --git a/tests/auto/declarative/visual/webview/settings/noAutoLoadImages.qml b/tests/auto/declarative/visual/webview/settings/noAutoLoadImages.qml index 2478932..72e672d 100644 --- a/tests/auto/declarative/visual/webview/settings/noAutoLoadImages.qml +++ b/tests/auto/declarative/visual/webview/settings/noAutoLoadImages.qml @@ -11,7 +11,7 @@ Grid { anchors.fill: parent settings.autoLoadImages: false url: "test-img.html" - MouseRegion { + MouseArea { anchors.fill: parent onClicked: { parent.settings.autoLoadImages=true; label.text=""; parent.reload.trigger() } } diff --git a/tests/auto/gestures/tst_gestures.cpp b/tests/auto/gestures/tst_gestures.cpp index e6de590..24391c0 100644 --- a/tests/auto/gestures/tst_gestures.cpp +++ b/tests/auto/gestures/tst_gestures.cpp @@ -334,6 +334,8 @@ private slots: void autoCancelGestures(); void autoCancelGestures2(); void graphicsViewParentPropagation(); + void panelPropagation(); + void panelStacksBehindParent(); }; tst_Gestures::tst_Gestures() @@ -1482,9 +1484,7 @@ void tst_Gestures::autoCancelGestures2() event.serial = CustomGesture::SerialStartedThreshold; event.hasHotSpot = true; event.hotSpot = mapToGlobal(QPointF(5, 5), child, &view); - // qDebug() << event.hotSpot; scene.sendEvent(child, &event); - //QEventLoop().exec(); QCOMPARE(parent->events.all.count(), 1); QCOMPARE(child->events.started.count(), 1); QCOMPARE(child->events.canceled.count(), 1); @@ -1557,5 +1557,172 @@ void tst_Gestures::graphicsViewParentPropagation() QCOMPARE(item0->gestureOverrideEventsReceived, 1); } +void tst_Gestures::panelPropagation() +{ + QGraphicsScene scene; + QGraphicsView view(&scene); + view.setWindowFlags(Qt::X11BypassWindowManagerHint); + + GestureItem *item0 = new GestureItem("item0"); + scene.addItem(item0); + item0->setPos(0, 0); + item0->size = QRectF(0, 0, 200, 200); + item0->grabGesture(CustomGesture::GestureType); + item0->setZValue(1); + + GestureItem *item1 = new GestureItem("item1"); + item1->grabGesture(CustomGesture::GestureType); + scene.addItem(item1); + item1->setPos(10, 10); + item1->size = QRectF(0, 0, 180, 180); + item1->setZValue(2); + + GestureItem *item1_child1 = new GestureItem("item1_child1[panel]"); + item1_child1->setFlags(QGraphicsItem::ItemIsPanel); + item1_child1->setParentItem(item1); + item1_child1->grabGesture(CustomGesture::GestureType); + item1_child1->setPos(10, 10); + item1_child1->size = QRectF(0, 0, 160, 160); + item1_child1->setZValue(5); + + GestureItem *item1_child1_child1 = new GestureItem("item1_child1_child1"); + item1_child1_child1->setParentItem(item1_child1); + item1_child1_child1->grabGesture(CustomGesture::GestureType); + item1_child1_child1->setPos(10, 10); + item1_child1_child1->size = QRectF(0, 0, 140, 140); + item1_child1_child1->setZValue(10); + + view.show(); + QTest::qWaitForWindowShown(&view); + view.ensureVisible(scene.sceneRect()); + + view.viewport()->grabGesture(CustomGesture::GestureType, Qt::DontStartGestureOnChildren); + + static const int TotalGestureEventsCount = CustomGesture::SerialFinishedThreshold - CustomGesture::SerialStartedThreshold + 1; + static const int TotalCustomEventsCount = CustomGesture::SerialFinishedThreshold - CustomGesture::SerialMaybeThreshold + 1; + + CustomEvent event; + event.hotSpot = mapToGlobal(QPointF(5, 5), item1_child1_child1, &view); + event.hasHotSpot = true; + sendCustomGesture(&event, item0, &scene); + + QCOMPARE(item0->customEventsReceived, TotalCustomEventsCount); + QCOMPARE(item1_child1_child1->gestureEventsReceived, TotalGestureEventsCount); + QCOMPARE(item1_child1_child1->gestureOverrideEventsReceived, 1); + QCOMPARE(item1_child1->gestureOverrideEventsReceived, 1); + QCOMPARE(item1->gestureEventsReceived, 0); + QCOMPARE(item1->gestureOverrideEventsReceived, 0); + QCOMPARE(item0->gestureEventsReceived, 0); + QCOMPARE(item0->gestureOverrideEventsReceived, 0); + + item0->reset(); item1->reset(); item1_child1->reset(); item1_child1_child1->reset(); + + event.hotSpot = mapToGlobal(QPointF(5, 5), item1, &view); + event.hasHotSpot = true; + sendCustomGesture(&event, item1, &scene); + + QCOMPARE(item1_child1_child1->gestureEventsReceived, 0); + QCOMPARE(item1_child1_child1->gestureOverrideEventsReceived, 0); + QCOMPARE(item1_child1->gestureEventsReceived, 0); + QCOMPARE(item1_child1->gestureOverrideEventsReceived, 0); + QCOMPARE(item1->gestureEventsReceived, TotalGestureEventsCount); + QCOMPARE(item1->gestureOverrideEventsReceived, 1); + QCOMPARE(item0->gestureEventsReceived, 0); + QCOMPARE(item0->gestureOverrideEventsReceived, 1); + + item0->reset(); item1->reset(); item1_child1->reset(); item1_child1_child1->reset(); + // try with a modal panel + item1_child1->setPanelModality(QGraphicsItem::PanelModal); + + event.hotSpot = mapToGlobal(QPointF(5, 5), item1, &view); + event.hasHotSpot = true; + sendCustomGesture(&event, item1, &scene); + + QCOMPARE(item1_child1_child1->gestureEventsReceived, 0); + QCOMPARE(item1_child1_child1->gestureOverrideEventsReceived, 0); + QCOMPARE(item1_child1->gestureEventsReceived, TotalGestureEventsCount); + QCOMPARE(item1_child1->gestureOverrideEventsReceived, 0); + QCOMPARE(item1->gestureEventsReceived, 0); + QCOMPARE(item1->gestureOverrideEventsReceived, 0); + QCOMPARE(item0->gestureEventsReceived, 0); + QCOMPARE(item0->gestureOverrideEventsReceived, 0); + + item0->reset(); item1->reset(); item1_child1->reset(); item1_child1_child1->reset(); + // try with a modal panel, however set the hotspot to be outside of the + // panel and its parent + item1_child1->setPanelModality(QGraphicsItem::PanelModal); + + event.hotSpot = mapToGlobal(QPointF(5, 5), item0, &view); + event.hasHotSpot = true; + sendCustomGesture(&event, item1, &scene); + + QCOMPARE(item1_child1_child1->gestureEventsReceived, 0); + QCOMPARE(item1_child1_child1->gestureOverrideEventsReceived, 0); + QCOMPARE(item1_child1->gestureEventsReceived, 0); + QCOMPARE(item1_child1->gestureOverrideEventsReceived, 0); + QCOMPARE(item1->gestureEventsReceived, 0); + QCOMPARE(item1->gestureOverrideEventsReceived, 0); + QCOMPARE(item0->gestureEventsReceived, TotalGestureEventsCount); + QCOMPARE(item0->gestureOverrideEventsReceived, 0); + + item0->reset(); item1->reset(); item1_child1->reset(); item1_child1_child1->reset(); + // try with a scene modal panel + item1_child1->setPanelModality(QGraphicsItem::SceneModal); + + event.hotSpot = mapToGlobal(QPointF(5, 5), item0, &view); + event.hasHotSpot = true; + sendCustomGesture(&event, item0, &scene); + + QCOMPARE(item1_child1_child1->gestureEventsReceived, 0); + QCOMPARE(item1_child1_child1->gestureOverrideEventsReceived, 0); + QCOMPARE(item1_child1->gestureEventsReceived, TotalGestureEventsCount); + QCOMPARE(item1_child1->gestureOverrideEventsReceived, 0); + QCOMPARE(item1->gestureEventsReceived, 0); + QCOMPARE(item1->gestureOverrideEventsReceived, 0); + QCOMPARE(item0->gestureEventsReceived, 0); + QCOMPARE(item0->gestureOverrideEventsReceived, 0); +} + +void tst_Gestures::panelStacksBehindParent() +{ + QGraphicsScene scene; + QGraphicsView view(&scene); + view.setWindowFlags(Qt::X11BypassWindowManagerHint); + + GestureItem *item1 = new GestureItem("item1"); + item1->grabGesture(CustomGesture::GestureType); + scene.addItem(item1); + item1->setPos(10, 10); + item1->size = QRectF(0, 0, 180, 180); + item1->setZValue(2); + + GestureItem *panel = new GestureItem("panel"); + panel->setFlags(QGraphicsItem::ItemIsPanel | QGraphicsItem::ItemStacksBehindParent); + panel->setPanelModality(QGraphicsItem::PanelModal); + panel->setParentItem(item1); + panel->grabGesture(CustomGesture::GestureType); + panel->setPos(-10, -10); + panel->size = QRectF(0, 0, 200, 200); + panel->setZValue(5); + + view.show(); + QTest::qWaitForWindowShown(&view); + view.ensureVisible(scene.sceneRect()); + + view.viewport()->grabGesture(CustomGesture::GestureType, Qt::DontStartGestureOnChildren); + + static const int TotalGestureEventsCount = CustomGesture::SerialFinishedThreshold - CustomGesture::SerialStartedThreshold + 1; + + CustomEvent event; + event.hotSpot = mapToGlobal(QPointF(5, 5), item1, &view); + event.hasHotSpot = true; + sendCustomGesture(&event, item1, &scene); + + QCOMPARE(item1->gestureEventsReceived, 0); + QCOMPARE(item1->gestureOverrideEventsReceived, 0); + QCOMPARE(panel->gestureEventsReceived, TotalGestureEventsCount); + QCOMPARE(panel->gestureOverrideEventsReceived, 0); +} + QTEST_MAIN(tst_Gestures) #include "tst_gestures.moc" diff --git a/tests/auto/headers/tst_headers.cpp b/tests/auto/headers/tst_headers.cpp index bf7ec3f..3745767 100644 --- a/tests/auto/headers/tst_headers.cpp +++ b/tests/auto/headers/tst_headers.cpp @@ -65,6 +65,7 @@ private: const QRegExp &exclude); static QStringList getHeaders(const QString &path); static QStringList getSourceFiles(const QString &path); + static QStringList getQDocFiles(const QString &path); void allSourceFilesData(); void allHeadersData(); @@ -111,6 +112,11 @@ QStringList tst_Headers::getSourceFiles(const QString &path) return getFiles(path, QStringList("*.cpp"), QRegExp("^(?!(moc_|qrc_))")); } +QStringList tst_Headers::getQDocFiles(const QString &path) +{ + return getFiles(path, QStringList("*.qdoc"), QRegExp(".")); +} + void tst_Headers::initTestCase() { qtSrcDir = QString::fromLocal8Bit(qgetenv("QTSRCDIR").isEmpty() @@ -149,6 +155,7 @@ void tst_Headers::allSourceFilesData() for (int i = 0; i < sizeof(subdirs) / sizeof(subdirs[0]); ++i) { sourceFiles << getSourceFiles(qtSrcDir + subdirs[i]); sourceFiles << getHeaders(qtSrcDir + subdirs[i]); + sourceFiles << getQDocFiles(qtSrcDir + subdirs[i]); } foreach (QString sourceFile, sourceFiles) { @@ -209,6 +216,11 @@ void tst_Headers::licenseCheck() content.takeFirst(); } + if (sourceFile.endsWith("/doc/src/classes/phonon-api.qdoc")) { + // This is an external file + return; + } + QVERIFY(licensePattern.exactMatch(content.value(8)) || licensePattern.exactMatch(content.value(5))); QString licenseType = licensePattern.cap(1); diff --git a/tests/auto/maketestselftest/tst_maketestselftest.cpp b/tests/auto/maketestselftest/tst_maketestselftest.cpp index ef92c56..1dde44b 100644 --- a/tests/auto/maketestselftest/tst_maketestselftest.cpp +++ b/tests/auto/maketestselftest/tst_maketestselftest.cpp @@ -92,7 +92,9 @@ void tst_MakeTestSelfTest::auto_dot_pro_data() QStringList subdirs = dir.entryList(QDir::AllDirs|QDir::NoDotAndDotDot); foreach (const QString& subdir, subdirs) { - if (subdir == QString::fromLatin1("tmp")) { + if (subdir == QString::fromLatin1("tmp") + || subdir.startsWith(".")) + { continue; } QTest::newRow(qPrintable(subdir)) << subdir; diff --git a/tests/auto/mediaobject/dummy/dummy.pro b/tests/auto/mediaobject/dummy/dummy.pro index 2f27c4a..cf1010e 100644 --- a/tests/auto/mediaobject/dummy/dummy.pro +++ b/tests/auto/mediaobject/dummy/dummy.pro @@ -1,7 +1,7 @@ TEMPLATE = lib isEmpty(QT_MAJOR_VERSION) { - VERSION=4.6.2 + VERSION=4.6.3 } else { VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} } diff --git a/tests/auto/modeltest/dynamictreemodel.h b/tests/auto/modeltest/dynamictreemodel.h index 3f0d90d..9633755 100644 --- a/tests/auto/modeltest/dynamictreemodel.h +++ b/tests/auto/modeltest/dynamictreemodel.h @@ -48,8 +48,6 @@ #include <QtCore/QList> -template<typename T> class QList; - class DynamicTreeModel : public QAbstractItemModel { Q_OBJECT diff --git a/tests/auto/qcontiguouscache/tst_qcontiguouscache.cpp b/tests/auto/qcontiguouscache/tst_qcontiguouscache.cpp index 5a23274..f64e815 100644 --- a/tests/auto/qcontiguouscache/tst_qcontiguouscache.cpp +++ b/tests/auto/qcontiguouscache/tst_qcontiguouscache.cpp @@ -71,6 +71,8 @@ private slots: void contiguousCacheBenchmark(); void setCapacity(); + + void zeroCapacity(); }; QTEST_MAIN(tst_QContiguousCache) @@ -476,4 +478,14 @@ void tst_QContiguousCache::setCapacity() } } +void tst_QContiguousCache::zeroCapacity() +{ + QContiguousCache<int> contiguousCache; + QCOMPARE(contiguousCache.capacity(),0); + contiguousCache.setCapacity(10); + QCOMPARE(contiguousCache.capacity(),10); + contiguousCache.setCapacity(0); + QCOMPARE(contiguousCache.capacity(),0); +} + #include "tst_qcontiguouscache.moc" diff --git a/tests/auto/qdbusconnection/tst_qdbusconnection.cpp b/tests/auto/qdbusconnection/tst_qdbusconnection.cpp index 5e2f3a9..96209b1 100644 --- a/tests/auto/qdbusconnection/tst_qdbusconnection.cpp +++ b/tests/auto/qdbusconnection/tst_qdbusconnection.cpp @@ -80,6 +80,8 @@ class tst_QDBusConnection: public QObject int signalsReceived; public slots: void oneSlot() { ++signalsReceived; } + void exitLoop() { ++signalsReceived; QTestEventLoop::instance().exitLoop(); } + void secondCallWithCallback(); private slots: void noConnection(); @@ -102,6 +104,7 @@ private slots: void multipleInterfacesInQObject(); void slotsWithLessParameters(); + void nestedCallWithCallback(); public: QString serviceName() const { return "com.trolltech.Qt.Autotests.QDBusConnection"; } @@ -618,6 +621,32 @@ void tst_QDBusConnection::slotsWithLessParameters() QCOMPARE(signalsReceived, 1); } +void tst_QDBusConnection::secondCallWithCallback() +{ + qDebug("Hello"); + QDBusConnection con = QDBusConnection::sessionBus(); + QDBusMessage msg = QDBusMessage::createMethodCall(con.baseService(), "/test", QString(), + "test0"); + con.callWithCallback(msg, this, SLOT(exitLoop()), SLOT(secondCallWithCallback())); +} + +void tst_QDBusConnection::nestedCallWithCallback() +{ + TestObject testObject; + QDBusConnection connection = QDBusConnection::sessionBus(); + QVERIFY(connection.registerObject("/test", &testObject, + QDBusConnection::ExportAllContents)); + + QDBusMessage msg = QDBusMessage::createMethodCall(connection.baseService(), "/test", QString(), + "ThisFunctionDoesntExist"); + signalsReceived = 0; + + connection.callWithCallback(msg, this, SLOT(exitLoop()), SLOT(secondCallWithCallback()), 10); + QTestEventLoop::instance().enterLoop(15); + QVERIFY(!QTestEventLoop::instance().timeout()); + QCOMPARE(signalsReceived, 1); +} + QString MyObject::path; QTEST_MAIN(tst_QDBusConnection) diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp index eeccc9a..1bf7850 100644 --- a/tests/auto/qgl/tst_qgl.cpp +++ b/tests/auto/qgl/tst_qgl.cpp @@ -57,6 +57,8 @@ #ifdef QT_BUILD_INTERNAL #include <QtOpenGL/private/qgl_p.h> #include <QtGui/private/qpixmapdata_p.h> +#include <QtGui/private/qimage_p.h> +#include <QtGui/private/qimagepixmapcleanuphooks_p.h> #endif //TESTED_CLASS= @@ -1986,7 +1988,6 @@ void tst_QGL::qglContextDefaultBindTexture() #ifdef QT_BUILD_INTERNAL QGLWidget w; w.makeCurrent(); - QGLContext *ctx = const_cast<QGLContext*>(w.context()); QImage *boundImage = new QImage(256, 256, QImage::Format_RGB32); @@ -1994,29 +1995,36 @@ void tst_QGL::qglContextDefaultBindTexture() QPixmap *boundPixmap = new QPixmap(256, 256); boundPixmap->fill(Qt::red); - // Check that calling QGLContext::bindTexture with default args adds textures to cache int startCacheItemCount = QGLTextureCache::instance()->size(); + GLuint boundImageTextureId = ctx->bindTexture(*boundImage); GLuint boundPixmapTextureId = ctx->bindTexture(*boundPixmap); + + // Make sure the image & pixmap have been added to the cache: QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount+2); + // Make sure the image & pixmap have the is_cached flag set: + QVERIFY(QImagePixmapCleanupHooks::isImageCached(*boundImage)); + QVERIFY(QImagePixmapCleanupHooks::isPixmapCached(*boundPixmap)); + // Make sure the texture IDs returned are valid: QCOMPARE((bool)glIsTexture(boundImageTextureId), GL_TRUE); QCOMPARE((bool)glIsTexture(boundPixmapTextureId), GL_TRUE); - // Make sure the textures are still there after we delete the image/pixmap: + // Make sure the textures are still valid after we delete the image/pixmap: + // Also check that although the textures are left intact, the cache entries are removed: delete boundImage; boundImage = 0; + QCOMPARE((bool)glIsTexture(boundImageTextureId), GL_TRUE); + QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount+1); delete boundPixmap; boundPixmap = 0; - QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount+2); + QCOMPARE((bool)glIsTexture(boundPixmapTextureId), GL_TRUE); + QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount); - // Make sure the textures are deleted from the cache after calling QGLContext::deleteTexture() + // Finally, make sure QGLContext::deleteTexture deletes the texture IDs: ctx->deleteTexture(boundImageTextureId); ctx->deleteTexture(boundPixmapTextureId); - QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount); - - // Finally, make sure QGLContext::deleteTexture also deleted the texture IDs: QCOMPARE((bool)glIsTexture(boundImageTextureId), GL_FALSE); QCOMPARE((bool)glIsTexture(boundPixmapTextureId), GL_FALSE); #endif diff --git a/tests/auto/qhelpcontentmodel/qhelpcontentmodel.pro b/tests/auto/qhelpcontentmodel/qhelpcontentmodel.pro index 79bb44c..889aac9 100644 --- a/tests/auto/qhelpcontentmodel/qhelpcontentmodel.pro +++ b/tests/auto/qhelpcontentmodel/qhelpcontentmodel.pro @@ -1,10 +1,22 @@ -TEMPLATE = subdirs -CONFIG += ordered +load(qttest_p4) +SOURCES += tst_qhelpcontentmodel.cpp -contains(QT_BUILD_PARTS, tools): { - SUBDIRS += ../../../tools/assistant/lib/fulltextsearch \ - ../../../tools/assistant/lib -} +CONFIG += help -SUBDIRS += tst_qhelpcontentmodel.pro +DEFINES += QT_USE_USING_NAMESPACE +!contains(QT_BUILD_PARTS, tools): DEFINES += QT_NO_BUILD_TOOLS +wince*: { + DEFINES += SRCDIR=\\\"./\\\" + QT += network + addFiles.sources = $$PWD/data/*.* + addFiles.path = data + clucene.sources = $$QT_BUILD_TREE/lib/QtCLucene*.dll + + DEPLOYMENT += addFiles + DEPLOYMENT += clucene + + DEPLOYMENT_PLUGIN += qsqlite +} else { + DEFINES += SRCDIR=\\\"$$PWD\\\" +}
\ No newline at end of file diff --git a/tests/auto/qhelpcontentmodel/tst_qhelpcontentmodel.pro b/tests/auto/qhelpcontentmodel/tst_qhelpcontentmodel.pro deleted file mode 100644 index 889aac9..0000000 --- a/tests/auto/qhelpcontentmodel/tst_qhelpcontentmodel.pro +++ /dev/null @@ -1,22 +0,0 @@ -load(qttest_p4) -SOURCES += tst_qhelpcontentmodel.cpp - -CONFIG += help - -DEFINES += QT_USE_USING_NAMESPACE -!contains(QT_BUILD_PARTS, tools): DEFINES += QT_NO_BUILD_TOOLS - -wince*: { - DEFINES += SRCDIR=\\\"./\\\" - QT += network - addFiles.sources = $$PWD/data/*.* - addFiles.path = data - clucene.sources = $$QT_BUILD_TREE/lib/QtCLucene*.dll - - DEPLOYMENT += addFiles - DEPLOYMENT += clucene - - DEPLOYMENT_PLUGIN += qsqlite -} else { - DEFINES += SRCDIR=\\\"$$PWD\\\" -}
\ No newline at end of file diff --git a/tests/auto/qhelpenginecore/qhelpenginecore.pro b/tests/auto/qhelpenginecore/qhelpenginecore.pro index ee9b0c4..27ebd0f 100644 --- a/tests/auto/qhelpenginecore/qhelpenginecore.pro +++ b/tests/auto/qhelpenginecore/qhelpenginecore.pro @@ -1,10 +1,23 @@ -TEMPLATE = subdirs -CONFIG += ordered +load(qttest_p4) +SOURCES += tst_qhelpenginecore.cpp +CONFIG += help +QT += sql -contains(QT_BUILD_PARTS, tools): { - SUBDIRS += ../../../tools/assistant/lib/fulltextsearch \ - ../../../tools/assistant/lib -} -SUBDIRS += tst_qhelpenginecore.pro +DEFINES += QT_USE_USING_NAMESPACE +!contains(QT_BUILD_PARTS, tools): DEFINES += QT_NO_BUILD_TOOLS + +wince*: { + DEFINES += SRCDIR=\\\"./\\\" + QT += network + addFiles.sources = $$PWD/data/*.* + addFiles.path = data + clucene.sources = $$QT_BUILD_TREE/lib/QtCLucene*.dll + DEPLOYMENT += addFiles + DEPLOYMENT += clucene + + DEPLOYMENT_PLUGIN += qsqlite +} else { + DEFINES += SRCDIR=\\\"$$PWD\\\" +} diff --git a/tests/auto/qhelpenginecore/tst_qhelpenginecore.pro b/tests/auto/qhelpenginecore/tst_qhelpenginecore.pro deleted file mode 100644 index 27ebd0f..0000000 --- a/tests/auto/qhelpenginecore/tst_qhelpenginecore.pro +++ /dev/null @@ -1,23 +0,0 @@ -load(qttest_p4) -SOURCES += tst_qhelpenginecore.cpp -CONFIG += help -QT += sql - - -DEFINES += QT_USE_USING_NAMESPACE -!contains(QT_BUILD_PARTS, tools): DEFINES += QT_NO_BUILD_TOOLS - -wince*: { - DEFINES += SRCDIR=\\\"./\\\" - QT += network - addFiles.sources = $$PWD/data/*.* - addFiles.path = data - clucene.sources = $$QT_BUILD_TREE/lib/QtCLucene*.dll - - DEPLOYMENT += addFiles - DEPLOYMENT += clucene - - DEPLOYMENT_PLUGIN += qsqlite -} else { - DEFINES += SRCDIR=\\\"$$PWD\\\" -} diff --git a/tests/auto/qhelpgenerator/qhelpgenerator.pro b/tests/auto/qhelpgenerator/qhelpgenerator.pro index efa1ef5..b4b07dd 100644 --- a/tests/auto/qhelpgenerator/qhelpgenerator.pro +++ b/tests/auto/qhelpgenerator/qhelpgenerator.pro @@ -1,10 +1,9 @@ -TEMPLATE = subdirs -CONFIG += ordered +load(qttest_p4) -contains(QT_BUILD_PARTS, tools): { - SUBDIRS += ../../../tools/assistant/lib/fulltextsearch \ - ../../../tools/assistant/lib -} - -SUBDIRS += tst_qhelpgenerator.pro +SOURCES += tst_qhelpgenerator.cpp +CONFIG += help +QT += sql +DEFINES += SRCDIR=\\\"$$PWD\\\" +DEFINES += QT_USE_USING_NAMESPACE +!contains(QT_BUILD_PARTS, tools): DEFINES += QT_NO_BUILD_TOOLS diff --git a/tests/auto/qhelpgenerator/tst_qhelpgenerator.pro b/tests/auto/qhelpgenerator/tst_qhelpgenerator.pro deleted file mode 100644 index b4b07dd..0000000 --- a/tests/auto/qhelpgenerator/tst_qhelpgenerator.pro +++ /dev/null @@ -1,9 +0,0 @@ -load(qttest_p4) - -SOURCES += tst_qhelpgenerator.cpp -CONFIG += help -QT += sql - -DEFINES += SRCDIR=\\\"$$PWD\\\" -DEFINES += QT_USE_USING_NAMESPACE -!contains(QT_BUILD_PARTS, tools): DEFINES += QT_NO_BUILD_TOOLS diff --git a/tests/auto/qhelpindexmodel/qhelpindexmodel.pro b/tests/auto/qhelpindexmodel/qhelpindexmodel.pro index 1325e09..927c2e1 100644 --- a/tests/auto/qhelpindexmodel/qhelpindexmodel.pro +++ b/tests/auto/qhelpindexmodel/qhelpindexmodel.pro @@ -1,10 +1,9 @@ -TEMPLATE = subdirs -CONFIG += ordered +load(qttest_p4) -contains(QT_BUILD_PARTS, tools): { - SUBDIRS += ../../../tools/assistant/lib/fulltextsearch \ - ../../../tools/assistant/lib -} - -SUBDIRS += tst_qhelpindexmodel.pro +SOURCES += tst_qhelpindexmodel.cpp +CONFIG += help +QT += sql +DEFINES += SRCDIR=\\\"$$PWD\\\" +DEFINES += QT_USE_USING_NAMESPACE +!contains(QT_BUILD_PARTS, tools): DEFINES += QT_NO_BUILD_TOOLS diff --git a/tests/auto/qhelpindexmodel/tst_qhelpindexmodel.pro b/tests/auto/qhelpindexmodel/tst_qhelpindexmodel.pro deleted file mode 100644 index 927c2e1..0000000 --- a/tests/auto/qhelpindexmodel/tst_qhelpindexmodel.pro +++ /dev/null @@ -1,9 +0,0 @@ -load(qttest_p4) - -SOURCES += tst_qhelpindexmodel.cpp -CONFIG += help -QT += sql - -DEFINES += SRCDIR=\\\"$$PWD\\\" -DEFINES += QT_USE_USING_NAMESPACE -!contains(QT_BUILD_PARTS, tools): DEFINES += QT_NO_BUILD_TOOLS diff --git a/tests/auto/qhelpprojectdata/qhelpprojectdata.pro b/tests/auto/qhelpprojectdata/qhelpprojectdata.pro index 9617416..92dc620 100644 --- a/tests/auto/qhelpprojectdata/qhelpprojectdata.pro +++ b/tests/auto/qhelpprojectdata/qhelpprojectdata.pro @@ -1,10 +1,9 @@ -TEMPLATE = subdirs -CONFIG += ordered +load(qttest_p4) -contains(QT_BUILD_PARTS, tools): { - SUBDIRS += ../../../tools/assistant/lib/fulltextsearch \ - ../../../tools/assistant/lib -} +SOURCES += tst_qhelpprojectdata.cpp +CONFIG += help -SUBDIRS += tst_qhelpprojectdata.pro +DEFINES += SRCDIR=\\\"$$PWD\\\" +DEFINES += QT_USE_USING_NAMESPACE +!contains(QT_BUILD_PARTS, tools): DEFINES += QT_NO_BUILD_TOOLS diff --git a/tests/auto/qhelpprojectdata/tst_qhelpprojectdata.pro b/tests/auto/qhelpprojectdata/tst_qhelpprojectdata.pro deleted file mode 100644 index 92dc620..0000000 --- a/tests/auto/qhelpprojectdata/tst_qhelpprojectdata.pro +++ /dev/null @@ -1,9 +0,0 @@ -load(qttest_p4) - -SOURCES += tst_qhelpprojectdata.cpp -CONFIG += help - -DEFINES += SRCDIR=\\\"$$PWD\\\" -DEFINES += QT_USE_USING_NAMESPACE -!contains(QT_BUILD_PARTS, tools): DEFINES += QT_NO_BUILD_TOOLS - diff --git a/tests/auto/qlibrary/lib2/lib2.pro b/tests/auto/qlibrary/lib2/lib2.pro index da30a2d..4654f4d 100644 --- a/tests/auto/qlibrary/lib2/lib2.pro +++ b/tests/auto/qlibrary/lib2/lib2.pro @@ -16,14 +16,19 @@ win32-borland: DEFINES += WIN32_BORLAND !symbian { win32 { - src = $(DESTDIR_TARGET) + # vcproj and Makefile generators refer to target differently + contains(TEMPLATE,vc.*) { + src = $(TargetPath) + } else { + src = $(DESTDIR_TARGET) + } files = mylib.dl2 system.trolltech.test.mylib.dll } else { src = $(DESTDIR)$(TARGET) files = libmylib.so2 system.trolltech.test.mylib.so } for(file, files) { - QMAKE_POST_LINK += $(COPY) $$src ..$$QMAKE_DIR_SEP$$file && + QMAKE_POST_LINK += $$QMAKE_COPY $$src ..$$QMAKE_DIR_SEP$$file && CLEAN_FILES += ../$$file } QMAKE_POST_LINK = $$member(QMAKE_POST_LINK, 0, -2) diff --git a/tests/auto/qlist/tst_qlist.cpp b/tests/auto/qlist/tst_qlist.cpp index 59b2c7b..a590fca 100644 --- a/tests/auto/qlist/tst_qlist.cpp +++ b/tests/auto/qlist/tst_qlist.cpp @@ -60,6 +60,7 @@ private slots: void length() const; void lengthSignature() const; void append() const; + void mid() const; }; void tst_QList::length() const @@ -129,5 +130,14 @@ void tst_QList::append() const } +void tst_QList::mid() const +{ + QList<QString> list; + list << "foo" << "bar" << "baz" << "bak" << "buck" << "hello" << "kitty"; + + QCOMPARE(list.mid(3, 3), + QList<QString>() << "bak" << "buck" << "hello"); +} + QTEST_APPLESS_MAIN(tst_QList) #include "tst_qlist.moc" diff --git a/tests/auto/qlocalsocket/lackey/main.cpp b/tests/auto/qlocalsocket/lackey/main.cpp index 0f1930c..1bba4f8 100644 --- a/tests/auto/qlocalsocket/lackey/main.cpp +++ b/tests/auto/qlocalsocket/lackey/main.cpp @@ -172,8 +172,10 @@ static int _q_ScriptRegisterQObjectMetaType(QScriptEngine *engine, const QScript return qScriptRegisterMetaType<T*>(engine, _q_ScriptValueFromQObject<T>, _q_ScriptValueToQObject<T>, prototype); } +QT_BEGIN_NAMESPACE Q_SCRIPT_DECLARE_QMETAOBJECT(QScriptLocalSocket, QObject*); Q_SCRIPT_DECLARE_QMETAOBJECT(QScriptLocalServer, QObject*); +QT_END_NAMESPACE static void interactive(QScriptEngine &eng) { diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index 05e2e1b..cafeef0 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -263,6 +263,13 @@ private Q_SLOTS: void httpConnectionCount(); + void httpReUsingConnectionSequential_data(); + void httpReUsingConnectionSequential(); + void httpReUsingConnectionFromFinishedSlot_data(); + void httpReUsingConnectionFromFinishedSlot(); + + void httpRecursiveCreation(); + #ifndef QT_NO_OPENSSL void ioPostToHttpsUploadProgress(); void ignoreSslErrorsList_data(); @@ -318,18 +325,20 @@ QT_END_NAMESPACE QFAIL(qPrintable(errorMsg)); \ } while (0); + +// Does not work for POST/PUT! class MiniHttpServer: public QTcpServer { Q_OBJECT - QTcpSocket *client; - public: + QTcpSocket *client; // always the last one that was received QByteArray dataToTransmit; QByteArray receivedData; bool doClose; + bool multiple; int totalConnections; - MiniHttpServer(const QByteArray &data) : client(0), dataToTransmit(data), doClose(true), totalConnections(0) + MiniHttpServer(const QByteArray &data) : client(0), dataToTransmit(data), doClose(true), multiple(false), totalConnections(0) { listen(); connect(this, SIGNAL(newConnection()), this, SLOT(doAccept())); @@ -339,15 +348,21 @@ public slots: void doAccept() { client = nextPendingConnection(); + client->setParent(this); ++totalConnections; - connect(client, SIGNAL(readyRead()), this, SLOT(sendData())); + connect(client, SIGNAL(readyRead()), this, SLOT(readyReadSlot())); } - void sendData() + void readyReadSlot() { receivedData += client->readAll(); - if (receivedData.contains("\r\n\r\n") || - receivedData.contains("\n\n")) { + int doubleEndlPos = receivedData.indexOf("\r\n\r\n"); + + if (doubleEndlPos != -1) { + // multiple requests incoming. remove the bytes of the current one + if (multiple) + receivedData.remove(0, doubleEndlPos+4); + client->write(dataToTransmit); if (doClose) { client->disconnectFromHost(); @@ -2117,6 +2132,11 @@ void tst_QNetworkReply::ioGetFromHttpBrokenServer_data() QTest::newRow("invalid-version+disconnect") << QByteArray("HTTP/123 200 ") << true; QTest::newRow("invalid-version2+disconnect") << QByteArray("HTTP/a.\033 200 ") << true; QTest::newRow("invalid-reply-code+disconnect") << QByteArray("HTTP/1.0 fuu ") << true; + + QTest::newRow("immediate disconnect") << QByteArray("") << true; + QTest::newRow("justHalfStatus+disconnect") << QByteArray("HTTP/1.1") << true; + QTest::newRow("justStatus+disconnect") << QByteArray("HTTP/1.1 200 OK\r\n") << true; + QTest::newRow("justStatusAndHalfHeaders+disconnect") << QByteArray("HTTP/1.1 200 OK\r\nContent-L") << true; } void tst_QNetworkReply::ioGetFromHttpBrokenServer() @@ -3866,6 +3886,174 @@ void tst_QNetworkReply::httpConnectionCount() #endif } +void tst_QNetworkReply::httpReUsingConnectionSequential_data() +{ + QTest::addColumn<bool>("doDeleteLater"); + QTest::newRow("deleteLater") << true; + QTest::newRow("noDeleteLater") << false; +} + +void tst_QNetworkReply::httpReUsingConnectionSequential() +{ + QFETCH(bool, doDeleteLater); + + QByteArray response("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"); + MiniHttpServer server(response); + server.multiple = true; + server.doClose = false; + + QUrl url; + url.setScheme("http"); + url.setPort(server.serverPort()); + url.setHost("127.0.0.1"); + // first request + QNetworkReply* reply1 = manager.get(QNetworkRequest(url)); + connect(reply1, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); + QTestEventLoop::instance().enterLoop(2); + QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(!reply1->error()); + int reply1port = server.client->peerPort(); + + if (doDeleteLater) + reply1->deleteLater(); + + // finished received, send the next one + QNetworkReply*reply2 = manager.get(QNetworkRequest(url)); + connect(reply2, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); + QTestEventLoop::instance().enterLoop(2); + QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(!reply2->error()); + int reply2port = server.client->peerPort(); // should still be the same object + + QVERIFY(reply1port > 0); + QCOMPARE(server.totalConnections, 1); + QCOMPARE(reply2port, reply1port); + + if (!doDeleteLater) + reply1->deleteLater(); // only do it if it was not done earlier + reply2->deleteLater(); +} + +class HttpReUsingConnectionFromFinishedSlot : public QObject { + Q_OBJECT; +public: + QNetworkReply* reply1; + QNetworkReply* reply2; + QUrl url; + QNetworkAccessManager manager; +public slots: + void finishedSlot() { + QVERIFY(!reply1->error()); + + QFETCH(bool, doDeleteLater); + if (doDeleteLater) { + reply1->deleteLater(); + reply1 = 0; + } + + // kick off 2nd request and exit the loop when it is done + reply2 = manager.get(QNetworkRequest(url)); + reply2->setParent(this); + connect(reply2, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); + } +}; + +void tst_QNetworkReply::httpReUsingConnectionFromFinishedSlot_data() +{ + httpReUsingConnectionSequential_data(); +} + +void tst_QNetworkReply::httpReUsingConnectionFromFinishedSlot() +{ + QByteArray response("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"); + MiniHttpServer server(response); + server.multiple = true; + server.doClose = false; + + HttpReUsingConnectionFromFinishedSlot helper; + helper.reply1 = 0; + helper.reply2 = 0; + helper.url.setScheme("http"); + helper.url.setPort(server.serverPort()); + helper.url.setHost("127.0.0.1"); + + // first request + helper.reply1 = helper.manager.get(QNetworkRequest(helper.url)); + helper.reply1->setParent(&helper); + connect(helper.reply1, SIGNAL(finished()), &helper, SLOT(finishedSlot())); + QTestEventLoop::instance().enterLoop(4); + QVERIFY(!QTestEventLoop::instance().timeout()); + + QVERIFY(helper.reply2); + QVERIFY(!helper.reply2->error()); + + QCOMPARE(server.totalConnections, 1); +} + +class HttpRecursiveCreationHelper : public QObject { + Q_OBJECT +public: + + HttpRecursiveCreationHelper(): + QObject(0), + requestsStartedCount_finished(0), + requestsStartedCount_readyRead(0), + requestsFinishedCount(0) + { + } + QNetworkAccessManager manager; + int requestsStartedCount_finished; + int requestsStartedCount_readyRead; + int requestsFinishedCount; +public slots: + void finishedSlot() { + requestsFinishedCount++; + + QNetworkReply *reply = qobject_cast<QNetworkReply*>(sender()); + QVERIFY(!reply->error()); + QVERIFY(reply->bytesAvailable() == 27906); + + if (requestsFinishedCount == 60) { + QTestEventLoop::instance().exitLoop(); + return; + } + + if (requestsStartedCount_finished < 30) { + startOne(); + requestsStartedCount_finished++; + } + + reply->deleteLater(); + } + void readyReadSlot() { + QNetworkReply *reply = qobject_cast<QNetworkReply*>(sender()); + QVERIFY(!reply->error()); + + if (requestsStartedCount_readyRead < 30 && reply->bytesAvailable() > 27906/2) { + startOne(); + requestsStartedCount_readyRead++; + } + } + void startOne() { + QUrl url = "http://" + QtNetworkSettings::serverName() + "/gif/fluke.gif"; + QNetworkRequest request(url); + QNetworkReply *reply = manager.get(request); + reply->setParent(this); + connect(reply, SIGNAL(finished()), this, SLOT(finishedSlot())); + connect(reply, SIGNAL(readyRead()), this, SLOT(readyReadSlot())); + } +}; + +void tst_QNetworkReply::httpRecursiveCreation() +{ + // this test checks if creation of new requests to the same host properly works + // from readyRead() and finished() signals + HttpRecursiveCreationHelper helper; + helper.startOne(); + QTestEventLoop::instance().enterLoop(30); + QVERIFY(!QTestEventLoop::instance().timeout()); +} + #ifndef QT_NO_OPENSSL void tst_QNetworkReply::ignoreSslErrorsList_data() { diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp index 104728d..beb83a1 100644 --- a/tests/auto/qpainter/tst_qpainter.cpp +++ b/tests/auto/qpainter/tst_qpainter.cpp @@ -1580,10 +1580,8 @@ void tst_QPainter::drawClippedEllipse_data() void tst_QPainter::drawClippedEllipse() { QFETCH(QRect, rect); -#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN) if (sizeof(qreal) != sizeof(double)) QSKIP("Test only works for qreal==double", SkipAll); -#endif QImage image(rect.width() + 1, rect.height() + 1, QImage::Format_ARGB32_Premultiplied); QRect expected = QRect(rect.x(), rect.y(), rect.width()+1, rect.height()+1) diff --git a/tests/auto/qpixmapcache/tst_qpixmapcache.cpp b/tests/auto/qpixmapcache/tst_qpixmapcache.cpp index a0f4339..f8951f5 100644 --- a/tests/auto/qpixmapcache/tst_qpixmapcache.cpp +++ b/tests/auto/qpixmapcache/tst_qpixmapcache.cpp @@ -483,7 +483,9 @@ void tst_QPixmapCache::pixmapKey() QVERIFY(!getPrivate(key8)); } +QT_BEGIN_NAMESPACE extern int q_QPixmapCache_keyHashSize(); +QT_END_NAMESPACE void tst_QPixmapCache::noLeak() { diff --git a/tests/auto/qpluginloader/theplugin/plugininterface.h b/tests/auto/qpluginloader/theplugin/plugininterface.h index 0b093db..9b69429 100644 --- a/tests/auto/qpluginloader/theplugin/plugininterface.h +++ b/tests/auto/qpluginloader/theplugin/plugininterface.h @@ -45,7 +45,10 @@ struct PluginInterface { virtual ~PluginInterface() {} virtual QString pluginName() const = 0; }; + +QT_BEGIN_NAMESPACE Q_DECLARE_INTERFACE(PluginInterface, "com.trolltect.autotests.plugininterface/1.0") +QT_END_NAMESPACE #endif // PLUGININTERFACE_H diff --git a/tests/auto/qprocess/tst_qprocess.cpp b/tests/auto/qprocess/tst_qprocess.cpp index ee3bb40..8dae9a0 100644 --- a/tests/auto/qprocess/tst_qprocess.cpp +++ b/tests/auto/qprocess/tst_qprocess.cpp @@ -1652,7 +1652,7 @@ void tst_QProcess::failToStart() QSignalSpy finishedSpy(&process, SIGNAL(finished(int))); QSignalSpy finishedSpy2(&process, SIGNAL(finished(int, QProcess::ExitStatus))); -// Mac OS X and HP-UX have a really low defualt process limit (~100), so spawning +// Mac OS X and HP-UX have a really low default process limit (~100), so spawning // to many processes here will cause test failures later on. #if defined Q_OS_HPUX const int attempts = 15; diff --git a/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp b/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp index 41df98c..10ff488 100644 --- a/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp +++ b/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp @@ -688,7 +688,7 @@ tst_Suite::tst_Suite() addExpectedFailure("ecma/TypeConversion/9.3.1-3.js", "- -\"0x80000000\"", willFixInNextReleaseMessage); #endif -#ifdef Q_OS_WIN +#ifdef Q_CC_MSVC addExpectedFailure("ecma_3/Expressions/11.7.3-01.js", "11.7.3 - >>> should evaluate operands in order: order", "QTBUG-8056"); addExpectedFailure("ecma_3/Operators/order-01.js", "operator evaluation order: 11.7.3 >>>", "QTBUG-8056"); addExpectedFailure("ecma_3/Operators/order-01.js", "operator evaluation order: 11.13.2 >>>=", "QTBUG-8056"); diff --git a/tests/auto/qscriptstring/tst_qscriptstring.cpp b/tests/auto/qscriptstring/tst_qscriptstring.cpp index f336dbe..808b643 100644 --- a/tests/auto/qscriptstring/tst_qscriptstring.cpp +++ b/tests/auto/qscriptstring/tst_qscriptstring.cpp @@ -87,6 +87,8 @@ void tst_QScriptString::test() QScriptString str2 = str; QVERIFY(!str2.isValid()); + + QCOMPARE(str.toArrayIndex(), quint32(0xffffffff)); } for (int x = 0; x < 2; ++x) { @@ -172,6 +174,7 @@ void tst_QScriptString::toArrayIndex_data() QTest::newRow("0a") << QString::fromLatin1("0a") << false << quint32(0xffffffff); QTest::newRow("0x1") << QString::fromLatin1("0x1") << false << quint32(0xffffffff); QTest::newRow("01") << QString::fromLatin1("01") << false << quint32(0xffffffff); + QTest::newRow("101a") << QString::fromLatin1("101a") << false << quint32(0xffffffff); QTest::newRow("4294967294") << QString::fromLatin1("4294967294") << true << quint32(0xfffffffe); QTest::newRow("4294967295") << QString::fromLatin1("4294967295") << false << quint32(0xffffffff); } diff --git a/tests/auto/qsharedmemory/qsharedmemory.pro b/tests/auto/qsharedmemory/qsharedmemory.pro deleted file mode 100644 index 0aad554..0000000 --- a/tests/auto/qsharedmemory/qsharedmemory.pro +++ /dev/null @@ -1,4 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS = lackey test qsystemlock - - diff --git a/tests/auto/qstring/tst_qstring.cpp b/tests/auto/qstring/tst_qstring.cpp index c9b3436..9c9524a 100644 --- a/tests/auto/qstring/tst_qstring.cpp +++ b/tests/auto/qstring/tst_qstring.cpp @@ -120,6 +120,7 @@ private slots: void operator_eqeq_nullstring(); void operator_smaller(); void insert(); + void simplified_data(); void simplified(); void trimmed(); void toLower(); @@ -1592,16 +1593,51 @@ void tst_QString::trimmed() QCOMPARE(a.trimmed(),(QString)"a"); } +void tst_QString::simplified_data() +{ + QTest::addColumn<QString>("full" ); + QTest::addColumn<QString>("simple" ); + + QTest::newRow("null") << QString() << QString(); + QTest::newRow("empty") << "" << ""; + QTest::newRow("one char") << "a" << "a"; + QTest::newRow("one word") << "foo" << "foo"; + QTest::newRow("chars trivial") << "a b" << "a b"; + QTest::newRow("words trivial") << "foo bar" << "foo bar"; + QTest::newRow("allspace") << " \t\v " << ""; + QTest::newRow("char trailing") << "a " << "a"; + QTest::newRow("char trailing tab") << "a\t" << "a"; + QTest::newRow("char multitrailing") << "a " << "a"; + QTest::newRow("char multitrailing tab") << "a \t" << "a"; + QTest::newRow("char leading") << " a" << "a"; + QTest::newRow("char leading tab") << "\ta" << "a"; + QTest::newRow("char multileading") << " a" << "a"; + QTest::newRow("char multileading tab") << "\t a" << "a"; + QTest::newRow("chars apart") << "a b" << "a b"; + QTest::newRow("words apart") << "foo bar" << "foo bar"; + QTest::newRow("enclosed word") << " foo \t " << "foo"; + QTest::newRow("enclosed chars apart") << " a b " << "a b"; + QTest::newRow("enclosed words apart") << " foo bar " << "foo bar"; + QTest::newRow("chars apart posttab") << "a \tb" << "a b"; + QTest::newRow("chars apart pretab") << "a\t b" << "a b"; + QTest::newRow("many words") << " just some random\ttext here" << "just some random text here"; +} + void tst_QString::simplified() { - QString j; - j.simplified(); + QFETCH(QString, full); + QFETCH(QString, simple); - QString a; - a = "a "; - QCOMPARE(a.simplified(),(QString)"a"); - a=" a b "; - QCOMPARE(a.simplified(),(QString)"a b"); + QString result = full.simplified(); + if (simple.isNull()) { + QVERIFY2(result.isNull(), qPrintable("'" + full + "' did not yield null: " + result)); + } else if (simple.isEmpty()) { + QVERIFY2(result.isEmpty() && !result.isNull(), qPrintable("'" + full + "' did not yield empty: " + result)); + } else { + QCOMPARE(result, simple); + if (full == simple) + QVERIFY(result.isSharedWith(full)); + } } void tst_QString::insert() diff --git a/tests/auto/qsystemsemaphore/files.qrc b/tests/auto/qsystemsemaphore/files.qrc deleted file mode 100644 index 7b344ba..0000000 --- a/tests/auto/qsystemsemaphore/files.qrc +++ /dev/null @@ -1,7 +0,0 @@ -<!DOCTYPE RCC><RCC version="1.0"> -<qresource> - <file alias="systemsemaphore_acquire.js">../qsharedmemory/lackey/scripts/systemsemaphore_acquire.js</file> - <file alias="systemsemaphore_release.js">../qsharedmemory/lackey/scripts/systemsemaphore_release.js</file> - <file alias="systemsemaphore_acquirerelease.js">../qsharedmemory/lackey/scripts/systemsemaphore_acquirerelease.js</file> -</qresource> -</RCC> diff --git a/tests/auto/qsystemsemaphore/qsystemsemaphore.pro b/tests/auto/qsystemsemaphore/qsystemsemaphore.pro deleted file mode 100644 index a3f4a34..0000000 --- a/tests/auto/qsystemsemaphore/qsystemsemaphore.pro +++ /dev/null @@ -1,4 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS = ../qsharedmemory/lackey test - - diff --git a/tests/auto/qtextcodec/tst_qtextcodec.cpp b/tests/auto/qtextcodec/tst_qtextcodec.cpp index 65b0448..aa97e87 100644 --- a/tests/auto/qtextcodec/tst_qtextcodec.cpp +++ b/tests/auto/qtextcodec/tst_qtextcodec.cpp @@ -1795,12 +1795,12 @@ void tst_QTextCodec::utfHeaders() QLatin1String ignoreReverseTestOn = (QSysInfo::ByteOrder == QSysInfo::BigEndian) ? QLatin1String(" le") : QLatin1String(" be"); QString rowName(QTest::currentDataTag()); - for (int i = 0; i < encoded.length(); ++i) - qDebug() << hex << " " << (uint)(uchar)encoded.at(i); + /*for (int i = 0; i < encoded.length(); ++i) + qDebug() << hex << " " << (uint)(uchar)encoded.at(i);*/ if (toUnicode) { QString result = codec->toUnicode(encoded.constData(), encoded.length(), &state); - for (int i = 0; i < result.length(); ++i) - qDebug() << hex << " " << (uint)result.at(i).unicode(); + /*for (int i = 0; i < result.length(); ++i) + qDebug() << hex << " " << (uint)result.at(i).unicode();*/ QCOMPARE(result.length(), unicode.length()); QCOMPARE(result, unicode); @@ -1939,7 +1939,7 @@ static int loadAndConvertMIB(int mib) void tst_QTextCodec::threadSafety() { QThreadPool::globalInstance()->setMaxThreadCount(12); - + QList<QByteArray> codecList = QTextCodec::availableCodecs(); QFuture<QByteArray> res = QtConcurrent::mapped(codecList, loadAndConvert); diff --git a/tests/auto/qtextstream/tst_qtextstream.cpp b/tests/auto/qtextstream/tst_qtextstream.cpp index 8ff6bee..9146be2 100644 --- a/tests/auto/qtextstream/tst_qtextstream.cpp +++ b/tests/auto/qtextstream/tst_qtextstream.cpp @@ -4308,10 +4308,15 @@ void tst_QTextStream::int_write_with_locale() // ------------------------------------------------------------------------------ // like QTEST_APPLESS_MAIN, but initialising the locale on Unix +#if defined (Q_OS_UNIX) && !defined (Q_OS_SYMBIAN) +QT_BEGIN_NAMESPACE +extern bool qt_locale_initialized; +QT_END_NAMESPACE +#endif + int main(int argc, char *argv[]) { #if defined (Q_OS_UNIX) && !defined (Q_OS_SYMBIAN) - extern bool qt_locale_initialized; ::setlocale(LC_ALL, ""); qt_locale_initialized = true; #endif diff --git a/tests/auto/qsharedmemory/lackey/lackey.pro b/tests/auto/qtipc/lackey/lackey.pro index d25a50a..3912312 100644 --- a/tests/auto/qsharedmemory/lackey/lackey.pro +++ b/tests/auto/qtipc/lackey/lackey.pro @@ -1,4 +1,4 @@ -include(../src/src.pri) +include(../qsharedmemory/src/src.pri) QT = core script diff --git a/tests/auto/qsharedmemory/lackey/main.cpp b/tests/auto/qtipc/lackey/main.cpp index 5a5bf5e..fef8d22 100644 --- a/tests/auto/qsharedmemory/lackey/main.cpp +++ b/tests/auto/qtipc/lackey/main.cpp @@ -242,9 +242,11 @@ private: QSharedMemory sm; }; +QT_BEGIN_NAMESPACE Q_SCRIPT_DECLARE_QMETAOBJECT(ScriptSharedMemory, QObject*); Q_SCRIPT_DECLARE_QMETAOBJECT(ScriptSystemLock, QObject*); Q_SCRIPT_DECLARE_QMETAOBJECT(ScriptSystemSemaphore, QObject*); +QT_END_NAMESPACE static void interactive(QScriptEngine &eng) { diff --git a/tests/auto/qsharedmemory/lackey/scripts/consumer.js b/tests/auto/qtipc/lackey/scripts/consumer.js index 4d12dca..4d12dca 100644 --- a/tests/auto/qsharedmemory/lackey/scripts/consumer.js +++ b/tests/auto/qtipc/lackey/scripts/consumer.js diff --git a/tests/auto/qsharedmemory/lackey/scripts/producer.js b/tests/auto/qtipc/lackey/scripts/producer.js index e02cd8b..e02cd8b 100644 --- a/tests/auto/qsharedmemory/lackey/scripts/producer.js +++ b/tests/auto/qtipc/lackey/scripts/producer.js diff --git a/tests/auto/qsharedmemory/lackey/scripts/readonly_segfault.js b/tests/auto/qtipc/lackey/scripts/readonly_segfault.js index 3eaf789..3eaf789 100644 --- a/tests/auto/qsharedmemory/lackey/scripts/readonly_segfault.js +++ b/tests/auto/qtipc/lackey/scripts/readonly_segfault.js diff --git a/tests/auto/qsharedmemory/lackey/scripts/systemlock_read.js b/tests/auto/qtipc/lackey/scripts/systemlock_read.js index 1048bc7..1048bc7 100644 --- a/tests/auto/qsharedmemory/lackey/scripts/systemlock_read.js +++ b/tests/auto/qtipc/lackey/scripts/systemlock_read.js diff --git a/tests/auto/qsharedmemory/lackey/scripts/systemlock_readwrite.js b/tests/auto/qtipc/lackey/scripts/systemlock_readwrite.js index fc6367f..fc6367f 100644 --- a/tests/auto/qsharedmemory/lackey/scripts/systemlock_readwrite.js +++ b/tests/auto/qtipc/lackey/scripts/systemlock_readwrite.js diff --git a/tests/auto/qsharedmemory/lackey/scripts/systemsemaphore_acquire.js b/tests/auto/qtipc/lackey/scripts/systemsemaphore_acquire.js index 5cff429..5cff429 100644 --- a/tests/auto/qsharedmemory/lackey/scripts/systemsemaphore_acquire.js +++ b/tests/auto/qtipc/lackey/scripts/systemsemaphore_acquire.js diff --git a/tests/auto/qsharedmemory/lackey/scripts/systemsemaphore_acquirerelease.js b/tests/auto/qtipc/lackey/scripts/systemsemaphore_acquirerelease.js index cedde3f..cedde3f 100644 --- a/tests/auto/qsharedmemory/lackey/scripts/systemsemaphore_acquirerelease.js +++ b/tests/auto/qtipc/lackey/scripts/systemsemaphore_acquirerelease.js diff --git a/tests/auto/qsharedmemory/lackey/scripts/systemsemaphore_release.js b/tests/auto/qtipc/lackey/scripts/systemsemaphore_release.js index c805e0f..c805e0f 100644 --- a/tests/auto/qsharedmemory/lackey/scripts/systemsemaphore_release.js +++ b/tests/auto/qtipc/lackey/scripts/systemsemaphore_release.js diff --git a/tests/auto/qsharedmemory/.gitignore b/tests/auto/qtipc/qsharedmemory/.gitignore index 03ddcf2..03ddcf2 100644 --- a/tests/auto/qsharedmemory/.gitignore +++ b/tests/auto/qtipc/qsharedmemory/.gitignore diff --git a/tests/auto/qtipc/qsharedmemory/qsharedmemory.pro b/tests/auto/qtipc/qsharedmemory/qsharedmemory.pro new file mode 100644 index 0000000..9fef8e4 --- /dev/null +++ b/tests/auto/qtipc/qsharedmemory/qsharedmemory.pro @@ -0,0 +1,4 @@ +TEMPLATE = subdirs +SUBDIRS = test qsystemlock + + diff --git a/tests/auto/qsharedmemory/qsystemlock/qsystemlock.pro b/tests/auto/qtipc/qsharedmemory/qsystemlock/qsystemlock.pro index e232443..e232443 100644 --- a/tests/auto/qsharedmemory/qsystemlock/qsystemlock.pro +++ b/tests/auto/qtipc/qsharedmemory/qsystemlock/qsystemlock.pro diff --git a/tests/auto/qsharedmemory/qsystemlock/tst_qsystemlock.cpp b/tests/auto/qtipc/qsharedmemory/qsystemlock/tst_qsystemlock.cpp index ea906b7..ea906b7 100644 --- a/tests/auto/qsharedmemory/qsystemlock/tst_qsystemlock.cpp +++ b/tests/auto/qtipc/qsharedmemory/qsystemlock/tst_qsystemlock.cpp diff --git a/tests/auto/qsharedmemory/src/qsystemlock.cpp b/tests/auto/qtipc/qsharedmemory/src/qsystemlock.cpp index 4ead748..4ead748 100644 --- a/tests/auto/qsharedmemory/src/qsystemlock.cpp +++ b/tests/auto/qtipc/qsharedmemory/src/qsystemlock.cpp diff --git a/tests/auto/qsharedmemory/src/qsystemlock.h b/tests/auto/qtipc/qsharedmemory/src/qsystemlock.h index 7cd6b89..7cd6b89 100644 --- a/tests/auto/qsharedmemory/src/qsystemlock.h +++ b/tests/auto/qtipc/qsharedmemory/src/qsystemlock.h diff --git a/tests/auto/qsharedmemory/src/qsystemlock_p.h b/tests/auto/qtipc/qsharedmemory/src/qsystemlock_p.h index 7995a91..7995a91 100644 --- a/tests/auto/qsharedmemory/src/qsystemlock_p.h +++ b/tests/auto/qtipc/qsharedmemory/src/qsystemlock_p.h diff --git a/tests/auto/qsharedmemory/src/qsystemlock_unix.cpp b/tests/auto/qtipc/qsharedmemory/src/qsystemlock_unix.cpp index 525aa78..525aa78 100644 --- a/tests/auto/qsharedmemory/src/qsystemlock_unix.cpp +++ b/tests/auto/qtipc/qsharedmemory/src/qsystemlock_unix.cpp diff --git a/tests/auto/qsharedmemory/src/qsystemlock_win.cpp b/tests/auto/qtipc/qsharedmemory/src/qsystemlock_win.cpp index ac97100..ac97100 100644 --- a/tests/auto/qsharedmemory/src/qsystemlock_win.cpp +++ b/tests/auto/qtipc/qsharedmemory/src/qsystemlock_win.cpp diff --git a/tests/auto/qsharedmemory/src/src.pri b/tests/auto/qtipc/qsharedmemory/src/src.pri index 5bc9de6..5bc9de6 100644 --- a/tests/auto/qsharedmemory/src/src.pri +++ b/tests/auto/qtipc/qsharedmemory/src/src.pri diff --git a/tests/auto/qsharedmemory/test/test.pro b/tests/auto/qtipc/qsharedmemory/test/test.pro index c9f4fec..40ba8b9 100644 --- a/tests/auto/qsharedmemory/test/test.pro +++ b/tests/auto/qtipc/qsharedmemory/test/test.pro @@ -20,14 +20,14 @@ TARGET = ../tst_qsharedmemory wince*:{ requires(contains(QT_CONFIG,script)) QT += gui script -addFiles.sources = ../lackey/lackey.exe ../lackey/scripts +addFiles.sources = ../../lackey/lackey.exe ../../lackey/scripts addFiles.path = lackey DEPLOYMENT += addFiles DEFINES += SRCDIR=\\\"\\\" }else:symbian*{ requires(contains(QT_CONFIG,script)) QT += gui script -addFiles.sources = ../lackey/scripts +addFiles.sources = ../../lackey/scripts addFiles.path = /data/qsharedmemorytemp/lackey addBin.sources = lackey.exe addBin.path = /sys/bin diff --git a/tests/auto/qsharedmemory/tst_qsharedmemory.cpp b/tests/auto/qtipc/qsharedmemory/tst_qsharedmemory.cpp index cea75bf..83f65b0 100644 --- a/tests/auto/qsharedmemory/tst_qsharedmemory.cpp +++ b/tests/auto/qtipc/qsharedmemory/tst_qsharedmemory.cpp @@ -51,7 +51,13 @@ #ifdef Q_OS_SYMBIAN #define SRCDIR "c:/data/qsharedmemorytemp/" +#define LACKEYDIR SRCDIR "lackey" +#elif Q_OS_WINCE +#define LACKEYDIR SRCDIR "lackey" +#else +#define LACKEYDIR SRCDIR "../lackey" #endif + Q_DECLARE_METATYPE(QSharedMemory::SharedMemoryError) Q_DECLARE_METATYPE(QSharedMemory::AccessMode) @@ -411,10 +417,10 @@ void tst_QSharedMemory::readOnly() #if defined (Q_OS_SYMBIAN) QSKIP("Readonly shared memory is not supported in symbian", SkipAll); #endif - QString program = "./lackey/lackey"; + QString program = LACKEYDIR "/lackey"; QStringList arguments; rememberKey("readonly_segfault"); - arguments << SRCDIR "lackey/scripts/readonly_segfault.js"; + arguments << LACKEYDIR "/scripts/readonly_segfault.js"; // ### on windows disable the popup somehow QProcess p; @@ -727,28 +733,20 @@ void tst_QSharedMemory::simpleProcessProducerConsumer() rememberKey("market"); -#ifndef Q_OS_WINCE - QStringList arguments = QStringList() << SRCDIR "lackey/scripts/producer.js"; -#else - QStringList arguments = QStringList() << QFileInfo(SRCDIR "lackey/scripts/producer.js").absoluteFilePath(); -#endif + QStringList arguments = QStringList() << LACKEYDIR "/scripts/producer.js"; QProcess producer; producer.setProcessChannelMode(QProcess::ForwardedChannels); - producer.start( "./lackey/lackey", arguments); + producer.start( LACKEYDIR "/lackey", arguments); producer.waitForStarted(); QVERIFY(producer.error() != QProcess::FailedToStart); QList<QProcess*> consumers; unsigned int failedProcesses = 0; for (int i = 0; i < processes; ++i) { -#ifndef Q_OS_WINCE - QStringList arguments = QStringList() << SRCDIR "lackey/scripts/consumer.js"; -#else - QStringList arguments = QStringList() << QFileInfo(SRCDIR "lackey/scripts/consumer.js").absoluteFilePath(); -#endif + QStringList arguments = QStringList() << LACKEYDIR "/scripts/consumer.js"; QProcess *p = new QProcess; p->setProcessChannelMode(QProcess::ForwardedChannels); - p->start("./lackey/lackey", arguments); + p->start(LACKEYDIR "/lackey", arguments); if (p->waitForStarted(2000)) consumers.append(p); diff --git a/tests/auto/qsystemsemaphore/.gitignore b/tests/auto/qtipc/qsystemsemaphore/.gitignore index 2b60bfb..2b60bfb 100644 --- a/tests/auto/qsystemsemaphore/.gitignore +++ b/tests/auto/qtipc/qsystemsemaphore/.gitignore diff --git a/tests/auto/qtipc/qsystemsemaphore/files.qrc b/tests/auto/qtipc/qsystemsemaphore/files.qrc new file mode 100644 index 0000000..6296690 --- /dev/null +++ b/tests/auto/qtipc/qsystemsemaphore/files.qrc @@ -0,0 +1,7 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> + <file alias="systemsemaphore_acquire.js">../lackey/scripts/systemsemaphore_acquire.js</file> + <file alias="systemsemaphore_release.js">../lackey/scripts/systemsemaphore_release.js</file> + <file alias="systemsemaphore_acquirerelease.js">../lackey/scripts/systemsemaphore_acquirerelease.js</file> +</qresource> +</RCC> diff --git a/tests/auto/qsystemsemaphore/test/test.pro b/tests/auto/qtipc/qsystemsemaphore/qsystemsemaphore.pro index ed7898c..1f9205e 100644 --- a/tests/auto/qsystemsemaphore/test/test.pro +++ b/tests/auto/qtipc/qsystemsemaphore/qsystemsemaphore.pro @@ -1,29 +1,24 @@ CONFIG += qttest_p4 #QT = core -include(../../qsharedmemory/src/src.pri) +include(../qsharedmemory/src/src.pri) win32: CONFIG += console DEFINES += QSHAREDMEMORY_DEBUG DEFINES += QSYSTEMSEMAPHORE_DEBUG -SOURCES += ../tst_qsystemsemaphore.cpp +SOURCES += tst_qsystemsemaphore.cpp TARGET = tst_qsystemsemaphore -DESTDIR = ../ -win32 { - CONFIG(debug, debug|release): DESTDIR = ../debug - else: DESTDIR = ../release -} -RESOURCES += ../files.qrc +RESOURCES += files.qrc wince*: { requires(contains(QT_CONFIG,script)) # this test calls lackey, which then again depends on QtScript. # let's add it here so that it gets deployed easily QT += script -lackey.sources = ../../qsharedmemory/lackey/lackey.exe -lackey.path = ../qsharedmemory/lackey +lackey.sources = ../lackey/lackey.exe +lackey.path = ../lackey DEPLOYMENT += lackey } @@ -34,7 +29,8 @@ requires(contains(QT_CONFIG,script)) # let's add it here so that it gets deployed easily QT += script -lackey.sources = ../../qsharedmemory/lackey/lackey.exe +lackey.sources = ../lackey/lackey.exe lackey.path = /sys/bin DEPLOYMENT += lackey } + diff --git a/tests/auto/qsystemsemaphore/tst_qsystemsemaphore.cpp b/tests/auto/qtipc/qsystemsemaphore/tst_qsystemsemaphore.cpp index bf4efdc..eb82fd4 100644 --- a/tests/auto/qsystemsemaphore/tst_qsystemsemaphore.cpp +++ b/tests/auto/qtipc/qsystemsemaphore/tst_qsystemsemaphore.cpp @@ -46,7 +46,7 @@ //TESTED_FILES= #define EXISTING_SHARE "existing" -#define LACKYLOC "../qsharedmemory/lackey" +#define LACKYLOC "../lackey" #define LACKYWAITTIME 10000 class tst_QSystemSemaphore : public QObject diff --git a/tests/auto/qtipc/qtipc.pro b/tests/auto/qtipc/qtipc.pro new file mode 100644 index 0000000..60037d2 --- /dev/null +++ b/tests/auto/qtipc/qtipc.pro @@ -0,0 +1,6 @@ +TEMPLATE=subdirs +SUBDIRS=\ + lackey \ + qsharedmemory \ + qsystemsemaphore \ + diff --git a/tests/auto/qtouchevent/tst_qtouchevent.cpp b/tests/auto/qtouchevent/tst_qtouchevent.cpp index 639f8e4..bb80fde 100644 --- a/tests/auto/qtouchevent/tst_qtouchevent.cpp +++ b/tests/auto/qtouchevent/tst_qtouchevent.cpp @@ -193,6 +193,7 @@ private slots: void multiPointRawEventTranslationOnTouchPad(); void deleteInEventHandler(); void deleteInRawEventTranslation(); + void crashInQGraphicsSceneAfterNotHandlingTouchBegin(); }; void tst_QTouchEvent::touchDisabledByDefault() @@ -1303,6 +1304,36 @@ void tst_QTouchEvent::deleteInRawEventTranslation() qt_translateRawTouchEvent(&touchWidget, QTouchEvent::TouchScreen, rawTouchPoints); } +void tst_QTouchEvent::crashInQGraphicsSceneAfterNotHandlingTouchBegin() +{ + QGraphicsRectItem *rect = new QGraphicsRectItem(0, 0, 100, 100); + rect->setAcceptTouchEvents(true); + + QGraphicsRectItem *mainRect = new QGraphicsRectItem(0, 0, 100, 100, rect); + mainRect->setBrush(Qt::lightGray); + + QGraphicsRectItem *button = new QGraphicsRectItem(-20, -20, 40, 40, mainRect); + button->setPos(50, 50); + button->setBrush(Qt::darkGreen); + + QGraphicsView view; + QGraphicsScene scene; + scene.addItem(rect); + scene.setSceneRect(0,0,100,100); + view.setScene(&scene); + + view.show(); + QTest::qWaitForWindowShown(&view); + + QPoint centerPos = view.mapFromScene(rect->boundingRect().center()); + // Touch the button + QTest::touchEvent(view.viewport()).press(0, centerPos); + QTest::touchEvent(view.viewport()).release(0, centerPos); + // Touch outside of the button + QTest::touchEvent(view.viewport()).press(0, view.mapFromScene(QPoint(10, 10))); + QTest::touchEvent(view.viewport()).release(0, view.mapFromScene(QPoint(10, 10))); +} + QTEST_MAIN(tst_QTouchEvent) #include "tst_qtouchevent.moc" diff --git a/tests/auto/qurl/tst_qurl.cpp b/tests/auto/qurl/tst_qurl.cpp index f108f4c..72ce393 100644 --- a/tests/auto/qurl/tst_qurl.cpp +++ b/tests/auto/qurl/tst_qurl.cpp @@ -1832,7 +1832,7 @@ void tst_QUrl::compat_constructor_01_data() QTest::addColumn<QString>("res"); //next we fill it with data - QTest::newRow( "data0" ) << QString("Makefile") << QString("Makefile"); // nolonger add file by defualt + QTest::newRow( "data0" ) << QString("Makefile") << QString("Makefile"); // nolonger add file by default QTest::newRow( "data1" ) << QString("Makefile") << QString("Makefile"); QTest::newRow( "data2" ) << QString("ftp://ftp.qt.nokia.com/qt/INSTALL") << QString("ftp://ftp.qt.nokia.com/qt/INSTALL"); QTest::newRow( "data3" ) << QString("ftp://ftp.qt.nokia.com/qt/INSTALL") << QString("ftp://ftp.qt.nokia.com/qt/INSTALL"); diff --git a/tests/auto/qvariant/tst_qvariant.cpp b/tests/auto/qvariant/tst_qvariant.cpp index 21b2fe3..a316dda 100644 --- a/tests/auto/qvariant/tst_qvariant.cpp +++ b/tests/auto/qvariant/tst_qvariant.cpp @@ -3200,7 +3200,10 @@ struct MyPrimitive return x == o.x && y == o.y; } }; + +QT_BEGIN_NAMESPACE Q_DECLARE_TYPEINFO(MyPrimitive, Q_PRIMITIVE_TYPE); +QT_END_NAMESPACE struct MyData { @@ -3239,7 +3242,9 @@ struct MyMovable int MyMovable::count = 0; +QT_BEGIN_NAMESPACE Q_DECLARE_TYPEINFO(MyMovable, Q_MOVABLE_TYPE); +QT_END_NAMESPACE Q_DECLARE_METATYPE(QList<QSize>) Q_DECLARE_METATYPE(MyPrimitive) diff --git a/tests/auto/qxmlstream/XML-Test-Suite/xmlconf/ibm/valid/P60/ibm60v01.xml b/tests/auto/qxmlstream/XML-Test-Suite/xmlconf/ibm/valid/P60/ibm60v01.xml index edf9fee..050a340 100644 --- a/tests/auto/qxmlstream/XML-Test-Suite/xmlconf/ibm/valid/P60/ibm60v01.xml +++ b/tests/auto/qxmlstream/XML-Test-Suite/xmlconf/ibm/valid/P60/ibm60v01.xml @@ -10,10 +10,10 @@ <!ATTLIST one chapter CDATA #IMPLIED>
<!ATTLIST two chapter CDATA #REQUIRED>
<!ATTLIST three chapter CDATA #FIXED "JavaBeans">
- <!ATTLIST four chapter CDATA 'defualt'>
+ <!ATTLIST four chapter CDATA 'default'>
]>
<Java><one chapter="Introduction"/>
<three chapter="JavaBeans"/>
Positive test
DefaultDecl attributes values IMPLIED, REQUIRED, FIXED and default
-</Java>
\ No newline at end of file +</Java>
diff --git a/tests/auto/uic/baseline/config_fromuic3.ui.h b/tests/auto/uic/baseline/config_fromuic3.ui.h index 6e22dc7..c77b303 100644 --- a/tests/auto/uic/baseline/config_fromuic3.ui.h +++ b/tests/auto/uic/baseline/config_fromuic3.ui.h @@ -45,7 +45,7 @@ ** Form generated from reading UI file 'config_fromuic3.ui' ** ** Created: Thu Dec 17 12:48:42 2009 -** by: Qt User Interface Compiler version 4.6.2 +** by: Qt User Interface Compiler version 4.6.3 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ diff --git a/tests/auto/xmlpatternsdiagnosticsts/test/test.pro b/tests/auto/xmlpatternsdiagnosticsts/test/test.pro deleted file mode 100644 index acd71e4..0000000 --- a/tests/auto/xmlpatternsdiagnosticsts/test/test.pro +++ /dev/null @@ -1,32 +0,0 @@ -load(qttest_p4) -SOURCES += tst_xmlpatternsdiagnosticsts.cpp \ - ../../qxmlquery/TestFundament.cpp - -include (../../xmlpatterns.pri) - -TARGET = tst_xmlpatternsdiagnosticsts -DESTDIR = .. -win32 { - CONFIG(debug, debug|release): DESTDIR = ../debug - else: DESTDIR = ../release -} - -contains(QT_CONFIG, xmlpatterns) { -HEADERS += ../../xmlpatternsxqts/test/tst_suitetest.h -SOURCES += ../../xmlpatternsxqts/test/tst_suitetest.cpp -LIBS += -l$$XMLPATTERNS_SDK -} - -QT += xml - -INCLUDEPATH += $$(QTSRCDIR)/tests/auto/xmlpatternsxqts/lib/ \ - $$(QTDIR)/include/QtXmlPatterns/private \ - $$(QTSRCDIR)/tests/auto/xmlpatternsxqts/test \ - ../../xmlpatternsxqts/test \ - ../../xmlpatternsxqts/lib - -wince*|symbian { - catalog.sources = ../TestSuite ../Baseline.xml - catalog.path = . - DEPLOYMENT += catalog -} diff --git a/tests/auto/xmlpatternsdiagnosticsts/test/tst_xmlpatternsdiagnosticsts.cpp b/tests/auto/xmlpatternsdiagnosticsts/tst_xmlpatternsdiagnosticsts.cpp index 4a11404..4a11404 100644 --- a/tests/auto/xmlpatternsdiagnosticsts/test/tst_xmlpatternsdiagnosticsts.cpp +++ b/tests/auto/xmlpatternsdiagnosticsts/tst_xmlpatternsdiagnosticsts.cpp diff --git a/tests/auto/xmlpatternsdiagnosticsts/xmlpatternsdiagnosticsts.pro b/tests/auto/xmlpatternsdiagnosticsts/xmlpatternsdiagnosticsts.pro index 3d82eaf..981adab 100644 --- a/tests/auto/xmlpatternsdiagnosticsts/xmlpatternsdiagnosticsts.pro +++ b/tests/auto/xmlpatternsdiagnosticsts/xmlpatternsdiagnosticsts.pro @@ -1,5 +1,27 @@ -TEMPLATE = subdirs -CONFIG += ordered +load(qttest_p4) +SOURCES += tst_xmlpatternsdiagnosticsts.cpp \ + ../qxmlquery/TestFundament.cpp -SUBDIRS = ../xmlpatternsxqts test -requires(contains(QT_CONFIG,private_tests)) +include (../xmlpatterns.pri) + +TARGET = tst_xmlpatternsdiagnosticsts + +contains(QT_CONFIG, xmlpatterns) { +HEADERS += ../xmlpatternsxqts/tst_suitetest.h +SOURCES += ../xmlpatternsxqts/tst_suitetest.cpp +LIBS += -l$$XMLPATTERNS_SDK +} + +QT += xml + +INCLUDEPATH += $$(QTSRCDIR)/tests/auto/xmlpatternssdk \ + $$(QTDIR)/include/QtXmlPatterns/private \ + $$(QTSRCDIR)/tests/auto/xmlpatternsxqts \ + ../xmlpatternsxqts \ + ../xmlpatternssdk + +wince*|symbian { + catalog.sources = TestSuite Baseline.xml + catalog.path = . + DEPLOYMENT += catalog +} diff --git a/tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro b/tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro index 0f55078..f36211e 100644 --- a/tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro +++ b/tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro @@ -5,8 +5,8 @@ SOURCES += tst_xmlpatternsschemats.cpp \ include (../xmlpatterns.pri) contains(QT_CONFIG,xmlpatterns) { -HEADERS += ../xmlpatternsxqts/test/tst_suitetest.h -SOURCES += ../xmlpatternsxqts/test/tst_suitetest.cpp +HEADERS += ../xmlpatternsxqts/tst_suitetest.h +SOURCES += ../xmlpatternsxqts/tst_suitetest.cpp } PATTERNIST_SDK = QtXmlPatternsSDK @@ -20,8 +20,8 @@ LIBS += -l$$PATTERNIST_SDK QT += xml -INCLUDEPATH += $$QT_SOURCE_TREE/tests/auto/xmlpatternsxqts/lib/ \ - $$QT_BUILD_TREE/include/QtXmlPatterns/private \ - $$QT_SOURCE_TREE/tests/auto/xmlpatternsxqts/test \ - ../xmlpatternsxqts/test \ - ../xmlpatternsxqts/lib +INCLUDEPATH += $$QT_SOURCE_TREE/tests/auto/xmlpatternssdk/ \ + $$QT_BUILD_TREE/include/QtXmlPatterns/private \ + $$QT_SOURCE_TREE/tests/auto/xmlpatternsxqts \ + ../xmlpatternsxqts \ + ../xmlpatternssdk diff --git a/tests/auto/xmlpatternsxqts/lib/ASTItem.cpp b/tests/auto/xmlpatternssdk/ASTItem.cpp index 3b4fbdc..3b4fbdc 100644 --- a/tests/auto/xmlpatternsxqts/lib/ASTItem.cpp +++ b/tests/auto/xmlpatternssdk/ASTItem.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/ASTItem.h b/tests/auto/xmlpatternssdk/ASTItem.h index ca3ac8f..ca3ac8f 100644 --- a/tests/auto/xmlpatternsxqts/lib/ASTItem.h +++ b/tests/auto/xmlpatternssdk/ASTItem.h diff --git a/tests/auto/xmlpatternsxqts/lib/DebugExpressionFactory.cpp b/tests/auto/xmlpatternssdk/DebugExpressionFactory.cpp index 1b5121e..1b5121e 100644 --- a/tests/auto/xmlpatternsxqts/lib/DebugExpressionFactory.cpp +++ b/tests/auto/xmlpatternssdk/DebugExpressionFactory.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/DebugExpressionFactory.h b/tests/auto/xmlpatternssdk/DebugExpressionFactory.h index d5e676d..d5e676d 100644 --- a/tests/auto/xmlpatternsxqts/lib/DebugExpressionFactory.h +++ b/tests/auto/xmlpatternssdk/DebugExpressionFactory.h diff --git a/tests/auto/xmlpatternsxqts/lib/ErrorHandler.cpp b/tests/auto/xmlpatternssdk/ErrorHandler.cpp index 3f07737..3f07737 100644 --- a/tests/auto/xmlpatternsxqts/lib/ErrorHandler.cpp +++ b/tests/auto/xmlpatternssdk/ErrorHandler.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/ErrorHandler.h b/tests/auto/xmlpatternssdk/ErrorHandler.h index 25447a9..25447a9 100644 --- a/tests/auto/xmlpatternsxqts/lib/ErrorHandler.h +++ b/tests/auto/xmlpatternssdk/ErrorHandler.h diff --git a/tests/auto/xmlpatternsxqts/lib/ErrorItem.cpp b/tests/auto/xmlpatternssdk/ErrorItem.cpp index 57edc1f..57edc1f 100644 --- a/tests/auto/xmlpatternsxqts/lib/ErrorItem.cpp +++ b/tests/auto/xmlpatternssdk/ErrorItem.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/ErrorItem.h b/tests/auto/xmlpatternssdk/ErrorItem.h index 1d05872..1d05872 100644 --- a/tests/auto/xmlpatternsxqts/lib/ErrorItem.h +++ b/tests/auto/xmlpatternssdk/ErrorItem.h diff --git a/tests/auto/xmlpatternsxqts/lib/ExitCode.h b/tests/auto/xmlpatternssdk/ExitCode.h index e1810b1..e1810b1 100644 --- a/tests/auto/xmlpatternsxqts/lib/ExitCode.h +++ b/tests/auto/xmlpatternssdk/ExitCode.h diff --git a/tests/auto/xmlpatternsxqts/lib/ExpressionInfo.cpp b/tests/auto/xmlpatternssdk/ExpressionInfo.cpp index abbc8b3..abbc8b3 100644 --- a/tests/auto/xmlpatternsxqts/lib/ExpressionInfo.cpp +++ b/tests/auto/xmlpatternssdk/ExpressionInfo.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/ExpressionInfo.h b/tests/auto/xmlpatternssdk/ExpressionInfo.h index 2d9d398..2d9d398 100644 --- a/tests/auto/xmlpatternsxqts/lib/ExpressionInfo.h +++ b/tests/auto/xmlpatternssdk/ExpressionInfo.h diff --git a/tests/auto/xmlpatternsxqts/lib/ExpressionNamer.cpp b/tests/auto/xmlpatternssdk/ExpressionNamer.cpp index 605c754..605c754 100644 --- a/tests/auto/xmlpatternsxqts/lib/ExpressionNamer.cpp +++ b/tests/auto/xmlpatternssdk/ExpressionNamer.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/ExpressionNamer.h b/tests/auto/xmlpatternssdk/ExpressionNamer.h index 129d8d7..129d8d7 100644 --- a/tests/auto/xmlpatternsxqts/lib/ExpressionNamer.h +++ b/tests/auto/xmlpatternssdk/ExpressionNamer.h diff --git a/tests/auto/xmlpatternsxqts/lib/ExternalSourceLoader.cpp b/tests/auto/xmlpatternssdk/ExternalSourceLoader.cpp index a83a100..a83a100 100644 --- a/tests/auto/xmlpatternsxqts/lib/ExternalSourceLoader.cpp +++ b/tests/auto/xmlpatternssdk/ExternalSourceLoader.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/ExternalSourceLoader.h b/tests/auto/xmlpatternssdk/ExternalSourceLoader.h index 2d88222..2d88222 100644 --- a/tests/auto/xmlpatternsxqts/lib/ExternalSourceLoader.h +++ b/tests/auto/xmlpatternssdk/ExternalSourceLoader.h diff --git a/tests/auto/xmlpatternsxqts/lib/Global.cpp b/tests/auto/xmlpatternssdk/Global.cpp index f78e421..f78e421 100644 --- a/tests/auto/xmlpatternsxqts/lib/Global.cpp +++ b/tests/auto/xmlpatternssdk/Global.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/Global.h b/tests/auto/xmlpatternssdk/Global.h index 53c32cb..53c32cb 100644 --- a/tests/auto/xmlpatternsxqts/lib/Global.h +++ b/tests/auto/xmlpatternssdk/Global.h diff --git a/tests/auto/xmlpatternsxqts/lib/ResultThreader.cpp b/tests/auto/xmlpatternssdk/ResultThreader.cpp index 3296854..3296854 100644 --- a/tests/auto/xmlpatternsxqts/lib/ResultThreader.cpp +++ b/tests/auto/xmlpatternssdk/ResultThreader.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/ResultThreader.h b/tests/auto/xmlpatternssdk/ResultThreader.h index 19749f0..19749f0 100644 --- a/tests/auto/xmlpatternsxqts/lib/ResultThreader.h +++ b/tests/auto/xmlpatternssdk/ResultThreader.h diff --git a/tests/auto/xmlpatternsxqts/lib/TestBaseLine.cpp b/tests/auto/xmlpatternssdk/TestBaseLine.cpp index 6a46bcc..6a46bcc 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestBaseLine.cpp +++ b/tests/auto/xmlpatternssdk/TestBaseLine.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/TestBaseLine.h b/tests/auto/xmlpatternssdk/TestBaseLine.h index e297128..e297128 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestBaseLine.h +++ b/tests/auto/xmlpatternssdk/TestBaseLine.h diff --git a/tests/auto/xmlpatternsxqts/lib/TestCase.cpp b/tests/auto/xmlpatternssdk/TestCase.cpp index 7b424d2..7b424d2 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestCase.cpp +++ b/tests/auto/xmlpatternssdk/TestCase.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/TestCase.h b/tests/auto/xmlpatternssdk/TestCase.h index 28df5f1..28df5f1 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestCase.h +++ b/tests/auto/xmlpatternssdk/TestCase.h diff --git a/tests/auto/xmlpatternsxqts/lib/TestContainer.cpp b/tests/auto/xmlpatternssdk/TestContainer.cpp index ec6196c..ec6196c 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestContainer.cpp +++ b/tests/auto/xmlpatternssdk/TestContainer.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/TestContainer.h b/tests/auto/xmlpatternssdk/TestContainer.h index 5b93491..5b93491 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestContainer.h +++ b/tests/auto/xmlpatternssdk/TestContainer.h diff --git a/tests/auto/xmlpatternsxqts/lib/TestGroup.cpp b/tests/auto/xmlpatternssdk/TestGroup.cpp index f2cd2bd..f2cd2bd 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestGroup.cpp +++ b/tests/auto/xmlpatternssdk/TestGroup.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/TestGroup.h b/tests/auto/xmlpatternssdk/TestGroup.h index 5f4798f..5f4798f 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestGroup.h +++ b/tests/auto/xmlpatternssdk/TestGroup.h diff --git a/tests/auto/xmlpatternsxqts/lib/TestItem.h b/tests/auto/xmlpatternssdk/TestItem.h index 0b3c606..0b3c606 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestItem.h +++ b/tests/auto/xmlpatternssdk/TestItem.h diff --git a/tests/auto/xmlpatternsxqts/lib/TestResult.cpp b/tests/auto/xmlpatternssdk/TestResult.cpp index 2374bc0..2374bc0 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestResult.cpp +++ b/tests/auto/xmlpatternssdk/TestResult.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/TestResult.h b/tests/auto/xmlpatternssdk/TestResult.h index 6951f90..6951f90 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestResult.h +++ b/tests/auto/xmlpatternssdk/TestResult.h diff --git a/tests/auto/xmlpatternsxqts/lib/TestResultHandler.cpp b/tests/auto/xmlpatternssdk/TestResultHandler.cpp index b87d481..b87d481 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestResultHandler.cpp +++ b/tests/auto/xmlpatternssdk/TestResultHandler.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/TestResultHandler.h b/tests/auto/xmlpatternssdk/TestResultHandler.h index a786ac4..a786ac4 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestResultHandler.h +++ b/tests/auto/xmlpatternssdk/TestResultHandler.h diff --git a/tests/auto/xmlpatternsxqts/lib/TestSuite.cpp b/tests/auto/xmlpatternssdk/TestSuite.cpp index 2c3e49c..2c3e49c 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestSuite.cpp +++ b/tests/auto/xmlpatternssdk/TestSuite.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/TestSuite.h b/tests/auto/xmlpatternssdk/TestSuite.h index d14dc62..d14dc62 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestSuite.h +++ b/tests/auto/xmlpatternssdk/TestSuite.h diff --git a/tests/auto/xmlpatternsxqts/lib/TestSuiteHandler.cpp b/tests/auto/xmlpatternssdk/TestSuiteHandler.cpp index 7c687f3..7c687f3 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestSuiteHandler.cpp +++ b/tests/auto/xmlpatternssdk/TestSuiteHandler.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/TestSuiteHandler.h b/tests/auto/xmlpatternssdk/TestSuiteHandler.h index 76156c0..76156c0 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestSuiteHandler.h +++ b/tests/auto/xmlpatternssdk/TestSuiteHandler.h diff --git a/tests/auto/xmlpatternsxqts/lib/TestSuiteResult.cpp b/tests/auto/xmlpatternssdk/TestSuiteResult.cpp index 4e81859..4e81859 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestSuiteResult.cpp +++ b/tests/auto/xmlpatternssdk/TestSuiteResult.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/TestSuiteResult.h b/tests/auto/xmlpatternssdk/TestSuiteResult.h index 491c2b2..491c2b2 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestSuiteResult.h +++ b/tests/auto/xmlpatternssdk/TestSuiteResult.h diff --git a/tests/auto/xmlpatternsxqts/lib/TreeItem.cpp b/tests/auto/xmlpatternssdk/TreeItem.cpp index b34262d..b34262d 100644 --- a/tests/auto/xmlpatternsxqts/lib/TreeItem.cpp +++ b/tests/auto/xmlpatternssdk/TreeItem.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/TreeItem.h b/tests/auto/xmlpatternssdk/TreeItem.h index f5e051f..f5e051f 100644 --- a/tests/auto/xmlpatternsxqts/lib/TreeItem.h +++ b/tests/auto/xmlpatternssdk/TreeItem.h diff --git a/tests/auto/xmlpatternsxqts/lib/TreeModel.cpp b/tests/auto/xmlpatternssdk/TreeModel.cpp index e27f8e0..e27f8e0 100644 --- a/tests/auto/xmlpatternsxqts/lib/TreeModel.cpp +++ b/tests/auto/xmlpatternssdk/TreeModel.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/TreeModel.h b/tests/auto/xmlpatternssdk/TreeModel.h index 1d8ea72..1d8ea72 100644 --- a/tests/auto/xmlpatternsxqts/lib/TreeModel.h +++ b/tests/auto/xmlpatternssdk/TreeModel.h diff --git a/tests/auto/xmlpatternsxqts/lib/Worker.cpp b/tests/auto/xmlpatternssdk/Worker.cpp index 0121099..0121099 100644 --- a/tests/auto/xmlpatternsxqts/lib/Worker.cpp +++ b/tests/auto/xmlpatternssdk/Worker.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/Worker.h b/tests/auto/xmlpatternssdk/Worker.h index b3d7ae2..b3d7ae2 100644 --- a/tests/auto/xmlpatternsxqts/lib/Worker.h +++ b/tests/auto/xmlpatternssdk/Worker.h diff --git a/tests/auto/xmlpatternsxqts/lib/XMLWriter.cpp b/tests/auto/xmlpatternssdk/XMLWriter.cpp index 60a5344..60a5344 100644 --- a/tests/auto/xmlpatternsxqts/lib/XMLWriter.cpp +++ b/tests/auto/xmlpatternssdk/XMLWriter.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/XMLWriter.h b/tests/auto/xmlpatternssdk/XMLWriter.h index 2b629bb..2b629bb 100644 --- a/tests/auto/xmlpatternsxqts/lib/XMLWriter.h +++ b/tests/auto/xmlpatternssdk/XMLWriter.h diff --git a/tests/auto/xmlpatternsxqts/lib/XQTSTestCase.cpp b/tests/auto/xmlpatternssdk/XQTSTestCase.cpp index 6a8645b..6a8645b 100644 --- a/tests/auto/xmlpatternsxqts/lib/XQTSTestCase.cpp +++ b/tests/auto/xmlpatternssdk/XQTSTestCase.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/XQTSTestCase.h b/tests/auto/xmlpatternssdk/XQTSTestCase.h index 8872b32..8872b32 100644 --- a/tests/auto/xmlpatternsxqts/lib/XQTSTestCase.h +++ b/tests/auto/xmlpatternssdk/XQTSTestCase.h diff --git a/tests/auto/xmlpatternsxqts/lib/XSDTSTestCase.cpp b/tests/auto/xmlpatternssdk/XSDTSTestCase.cpp index 3cbb681..3cbb681 100644 --- a/tests/auto/xmlpatternsxqts/lib/XSDTSTestCase.cpp +++ b/tests/auto/xmlpatternssdk/XSDTSTestCase.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/XSDTSTestCase.h b/tests/auto/xmlpatternssdk/XSDTSTestCase.h index 8cfa143..947687a 100644 --- a/tests/auto/xmlpatternsxqts/lib/XSDTSTestCase.h +++ b/tests/auto/xmlpatternssdk/XSDTSTestCase.h @@ -50,6 +50,7 @@ #include "TestCase.h" QT_BEGIN_HEADER +QT_BEGIN_NAMESPACE namespace QPatternistSDK { @@ -153,6 +154,7 @@ namespace QPatternistSDK }; } +QT_END_NAMESPACE QT_END_HEADER #endif diff --git a/tests/auto/xmlpatternsxqts/lib/XSDTestSuiteHandler.cpp b/tests/auto/xmlpatternssdk/XSDTestSuiteHandler.cpp index a868d19..a868d19 100644 --- a/tests/auto/xmlpatternsxqts/lib/XSDTestSuiteHandler.cpp +++ b/tests/auto/xmlpatternssdk/XSDTestSuiteHandler.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/XSDTestSuiteHandler.h b/tests/auto/xmlpatternssdk/XSDTestSuiteHandler.h index 9179a2d..5493c7d 100644 --- a/tests/auto/xmlpatternsxqts/lib/XSDTestSuiteHandler.h +++ b/tests/auto/xmlpatternssdk/XSDTestSuiteHandler.h @@ -50,6 +50,7 @@ #include "XQTSTestCase.h" QT_BEGIN_HEADER +QT_BEGIN_NAMESPACE namespace QPatternistSDK { @@ -113,6 +114,7 @@ namespace QPatternistSDK }; } +QT_END_NAMESPACE QT_END_HEADER #endif diff --git a/tests/auto/xmlpatternsxqts/lib/XSLTTestSuiteHandler.cpp b/tests/auto/xmlpatternssdk/XSLTTestSuiteHandler.cpp index cfc3b2b..cfc3b2b 100644 --- a/tests/auto/xmlpatternsxqts/lib/XSLTTestSuiteHandler.cpp +++ b/tests/auto/xmlpatternssdk/XSLTTestSuiteHandler.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/XSLTTestSuiteHandler.h b/tests/auto/xmlpatternssdk/XSLTTestSuiteHandler.h index 8614789..8614789 100644 --- a/tests/auto/xmlpatternsxqts/lib/XSLTTestSuiteHandler.h +++ b/tests/auto/xmlpatternssdk/XSLTTestSuiteHandler.h diff --git a/tests/auto/xmlpatternsxqts/lib/docs/XMLIndenterExample.cpp b/tests/auto/xmlpatternssdk/docs/XMLIndenterExample.cpp index 24ee158..24ee158 100644 --- a/tests/auto/xmlpatternsxqts/lib/docs/XMLIndenterExample.cpp +++ b/tests/auto/xmlpatternssdk/docs/XMLIndenterExample.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/docs/XMLIndenterExampleResult.xml b/tests/auto/xmlpatternssdk/docs/XMLIndenterExampleResult.xml index c5e7312..c5e7312 100644 --- a/tests/auto/xmlpatternsxqts/lib/docs/XMLIndenterExampleResult.xml +++ b/tests/auto/xmlpatternssdk/docs/XMLIndenterExampleResult.xml diff --git a/tests/auto/xmlpatternsxqts/lib/docs/XMLWriterExample.cpp b/tests/auto/xmlpatternssdk/docs/XMLWriterExample.cpp index 24ee158..24ee158 100644 --- a/tests/auto/xmlpatternsxqts/lib/docs/XMLWriterExample.cpp +++ b/tests/auto/xmlpatternssdk/docs/XMLWriterExample.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/docs/XMLWriterExampleResult.xml b/tests/auto/xmlpatternssdk/docs/XMLWriterExampleResult.xml index c5e7312..c5e7312 100644 --- a/tests/auto/xmlpatternsxqts/lib/docs/XMLWriterExampleResult.xml +++ b/tests/auto/xmlpatternssdk/docs/XMLWriterExampleResult.xml diff --git a/tests/auto/xmlpatternsxqts/lib/tests/XMLWriterTest.cpp b/tests/auto/xmlpatternssdk/tests/XMLWriterTest.cpp index a10c01a..a10c01a 100644 --- a/tests/auto/xmlpatternsxqts/lib/tests/XMLWriterTest.cpp +++ b/tests/auto/xmlpatternssdk/tests/XMLWriterTest.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/tests/XMLWriterTest.h b/tests/auto/xmlpatternssdk/tests/XMLWriterTest.h index f90aea2..f90aea2 100644 --- a/tests/auto/xmlpatternsxqts/lib/tests/XMLWriterTest.h +++ b/tests/auto/xmlpatternssdk/tests/XMLWriterTest.h diff --git a/tests/auto/xmlpatternsxqts/lib/lib.pro b/tests/auto/xmlpatternssdk/xmlpatternssdk.pro index f5b0a06..6204f01 100644 --- a/tests/auto/xmlpatternsxqts/lib/lib.pro +++ b/tests/auto/xmlpatternssdk/xmlpatternssdk.pro @@ -1,4 +1,4 @@ -include (../../xmlpatterns.pri) +include (../xmlpatterns.pri) TARGET = $$XMLPATTERNS_SDK TEMPLATE = lib diff --git a/tests/auto/xmlpatternsview/test/test.pro b/tests/auto/xmlpatternsview/test/test.pro deleted file mode 100644 index 6adff4d..0000000 --- a/tests/auto/xmlpatternsview/test/test.pro +++ /dev/null @@ -1,17 +0,0 @@ -load(qttest_p4) -SOURCES += tst_xmlpatternsview.cpp - -include (../../xmlpatterns.pri) - -DESTDIR = .. -win32 { - CONFIG(debug, debug|release): DESTDIR = ../debug - else: DESTDIR = ../release -} -TARGET = tst_xmlpatternsview - -wince*: { - viewexe.sources = $$QT_BUILD_TREE/xmlpatternsview.exe - viewexe.path = . - DEPLOYMENT += viewexe -} diff --git a/tests/auto/xmlpatternsview/test/tst_xmlpatternsview.cpp b/tests/auto/xmlpatternsview/tst_xmlpatternsview.cpp index 91dee63..91dee63 100644 --- a/tests/auto/xmlpatternsview/test/tst_xmlpatternsview.cpp +++ b/tests/auto/xmlpatternsview/tst_xmlpatternsview.cpp diff --git a/tests/auto/xmlpatternsview/xmlpatternsview.pro b/tests/auto/xmlpatternsview/xmlpatternsview.pro index 04ee4d0..d93cba3 100644 --- a/tests/auto/xmlpatternsview/xmlpatternsview.pro +++ b/tests/auto/xmlpatternsview/xmlpatternsview.pro @@ -1,9 +1,12 @@ -TEMPLATE = subdirs -CONFIG += ordered +load(qttest_p4) +SOURCES += tst_xmlpatternsview.cpp -SUBDIRS = ../xmlpatternsxqts test +include (../xmlpatterns.pri) -contains(QT_CONFIG,xmlpatterns) { - SUBDIRS += view +TARGET = tst_xmlpatternsview + +wince*: { + viewexe.sources = $$QT_BUILD_TREE/xmlpatternsview.exe + viewexe.path = . + DEPLOYMENT += viewexe } -requires(contains(QT_CONFIG,private_tests)) diff --git a/tests/auto/xmlpatternsxqts/test/test.pro b/tests/auto/xmlpatternsxqts/test/test.pro deleted file mode 100644 index a69838a..0000000 --- a/tests/auto/xmlpatternsxqts/test/test.pro +++ /dev/null @@ -1,26 +0,0 @@ -load(qttest_p4) -SOURCES += tst_xmlpatternsxqts.cpp ../../qxmlquery/TestFundament.cpp tst_suitetest.cpp - -include(../../xmlpatterns.pri) - -contains(QT_CONFIG,xmlpatterns) { - HEADERS += tst_suitetest.h - LIBS += -l$$XMLPATTERNS_SDK -} - -# syncqt doesn't copy headers in tools/ so let's manually ensure -# it works with shadow builds and source builds. -INCLUDEPATH += $$(QTDIR)/include/QtXmlPatterns/private \ - $$(QTSRCDIR)/include/QtXmlPatterns/private \ - $$(QTSRCDIR)/tools/xmlpatterns \ - $$(QTDIR)/tools/xmlpatterns \ - ../lib/ - -CONFIG += testlib -QT += xml -DESTDIR = .. -win32 { - CONFIG(debug, debug|release): DESTDIR = ../debug - else: DESTDIR = ../release -} -TARGET = tst_xmlpatternsxqts diff --git a/tests/auto/xmlpatternsxqts/test/tst_suitetest.cpp b/tests/auto/xmlpatternsxqts/tst_suitetest.cpp index 64120c7..64120c7 100644 --- a/tests/auto/xmlpatternsxqts/test/tst_suitetest.cpp +++ b/tests/auto/xmlpatternsxqts/tst_suitetest.cpp diff --git a/tests/auto/xmlpatternsxqts/test/tst_suitetest.h b/tests/auto/xmlpatternsxqts/tst_suitetest.h index 22e384a..70e56af 100644 --- a/tests/auto/xmlpatternsxqts/test/tst_suitetest.h +++ b/tests/auto/xmlpatternsxqts/tst_suitetest.h @@ -44,7 +44,7 @@ #define Q_tst_SuiteTest #include <QtCore/QObject> -#include "../../qxmlquery/TestFundament.h" +#include "../qxmlquery/TestFundament.h" /*! \class tst_SuiteTest diff --git a/tests/auto/xmlpatternsxqts/test/tst_xmlpatternsxqts.cpp b/tests/auto/xmlpatternsxqts/tst_xmlpatternsxqts.cpp index 890234e..890234e 100644 --- a/tests/auto/xmlpatternsxqts/test/tst_xmlpatternsxqts.cpp +++ b/tests/auto/xmlpatternsxqts/tst_xmlpatternsxqts.cpp diff --git a/tests/auto/xmlpatternsxqts/xmlpatternsxqts.pro b/tests/auto/xmlpatternsxqts/xmlpatternsxqts.pro index 3f49ccc..e81888a 100644 --- a/tests/auto/xmlpatternsxqts/xmlpatternsxqts.pro +++ b/tests/auto/xmlpatternsxqts/xmlpatternsxqts.pro @@ -1,13 +1,21 @@ -TEMPLATE = subdirs +load(qttest_p4) +SOURCES += tst_xmlpatternsxqts.cpp ../qxmlquery/TestFundament.cpp tst_suitetest.cpp + +include(../xmlpatterns.pri) + contains(QT_CONFIG,xmlpatterns) { - SUBDIRS += lib - test.depends = lib + HEADERS += tst_suitetest.h + LIBS += -l$$XMLPATTERNS_SDK } -SUBDIRS += test - -# Needed on the win32-g++ setup and on the test machine arsia. -INCLUDEPATH += $$QT_BUILD_TREE/include/QtXmlPatterns/private \ - ../../../include/QtXmlPatterns/private -requires(contains(QT_CONFIG,private_tests)) +# syncqt doesn't copy headers in tools/ so let's manually ensure +# it works with shadow builds and source builds. +INCLUDEPATH += $$(QTDIR)/include/QtXmlPatterns/private \ + $$(QTSRCDIR)/include/QtXmlPatterns/private \ + $$(QTSRCDIR)/tools/xmlpatterns \ + $$(QTDIR)/tools/xmlpatterns \ + ../xmlpatternssdk/ +CONFIG += testlib +QT += xml +TARGET = tst_xmlpatternsxqts diff --git a/tests/auto/xmlpatternsxslts/xmlpatternsxslts.pro b/tests/auto/xmlpatternsxslts/xmlpatternsxslts.pro index 9b63a52..940cc31 100644 --- a/tests/auto/xmlpatternsxslts/xmlpatternsxslts.pro +++ b/tests/auto/xmlpatternsxslts/xmlpatternsxslts.pro @@ -5,17 +5,17 @@ SOURCES += tst_xmlpatternsxslts.cpp \ include (../xmlpatterns.pri) contains(QT_CONFIG,xmlpatterns) { -HEADERS += ../xmlpatternsxqts/test/tst_suitetest.h -SOURCES += ../xmlpatternsxqts/test/tst_suitetest.cpp +HEADERS += ../xmlpatternsxqts/tst_suitetest.h +SOURCES += ../xmlpatternsxqts/tst_suitetest.cpp LIBS += -l$$XMLPATTERNS_SDK } QT += xml -INCLUDEPATH += $$(QTSRCDIR)/tests/auto/xmlpatternsxqts/lib/ \ - $$(QTDIR)/include/QtXmlPatterns/private \ - $$(QTSRCDIR)/tests/auto/xmlpatternsxqts/test \ - ../xmlpatternsxqts/test \ - ../xmlpatternsxqts/lib +INCLUDEPATH += $$(QTSRCDIR)/tests/auto/xmlpatternssdk \ + $$(QTDIR)/include/QtXmlPatterns/private \ + $$(QTSRCDIR)/tests/auto/xmlpatternsxqts \ + ../xmlpatternsxqts \ + ../xmlpatternssdk wince*: { testdata.sources = XSLTS Baseline.xml |