diff options
Diffstat (limited to 'tests/auto')
75 files changed, 682 insertions, 131 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 5012b5cdec..15d88785de 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -2,9 +2,8 @@ TEMPLATE=subdirs SUBDIRS=\ qml \ quick \ + headersclean \ particles \ qmldevtools contains(QT_CONFIG, qmltest): SUBDIRS += qmltest - -!cross_compile: SUBDIRS += host.pro diff --git a/tests/auto/headersclean/headersclean.pro b/tests/auto/headersclean/headersclean.pro index 4ce05fe512..379648e950 100644 --- a/tests/auto/headersclean/headersclean.pro +++ b/tests/auto/headersclean/headersclean.pro @@ -1,6 +1,9 @@ -CONFIG += testcase -TARGET = tst_headersclean -SOURCES += tst_headersclean.cpp -QT = core testlib +QT = core testlib declarative qml quick qmltest qmldevtools +HEADERSCLEAN_PRI = $${QT.core.sources}/../../tests/auto/other/headersclean/headersclean.pri +isEmpty(QT.core.sources)|!include($$HEADERSCLEAN_PRI) { + warning("headersclean.pri from QtCore sources not available. test disabled") + TEMPLATE=subdirs +} -contains(QT_CONFIG,qml): QT += qml qml-private +# shadowing problems in scenegraph, allow it for now +*-g++*: QMAKE_CXXFLAGS -= -Wshadow diff --git a/tests/auto/headersclean/tst_headersclean.cpp b/tests/auto/headersclean/qt_headersclean_headers.h index d5131f96cd..d3f4e4b5c8 100644 --- a/tests/auto/headersclean/tst_headersclean.cpp +++ b/tests/auto/headersclean/qt_headersclean_headers.h @@ -39,24 +39,13 @@ ** ****************************************************************************/ -#define QT_NO_KEYWORDS -#define signals int -#define slots int -#define emit public:; -#define foreach public:; -#define forever public:; - -#include <QtCore/QtCore> -#include <QtTest/QtTest> +#ifndef QT_HEADERSCLEAN_HEADERS +#define QT_HEADERSCLEAN_HEADERS +#include <QtDeclarative/QtDeclarative> #include <QtQml/QtQml> +#include <QtQmlDevTools/QtQmlDevTools> +#include <QtQuick/QtQuick> +#include <QtQuickTest/QtQuickTest> -class tst_HeadersClean: public QObject -{ - Q_OBJECT -public: - tst_HeadersClean() {} -}; - -QTEST_MAIN(tst_HeadersClean) -#include "tst_headersclean.moc" +#endif diff --git a/tests/auto/host.pro b/tests/auto/host.pro deleted file mode 100644 index 0a96ef0413..0000000000 --- a/tests/auto/host.pro +++ /dev/null @@ -1,9 +0,0 @@ -TEMPLATE=subdirs - -# FIXME -# This test is crrently broken: -#SUBDIRS=\ - #headersclean \ - -SUBDIRS= - diff --git a/tests/auto/particles/qquickage/qquickage.pro b/tests/auto/particles/qquickage/qquickage.pro index 99c768fdb1..8e5c2f0e33 100644 --- a/tests/auto/particles/qquickage/qquickage.pro +++ b/tests/auto/particles/qquickage/qquickage.pro @@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle include (../../shared/util.pri) TESTDATA = data/* -QT += core-private gui-private v8-private qml-private quick-private opengl-private testlib +QT += core-private gui-private v8-private qml-private quick-private testlib diff --git a/tests/auto/particles/qquickangleddirection/qquickangleddirection.pro b/tests/auto/particles/qquickangleddirection/qquickangleddirection.pro index 6899ee60d9..df8d460d3e 100644 --- a/tests/auto/particles/qquickangleddirection/qquickangleddirection.pro +++ b/tests/auto/particles/qquickangleddirection/qquickangleddirection.pro @@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle include (../../shared/util.pri) TESTDATA = data/* -QT += core-private gui-private v8-private qml-private quick-private opengl-private testlib +QT += core-private gui-private v8-private qml-private quick-private testlib diff --git a/tests/auto/particles/qquickcumulativedirection/qquickcumulativedirection.pro b/tests/auto/particles/qquickcumulativedirection/qquickcumulativedirection.pro index b5d3efac6d..4ea8739c21 100644 --- a/tests/auto/particles/qquickcumulativedirection/qquickcumulativedirection.pro +++ b/tests/auto/particles/qquickcumulativedirection/qquickcumulativedirection.pro @@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle include (../../shared/util.pri) TESTDATA = data/* -QT += core-private gui-private v8-private qml-private quick-private opengl-private testlib +QT += core-private gui-private v8-private qml-private quick-private testlib diff --git a/tests/auto/particles/qquickcustomaffector/qquickcustomaffector.pro b/tests/auto/particles/qquickcustomaffector/qquickcustomaffector.pro index b1533d6be1..0855187d47 100644 --- a/tests/auto/particles/qquickcustomaffector/qquickcustomaffector.pro +++ b/tests/auto/particles/qquickcustomaffector/qquickcustomaffector.pro @@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle include (../../shared/util.pri) TESTDATA = data/* -QT += core-private gui-private v8-private qml-private quick-private opengl-private testlib +QT += core-private gui-private v8-private qml-private quick-private testlib diff --git a/tests/auto/particles/qquickcustomparticle/qquickcustomparticle.pro b/tests/auto/particles/qquickcustomparticle/qquickcustomparticle.pro index 6666c91d7e..d5c21abef3 100644 --- a/tests/auto/particles/qquickcustomparticle/qquickcustomparticle.pro +++ b/tests/auto/particles/qquickcustomparticle/qquickcustomparticle.pro @@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle include (../../shared/util.pri) TESTDATA = data/* -QT += core-private gui-private v8-private qml-private quick-private opengl-private testlib +QT += core-private gui-private v8-private qml-private quick-private testlib diff --git a/tests/auto/particles/qquickellipseextruder/qquickellipseextruder.pro b/tests/auto/particles/qquickellipseextruder/qquickellipseextruder.pro index b7eedb00f1..33241a4792 100644 --- a/tests/auto/particles/qquickellipseextruder/qquickellipseextruder.pro +++ b/tests/auto/particles/qquickellipseextruder/qquickellipseextruder.pro @@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle include (../../shared/util.pri) TESTDATA = data/* -QT += core-private gui-private v8-private qml-private quick-private opengl-private testlib +QT += core-private gui-private v8-private qml-private quick-private testlib diff --git a/tests/auto/particles/qquickfriction/qquickfriction.pro b/tests/auto/particles/qquickfriction/qquickfriction.pro index 19c789ddfe..36cf9aaa60 100644 --- a/tests/auto/particles/qquickfriction/qquickfriction.pro +++ b/tests/auto/particles/qquickfriction/qquickfriction.pro @@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle include (../../shared/util.pri) TESTDATA = data/* -QT += core-private gui-private v8-private qml-private quick-private opengl-private testlib +QT += core-private gui-private v8-private qml-private quick-private testlib diff --git a/tests/auto/particles/qquickgravity/qquickgravity.pro b/tests/auto/particles/qquickgravity/qquickgravity.pro index a3fab3837c..331def26b5 100644 --- a/tests/auto/particles/qquickgravity/qquickgravity.pro +++ b/tests/auto/particles/qquickgravity/qquickgravity.pro @@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle include (../../shared/util.pri) TESTDATA = data/* -QT += core-private gui-private v8-private qml-private quick-private opengl-private testlib +QT += core-private gui-private v8-private qml-private quick-private testlib diff --git a/tests/auto/particles/qquickgroupgoal/qquickgroupgoal.pro b/tests/auto/particles/qquickgroupgoal/qquickgroupgoal.pro index b97549eeee..f7f09ed9d0 100644 --- a/tests/auto/particles/qquickgroupgoal/qquickgroupgoal.pro +++ b/tests/auto/particles/qquickgroupgoal/qquickgroupgoal.pro @@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle include (../../shared/util.pri) TESTDATA = data/* -QT += core-private gui-private v8-private qml-private opengl-private testlib +QT += core-private gui-private v8-private qml-private testlib diff --git a/tests/auto/particles/qquickimageparticle/qquickimageparticle.pro b/tests/auto/particles/qquickimageparticle/qquickimageparticle.pro index 590f698510..226d844263 100644 --- a/tests/auto/particles/qquickimageparticle/qquickimageparticle.pro +++ b/tests/auto/particles/qquickimageparticle/qquickimageparticle.pro @@ -6,4 +6,4 @@ macx:CONFIG -= app_bundle include (../../shared/util.pri) TESTDATA = data/* -QT += core-private gui-private v8-private qml-private quick-private opengl-private testlib +QT += core-private gui-private v8-private qml-private quick-private testlib diff --git a/tests/auto/particles/qquickitemparticle/qquickitemparticle.pro b/tests/auto/particles/qquickitemparticle/qquickitemparticle.pro index b275e4bf08..ec7fa48e26 100644 --- a/tests/auto/particles/qquickitemparticle/qquickitemparticle.pro +++ b/tests/auto/particles/qquickitemparticle/qquickitemparticle.pro @@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle include (../../shared/util.pri) TESTDATA = data/* -QT += core-private gui-private v8-private qml-private quick-private opengl-private testlib +QT += core-private gui-private v8-private qml-private quick-private testlib diff --git a/tests/auto/particles/qquicklineextruder/qquicklineextruder.pro b/tests/auto/particles/qquicklineextruder/qquicklineextruder.pro index 519b3e4927..a1297b1e26 100644 --- a/tests/auto/particles/qquicklineextruder/qquicklineextruder.pro +++ b/tests/auto/particles/qquicklineextruder/qquicklineextruder.pro @@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle include (../../shared/util.pri) TESTDATA = data/* -QT += core-private gui-private v8-private qml-private quick-private opengl-private testlib +QT += core-private gui-private v8-private qml-private quick-private testlib diff --git a/tests/auto/particles/qquickmaskextruder/qquickmaskextruder.pro b/tests/auto/particles/qquickmaskextruder/qquickmaskextruder.pro index 48aeaddc5e..99f50a286d 100644 --- a/tests/auto/particles/qquickmaskextruder/qquickmaskextruder.pro +++ b/tests/auto/particles/qquickmaskextruder/qquickmaskextruder.pro @@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle include (../../shared/util.pri) TESTDATA = data/* -QT += core-private gui-private v8-private qml-private quick-private opengl-private testlib +QT += core-private gui-private v8-private qml-private quick-private testlib diff --git a/tests/auto/particles/qquickparticlegroup/qquickparticlegroup.pro b/tests/auto/particles/qquickparticlegroup/qquickparticlegroup.pro index d3e132fc83..c5c908e305 100644 --- a/tests/auto/particles/qquickparticlegroup/qquickparticlegroup.pro +++ b/tests/auto/particles/qquickparticlegroup/qquickparticlegroup.pro @@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle include (../../shared/util.pri) TESTDATA = data/* -QT += core-private gui-private v8-private qml-private quick-private opengl-private testlib +QT += core-private gui-private v8-private qml-private quick-private testlib diff --git a/tests/auto/particles/qquickparticlesystem/qquickparticlesystem.pro b/tests/auto/particles/qquickparticlesystem/qquickparticlesystem.pro index b241048d9e..2179ae3ae9 100644 --- a/tests/auto/particles/qquickparticlesystem/qquickparticlesystem.pro +++ b/tests/auto/particles/qquickparticlesystem/qquickparticlesystem.pro @@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle include (../../shared/util.pri) TESTDATA = data/* -QT += core-private gui-private v8-private qml-private quick-private opengl-private testlib +QT += core-private gui-private v8-private qml-private quick-private testlib diff --git a/tests/auto/particles/qquickpointattractor/qquickpointattractor.pro b/tests/auto/particles/qquickpointattractor/qquickpointattractor.pro index 22a9ac5d87..43c8022b0a 100644 --- a/tests/auto/particles/qquickpointattractor/qquickpointattractor.pro +++ b/tests/auto/particles/qquickpointattractor/qquickpointattractor.pro @@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle include (../../shared/util.pri) TESTDATA = data/* -QT += core-private gui-private v8-private qml-private quick-private opengl-private testlib +QT += core-private gui-private v8-private qml-private quick-private testlib diff --git a/tests/auto/particles/qquickpointdirection/qquickpointdirection.pro b/tests/auto/particles/qquickpointdirection/qquickpointdirection.pro index 319bdee22f..71b21e5f56 100644 --- a/tests/auto/particles/qquickpointdirection/qquickpointdirection.pro +++ b/tests/auto/particles/qquickpointdirection/qquickpointdirection.pro @@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle include (../../shared/util.pri) TESTDATA = data/* -QT += core-private gui-private v8-private qml-private quick-private opengl-private testlib +QT += core-private gui-private v8-private qml-private quick-private testlib diff --git a/tests/auto/particles/qquickrectangleextruder/qquickrectangleextruder.pro b/tests/auto/particles/qquickrectangleextruder/qquickrectangleextruder.pro index 683f77ec55..5e595204cc 100644 --- a/tests/auto/particles/qquickrectangleextruder/qquickrectangleextruder.pro +++ b/tests/auto/particles/qquickrectangleextruder/qquickrectangleextruder.pro @@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle include (../../shared/util.pri) TESTDATA = data/* -QT += core-private gui-private v8-private qml-private quick-private opengl-private testlib +QT += core-private gui-private v8-private qml-private quick-private testlib diff --git a/tests/auto/particles/qquickspritegoal/qquickspritegoal.pro b/tests/auto/particles/qquickspritegoal/qquickspritegoal.pro index 95cf68f459..cfe932aabd 100644 --- a/tests/auto/particles/qquickspritegoal/qquickspritegoal.pro +++ b/tests/auto/particles/qquickspritegoal/qquickspritegoal.pro @@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle include (../../shared/util.pri) TESTDATA = data/* -QT += core-private gui-private v8-private qml-private opengl-private testlib +QT += core-private gui-private v8-private qml-private testlib diff --git a/tests/auto/particles/qquicktargetdirection/qquicktargetdirection.pro b/tests/auto/particles/qquicktargetdirection/qquicktargetdirection.pro index a4a09ae6de..b7ba905f2e 100644 --- a/tests/auto/particles/qquicktargetdirection/qquicktargetdirection.pro +++ b/tests/auto/particles/qquicktargetdirection/qquicktargetdirection.pro @@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle include (../../shared/util.pri) TESTDATA = data/* -QT += core-private gui-private v8-private qml-private quick-private opengl-private testlib +QT += core-private gui-private v8-private qml-private quick-private testlib diff --git a/tests/auto/particles/qquicktrailemitter/qquicktrailemitter.pro b/tests/auto/particles/qquicktrailemitter/qquicktrailemitter.pro index e169ccdfe2..5a76e2fba4 100644 --- a/tests/auto/particles/qquicktrailemitter/qquicktrailemitter.pro +++ b/tests/auto/particles/qquicktrailemitter/qquicktrailemitter.pro @@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle include (../../shared/util.pri) TESTDATA = data/* -QT += core-private gui-private v8-private qml-private quick-private opengl-private testlib +QT += core-private gui-private v8-private qml-private quick-private testlib diff --git a/tests/auto/particles/qquickturbulence/qquickturbulence.pro b/tests/auto/particles/qquickturbulence/qquickturbulence.pro index 306d58d223..3bfb94addf 100644 --- a/tests/auto/particles/qquickturbulence/qquickturbulence.pro +++ b/tests/auto/particles/qquickturbulence/qquickturbulence.pro @@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle include (../../shared/util.pri) TESTDATA = data/* -QT += core-private gui-private v8-private qml-private quick-private opengl-private testlib +QT += core-private gui-private v8-private qml-private quick-private testlib diff --git a/tests/auto/particles/qquickwander/qquickwander.pro b/tests/auto/particles/qquickwander/qquickwander.pro index 94b88379f0..1cd4269074 100644 --- a/tests/auto/particles/qquickwander/qquickwander.pro +++ b/tests/auto/particles/qquickwander/qquickwander.pro @@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle include (../../shared/util.pri) TESTDATA = data/* -QT += core-private gui-private v8-private qml-private quick-private opengl-private testlib +QT += core-private gui-private v8-private qml-private quick-private testlib diff --git a/tests/auto/qml/debugger/qqmlinspector/app/app.pro b/tests/auto/qml/debugger/qqmlinspector/app/app.pro index f6ef983735..9c7574a97e 100644 --- a/tests/auto/qml/debugger/qqmlinspector/app/app.pro +++ b/tests/auto/qml/debugger/qqmlinspector/app/app.pro @@ -1,5 +1,5 @@ TARGET = app -QT += qml quick widgets +QT += qml quick CONFIG += declarative_debug macx:CONFIG -= app_bundle diff --git a/tests/auto/qml/qqmlincubator/qqmlincubator.pro b/tests/auto/qml/qqmlincubator/qqmlincubator.pro index b6ce22d4cf..6c4692db96 100644 --- a/tests/auto/qml/qqmlincubator/qqmlincubator.pro +++ b/tests/auto/qml/qqmlincubator/qqmlincubator.pro @@ -13,4 +13,4 @@ TESTDATA = data/* CONFIG += parallel_test -QT += core-private gui-private v8-private qml-private network widgets testlib +QT += core-private gui-private v8-private qml-private network testlib diff --git a/tests/auto/qml/qqmlinfo/qqmlinfo.pro b/tests/auto/qml/qqmlinfo/qqmlinfo.pro index 050bad68a1..891e698aeb 100644 --- a/tests/auto/qml/qqmlinfo/qqmlinfo.pro +++ b/tests/auto/qml/qqmlinfo/qqmlinfo.pro @@ -9,4 +9,4 @@ include (../../shared/util.pri) TESTDATA = data/* CONFIG += parallel_test -QT += core-private gui-private qml-private widgets testlib +QT += core-private gui-private qml-private testlib diff --git a/tests/auto/qml/qqmlmetatype/qqmlmetatype.pro b/tests/auto/qml/qqmlmetatype/qqmlmetatype.pro index 7c781dd9db..d723907024 100644 --- a/tests/auto/qml/qqmlmetatype/qqmlmetatype.pro +++ b/tests/auto/qml/qqmlmetatype/qqmlmetatype.pro @@ -4,4 +4,4 @@ SOURCES += tst_qqmlmetatype.cpp macx:CONFIG -= app_bundle CONFIG += parallel_test -QT += core-private gui-private qml-private widgets testlib +QT += core-private gui-private qml-private testlib diff --git a/tests/auto/qml/qqmlproperty/qqmlproperty.pro b/tests/auto/qml/qqmlproperty/qqmlproperty.pro index 6d878902ff..c32545dc77 100644 --- a/tests/auto/qml/qqmlproperty/qqmlproperty.pro +++ b/tests/auto/qml/qqmlproperty/qqmlproperty.pro @@ -10,4 +10,4 @@ TESTDATA = data/* CONFIG += parallel_test -QT += core-private gui-private v8-private qml-private widgets testlib +QT += core-private gui-private v8-private qml-private testlib diff --git a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp index ae300900c9..13ea1abd73 100644 --- a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp +++ b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp @@ -1553,6 +1553,8 @@ void tst_qqmlproperty::crashOnValueProperty() delete engine; engine = 0; + QSKIP("QTBUG-24734: test accesses deleted QML engine from QQmlProperty::propertyTypeName()"); + QCOMPARE(p.propertyTypeName(), "int"); QCOMPARE(p.read(), QVariant(10)); p.write(QVariant(20)); diff --git a/tests/auto/qml/qquickconnection/qquickconnection.pro b/tests/auto/qml/qquickconnection/qquickconnection.pro index baef334459..46f7971df1 100644 --- a/tests/auto/qml/qquickconnection/qquickconnection.pro +++ b/tests/auto/qml/qquickconnection/qquickconnection.pro @@ -10,4 +10,4 @@ TESTDATA = data/* CONFIG += parallel_test -QT += core-private gui-private v8-private qml-private quick-private opengl-private testlib +QT += core-private gui-private v8-private qml-private quick-private testlib diff --git a/tests/auto/qml/qquicklistmodel/qquicklistmodel.pro b/tests/auto/qml/qquicklistmodel/qquicklistmodel.pro index 25b28bbe4c..6f558a7e51 100644 --- a/tests/auto/qml/qquicklistmodel/qquicklistmodel.pro +++ b/tests/auto/qml/qquicklistmodel/qquicklistmodel.pro @@ -10,4 +10,4 @@ TESTDATA = data/* CONFIG += parallel_test -QT += core-private gui-private v8-private qml-private quick-private opengl-private testlib +QT += core-private gui-private v8-private qml-private quick-private testlib diff --git a/tests/auto/qml/qquicklistmodel/tst_qquicklistmodel.cpp b/tests/auto/qml/qquicklistmodel/tst_qquicklistmodel.cpp index 69a8d2ecd8..bf26452f0e 100644 --- a/tests/auto/qml/qquicklistmodel/tst_qquicklistmodel.cpp +++ b/tests/auto/qml/qquicklistmodel/tst_qquicklistmodel.cpp @@ -216,17 +216,21 @@ QQuickItem *tst_qquicklistmodel::createWorkerTest(QQmlEngine *eng, QQmlComponent void tst_qquicklistmodel::waitForWorker(QQuickItem *item) { + QQmlProperty prop(item, "done"); + QVERIFY(prop.isValid()); + if (prop.read().toBool()) + return; // already finished + QEventLoop loop; QTimer timer; timer.setSingleShot(true); connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit())); - QQmlProperty prop(item, "done"); - QVERIFY(prop.isValid()); QVERIFY(prop.connectNotifySignal(&loop, SLOT(quit()))); timer.start(10000); loop.exec(); QVERIFY(timer.isActive()); + QVERIFY(prop.read().toBool()); } void tst_qquicklistmodel::static_types_data() @@ -986,6 +990,8 @@ void tst_qquicklistmodel::get_worker() QCOMPARE(spyResult.at(0).toInt(), index); QCOMPARE(spyResult.at(1).toInt(), 1); // only 1 item is modified at a time QVERIFY(spyResult.at(2).value<QList<int> >().contains(role)); + + delete item; } void tst_qquicklistmodel::get_worker_data() diff --git a/tests/auto/qml/v4/data/mathAbs.qml b/tests/auto/qml/v4/data/mathAbs.qml new file mode 100644 index 0000000000..eb504ae4d8 --- /dev/null +++ b/tests/auto/qml/v4/data/mathAbs.qml @@ -0,0 +1,42 @@ +import QtQuick 2.0 + +Item { + property real test1: Math.abs(i1.p1) + property real test2: Math.abs(i1.p2) + + property int test3: Math.abs(i1.p3) + property int test4: Math.abs(i1.p4) + + property real subtest5: Math.abs() + property real subtest6: Math.abs(i1.p6) + property bool test5: isNaN(subtest5) + property bool test6: isNaN(subtest6) + + property real subtest7: Math.abs(i1.p7) + property bool test7: isNaN(subtest7) + property int test8: Math.abs(i1.p8) + + property real subtest9: Math.abs(i1.p9) + property real subtest10: Math.abs(i1.p10) + property bool test9: subtest9 === Number.POSITIVE_INFINITY + property bool test10: subtest10 === Number.POSITIVE_INFINITY + + property int test11: Math.abs(i1.p11) + property real subtest12: Math.abs(i1.p12) + property bool test12: subtest12 === 0 && (1/subtest12) === Infinity + + QtObject { + id: i1 + property real p1: -3.7 + property real p2: 4.5 + property int p3: 18 + property int p4: -72 + property real p6: Number.NaN + property string p7: "hello world" + property string p8: "82" + property real p9: Number.NEGATIVE_INFINITY + property real p10: Number.POSITIVE_INFINITY + property real p11: 0 + property real p12: -0 + } + } diff --git a/tests/auto/qml/v4/data/mathCeil.qml b/tests/auto/qml/v4/data/mathCeil.qml new file mode 100644 index 0000000000..f67838a445 --- /dev/null +++ b/tests/auto/qml/v4/data/mathCeil.qml @@ -0,0 +1,37 @@ +import QtQuick 2.0 + +Item { + property real test1: Math.ceil(i1.p1) + property real test2: Math.ceil(i1.p2) + + property real subtest3: Math.ceil() + property real subtest4: Math.ceil(i1.p4) + property bool test3: isNaN(subtest3) + property bool test4: isNaN(subtest4) + + property real subtest5: Math.ceil(i1.p5) + property bool test5: isNaN(subtest5) + property real test6: Math.ceil(i1.p6) + + property real subtest7: Math.ceil(i1.p7) + property real subtest8: Math.ceil(i1.p8) + property bool test7: subtest7 === Number.NEGATIVE_INFINITY + property bool test8: subtest8 === Number.POSITIVE_INFINITY + + property real test9: Math.ceil(i1.p9) + property real subtest10: Math.ceil(i1.p10) + property bool test10: subtest10 === 0 && (1/subtest10) === -Infinity + + QtObject { + id: i1 + property real p1: -3.7 + property real p2: 4.4 + property real p4: Number.NaN + property string p5: "hello world" + property string p6: "82.6" + property real p7: Number.NEGATIVE_INFINITY + property real p8: Number.POSITIVE_INFINITY + property real p9: 0 + property real p10: -0 + } + } diff --git a/tests/auto/qml/v4/data/mathMax.qml b/tests/auto/qml/v4/data/mathMax.qml new file mode 100644 index 0000000000..543b4994aa --- /dev/null +++ b/tests/auto/qml/v4/data/mathMax.qml @@ -0,0 +1,41 @@ +import QtQuick 2.0 + +Item { + property real test1: Math.max(i1.p1, i1.p2) + property real test2: Math.max(i1.p2, i1.p3) + + property real subtest3: Math.max() + property real subtest4: Math.max(i1.p4) + property bool test3: subtest3 === -Infinity + property bool test4: isNaN(subtest4) + + property real subtest5: Math.max(i1.p5, i1.p1) + property bool test5: isNaN(subtest5) + property real test6: Math.max(i1.p6, i1.p3) + + property real test7: Math.max(i1.p7, i1.p2) + property real subtest8: Math.max(i1.p8, i1.p2) + property bool test8: subtest8 === Number.POSITIVE_INFINITY + + property real subtest9: Math.max(i1.p10, i1.p9) + property bool test9: subtest9 === 0 && (1/subtest9) === Infinity + + property real test10: Math.max(i1.p11, i1.p1) + property real test11: Math.max(i1.p11, i1.p2) + property real test12: Math.max(i1.p1, i1.p2, i1.p3) + + QtObject { + id: i1 + property real p1: -3.7 + property real p2: 4.4 + property int p3: 7 + property real p4: Number.NaN + property string p5: "hello world" + property string p6: "82.6" + property real p7: Number.NEGATIVE_INFINITY + property real p8: Number.POSITIVE_INFINITY + property real p9: 0 + property real p10: -0 + property var p11: null + } + } diff --git a/tests/auto/qml/v4/data/mathMin.qml b/tests/auto/qml/v4/data/mathMin.qml new file mode 100644 index 0000000000..7d2a561623 --- /dev/null +++ b/tests/auto/qml/v4/data/mathMin.qml @@ -0,0 +1,41 @@ +import QtQuick 2.0 + +Item { + property real test1: Math.min(i1.p1, i1.p2) + property real test2: Math.min(i1.p2, i1.p3) + + property real subtest3: Math.min() + property real subtest4: Math.min(i1.p4) + property bool test3: subtest3 === Infinity + property bool test4: isNaN(subtest4) + + property real subtest5: Math.min(i1.p5, i1.p1) + property bool test5: isNaN(subtest5) + property real test6: Math.min(i1.p6, i1.p3) + + property real subtest7: Math.min(i1.p7, i1.p2) + property bool test7: subtest7 === Number.NEGATIVE_INFINITY + property real test8: Math.min(i1.p8, i1.p2) + + property real subtest9: Math.min(i1.p10, i1.p9) + property bool test9: subtest9 === 0 && (1/subtest9) === -Infinity + + property real test10: Math.min(i1.p11, i1.p1) + property real test11: Math.min(i1.p11, i1.p2) + property real test12: Math.min(i1.p1, i1.p2, i1.p3) + + QtObject { + id: i1 + property real p1: -3.7 + property real p2: 4.4 + property int p3: 95 + property real p4: Number.NaN + property string p5: "hello world" + property string p6: "82.6" + property real p7: Number.NEGATIVE_INFINITY + property real p8: Number.POSITIVE_INFINITY + property real p9: 0 + property real p10: -0 + property var p11: null + } + } diff --git a/tests/auto/qml/v4/tst_v4.cpp b/tests/auto/qml/v4/tst_v4.cpp index 041d9ab8e6..91a32268cf 100644 --- a/tests/auto/qml/v4/tst_v4.cpp +++ b/tests/auto/qml/v4/tst_v4.cpp @@ -75,6 +75,10 @@ private slots: void unaryMinus(); void unaryPlus(); void colorType(); + void mathAbs(); + void mathCeil(); + void mathMax(); + void mathMin(); private: QQmlEngine engine; @@ -248,7 +252,6 @@ void tst_v4::nestedObjectAccess() ResultObject *ro = qobject_cast<ResultObject *>(o); QVERIFY(ro != 0); - QEXPECT_FAIL("","QTBUG-24606", Continue); QCOMPARE(ro->result(), 37); delete o; @@ -383,6 +386,95 @@ void tst_v4::colorType() delete o; } +void tst_v4::mathAbs() +{ + QQmlComponent component(&engine, testFileUrl("mathAbs.qml")); + + QObject *o = component.create(); + QVERIFY(o != 0); + + QCOMPARE(o->property("test1").toReal(), qreal(3.7)); + QCOMPARE(o->property("test2").toReal(), qreal(4.5)); + QCOMPARE(o->property("test3").toInt(), 18); + QCOMPARE(o->property("test4").toInt(), 72); + QCOMPARE(o->property("test5").toBool(), true); + QCOMPARE(o->property("test6").toBool(), true); + QCOMPARE(o->property("test7").toBool(), true); + QCOMPARE(o->property("test8").toInt(), 82); + QCOMPARE(o->property("test9").toBool(), true); + QCOMPARE(o->property("test10").toBool(), true); + QCOMPARE(o->property("test11").toInt(), 0); + //QCOMPARE(o->property("test12").toBool(), true); //QTBUG-24706 + + delete o; +} + +void tst_v4::mathCeil() +{ + QQmlComponent component(&engine, testFileUrl("mathCeil.qml")); + + QObject *o = component.create(); + QVERIFY(o != 0); + + QCOMPARE(o->property("test1").toReal(), qreal(-3)); + QCOMPARE(o->property("test2").toReal(), qreal(5)); + QCOMPARE(o->property("test3").toBool(), true); + //QCOMPARE(o->property("test4").toBool(), true); //QTBUG-24706 + QCOMPARE(o->property("test5").toBool(), true); + QCOMPARE(o->property("test6").toReal(), qreal(83)); + //QCOMPARE(o->property("test7").toBool(), true); //QTBUG-24706 + //QCOMPARE(o->property("test8").toBool(), true); //QTBUG-24706 + QCOMPARE(o->property("test9").toInt(), 0); + //QCOMPARE(o->property("test10").toBool(), true); //QTBUG-24706 + + delete o; +} + +void tst_v4::mathMax() +{ + QQmlComponent component(&engine, testFileUrl("mathMax.qml")); + + QObject *o = component.create(); + QVERIFY(o != 0); + + QCOMPARE(o->property("test1").toReal(), qreal(4.4)); + QCOMPARE(o->property("test2").toReal(), qreal(7)); + QCOMPARE(o->property("test3").toBool(), true); + QCOMPARE(o->property("test4").toBool(), true); + QCOMPARE(o->property("test5").toBool(), true); + QCOMPARE(o->property("test6").toReal(), qreal(82.6)); + QCOMPARE(o->property("test7").toReal(), qreal(4.4)); + QCOMPARE(o->property("test8").toBool(), true); + //QCOMPARE(o->property("test9").toBool(), true); //QTBUG-24706 + QCOMPARE(o->property("test10").toReal(), qreal(0)); + QCOMPARE(o->property("test11").toReal(), qreal(4.4)); + QCOMPARE(o->property("test12").toReal(), qreal(7)); + + delete o; +} + +void tst_v4::mathMin() +{ + QQmlComponent component(&engine, testFileUrl("mathMin.qml")); + + QObject *o = component.create(); + QVERIFY(o != 0); + + QCOMPARE(o->property("test1").toReal(), qreal(-3.7)); + QCOMPARE(o->property("test2").toReal(), qreal(4.4)); + QCOMPARE(o->property("test3").toBool(), true); + QCOMPARE(o->property("test4").toBool(), true); + QCOMPARE(o->property("test5").toBool(), true); + QCOMPARE(o->property("test6").toReal(), qreal(82.6)); + QCOMPARE(o->property("test7").toBool(), true); + QCOMPARE(o->property("test8").toReal(), qreal(4.4)); + //QCOMPARE(o->property("test9").toBool(), true); //QTBUG-24706 + QCOMPARE(o->property("test10").toReal(), qreal(-3.7)); + QCOMPARE(o->property("test11").toReal(), qreal(0)); + QCOMPARE(o->property("test12").toReal(), qreal(-3.7)); + delete o; +} + QTEST_MAIN(tst_v4) #include "tst_v4.moc" diff --git a/tests/auto/quick/examples/examples.pro b/tests/auto/quick/examples/examples.pro index 5907ba291c..c320fdad9e 100644 --- a/tests/auto/quick/examples/examples.pro +++ b/tests/auto/quick/examples/examples.pro @@ -7,6 +7,6 @@ DEFINES += SRCDIR=\\\"$$PWD\\\" CONFIG += parallel_test #temporary -QT += core-private gui-private qml-private quick-private widgets-private v8-private testlib +QT += core-private gui-private qml-private quick-private v8-private testlib cross_compile: DEFINES += QTEST_CROSS_COMPILED diff --git a/tests/auto/quick/geometry/geometry.pro b/tests/auto/quick/geometry/geometry.pro index 41fcab7c8f..0b7e64d038 100644 --- a/tests/auto/quick/geometry/geometry.pro +++ b/tests/auto/quick/geometry/geometry.pro @@ -6,4 +6,4 @@ SOURCES += tst_geometry.cpp CONFIG+=parallel_test -QT += core-private gui-private qml-private quick-private opengl testlib +QT += core-private gui-private qml-private quick-private testlib diff --git a/tests/auto/quick/qquickanimations/qquickanimations.pro b/tests/auto/quick/qquickanimations/qquickanimations.pro index d9c3ea28c1..5c0bd3a2d4 100644 --- a/tests/auto/quick/qquickanimations/qquickanimations.pro +++ b/tests/auto/quick/qquickanimations/qquickanimations.pro @@ -10,7 +10,7 @@ TESTDATA = data/* CONFIG += parallel_test -QT += core-private gui-private v8-private qml-private quick-private opengl-private testlib +QT += core-private gui-private v8-private qml-private quick-private testlib widgets # QTBUG-23385 - color mixing tests failing on Ubuntu 11.10 x64 linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):DEFINES+=UBUNTU_ONEIRIC diff --git a/tests/auto/quick/qquickanimations/tst_qquickanimations.cpp b/tests/auto/quick/qquickanimations/tst_qquickanimations.cpp index dd010999b4..d71100d120 100644 --- a/tests/auto/quick/qquickanimations/tst_qquickanimations.cpp +++ b/tests/auto/quick/qquickanimations/tst_qquickanimations.cpp @@ -190,9 +190,6 @@ void tst_qquickanimations::simpleColor() QVERIFY(animation.isPaused()); animation.setCurrentTime(125); QVERIFY(animation.currentTime() == 125); -#if defined(UBUNTU_ONEIRIC) && defined(__x86_64__) - QEXPECT_FAIL("", "Fails on this platform - QTBUG-23385", Abort); -#endif QCOMPARE(rect.color(), QColor::fromRgbF(0.498039, 0, 0.498039, 1)); rect.setColor(QColor("green")); @@ -746,9 +743,6 @@ void tst_qquickanimations::mixedTypes() //rather inexact -- is there a better way? QVERIFY(myRect->x() > 100 && myRect->x() < 200); -#if defined(UBUNTU_ONEIRIC) && defined(__x86_64__) - QEXPECT_FAIL("", "Fails on this platform - QTBUG-23385", Continue); -#endif QVERIFY(myRect->color() != QColor("red") && myRect->color() != QColor("blue")); } } diff --git a/tests/auto/quick/qquickbehaviors/qquickbehaviors.pro b/tests/auto/quick/qquickbehaviors/qquickbehaviors.pro index dcffad6cd9..e8165c271c 100644 --- a/tests/auto/quick/qquickbehaviors/qquickbehaviors.pro +++ b/tests/auto/quick/qquickbehaviors/qquickbehaviors.pro @@ -10,4 +10,4 @@ TESTDATA = data/* CONFIG += parallel_test -QT += core-private gui-private v8-private qml-private quick-private opengl-private testlib +QT += core-private gui-private v8-private qml-private quick-private testlib diff --git a/tests/auto/quick/qquickborderimage/qquickborderimage.pro b/tests/auto/quick/qquickborderimage/qquickborderimage.pro index c967d579e5..998b66f89b 100644 --- a/tests/auto/quick/qquickborderimage/qquickborderimage.pro +++ b/tests/auto/quick/qquickborderimage/qquickborderimage.pro @@ -12,4 +12,4 @@ TESTDATA = data/* CONFIG += parallel_test -QT += core-private gui-private qml-private quick-private network widgets testlib +QT += core-private gui-private qml-private quick-private network testlib diff --git a/tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp b/tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp index 13b12f6020..173f230203 100644 --- a/tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp +++ b/tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp @@ -43,7 +43,6 @@ #include <QTcpServer> #include <QTcpSocket> #include <QDir> -#include <QGraphicsScene> #include <QPainter> #include <QtQml/qqmlengine.h> diff --git a/tests/auto/quick/qquickcanvasitem/qquickcanvasitem.pro b/tests/auto/quick/qquickcanvasitem/qquickcanvasitem.pro index b0122f997a..6d5706b9f7 100644 --- a/tests/auto/quick/qquickcanvasitem/qquickcanvasitem.pro +++ b/tests/auto/quick/qquickcanvasitem/qquickcanvasitem.pro @@ -1,4 +1,4 @@ -QT += core-private gui-private qml-private widgets +QT += core-private gui-private qml-private TEMPLATE=app TARGET=tst_qquickcanvasitem diff --git a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp index e46659e6d0..a2ecadf33a 100644 --- a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp +++ b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp @@ -50,7 +50,6 @@ #include "../../shared/util.h" #include "../shared/viewtestutil.h" #include "../shared/visualtestutil.h" -#include <QtOpenGL/QGLShaderProgram> using namespace QQuickViewTestUtil; using namespace QQuickVisualTestUtil; diff --git a/tests/auto/quick/qquickflipable/tst_qquickflipable.cpp b/tests/auto/quick/qquickflipable/tst_qquickflipable.cpp index 2f399359ef..4fe155168a 100644 --- a/tests/auto/quick/qquickflipable/tst_qquickflipable.cpp +++ b/tests/auto/quick/qquickflipable/tst_qquickflipable.cpp @@ -47,7 +47,6 @@ #include <QFontMetrics> #include <QtQuick/private/qquickrectangle_p.h> #include <math.h> -#include <QtOpenGL/QGLShaderProgram> #include "../../shared/util.h" class tst_qquickflipable : public QQmlDataTest diff --git a/tests/auto/quick/qquickgridview/data/multipleDisplaced.qml b/tests/auto/quick/qquickgridview/data/multipleDisplaced.qml new file mode 100644 index 0000000000..7c48bf39ae --- /dev/null +++ b/tests/auto/quick/qquickgridview/data/multipleDisplaced.qml @@ -0,0 +1,81 @@ +import QtQuick 2.0 + +Rectangle { + id: root + width: 500 + height: 600 + + property int duration: 10 + property int count: grid.count + + Component { + id: myDelegate + Rectangle { + id: wrapper + + property string nameData: name + + objectName: "wrapper" + width: 80 + height: 60 + border.width: 1 + Column { + Text { text: index } + Text { + text: wrapper.x + ", " + wrapper.y + } + Text { + id: textName + objectName: "textName" + text: name + } + } + color: GridView.isCurrentItem ? "lightsteelblue" : "white" + } + } + + GridView { + id: grid + + property var displaceTransitionsStarted: new Object() + property bool displaceTransitionsDone: false + + objectName: "grid" + focus: true + anchors.centerIn: parent + width: 240 + height: 320 + cellWidth: 80 + cellHeight: 60 + model: testModel + delegate: myDelegate + + displaced: Transition { + id: transition + SequentialAnimation { + ScriptAction { + script: { + var name = transition.ViewTransition.item.nameData + if (grid.displaceTransitionsStarted[name] == undefined) + grid.displaceTransitionsStarted[name] = 0 + grid.displaceTransitionsStarted[name] += 1 + } + } + NumberAnimation { + properties: "x,y" + duration: root.duration + easing.type: Easing.OutBounce + easing.amplitude: 10.0 // longer-lasting bounce to trigger bug + } + PropertyAction { target: grid; property: "displaceTransitionsDone"; value: true } + } + } + } + + Rectangle { + anchors.fill: grid + color: "lightsteelblue" + opacity: 0.2 + } +} + diff --git a/tests/auto/quick/qquickgridview/data/snapOneRow.qml b/tests/auto/quick/qquickgridview/data/snapOneRow.qml index 3d32d75c45..597c5efa9c 100644 --- a/tests/auto/quick/qquickgridview/data/snapOneRow.qml +++ b/tests/auto/quick/qquickgridview/data/snapOneRow.qml @@ -37,7 +37,7 @@ Rectangle { flow: GridView.TopToBottom highlightRangeMode: GridView.StrictlyEnforceRange highlight: Rectangle { width: 120; height: 120; color: "yellow" } - model: 10 + model: 8 delegate: myDelegate } diff --git a/tests/auto/quick/qquickgridview/data/snapToRow.qml b/tests/auto/quick/qquickgridview/data/snapToRow.qml index f079a048f0..e3963b0c4a 100644 --- a/tests/auto/quick/qquickgridview/data/snapToRow.qml +++ b/tests/auto/quick/qquickgridview/data/snapToRow.qml @@ -37,7 +37,7 @@ Rectangle { flow: GridView.TopToBottom highlightRangeMode: GridView.StrictlyEnforceRange highlight: Rectangle { width: 80; height: 80; color: "yellow" } - model: 54 + model: 39 delegate: myDelegate } diff --git a/tests/auto/quick/qquickgridview/qquickgridview.pro b/tests/auto/quick/qquickgridview/qquickgridview.pro index b4a234e35a..ed2007d734 100644 --- a/tests/auto/quick/qquickgridview/qquickgridview.pro +++ b/tests/auto/quick/qquickgridview/qquickgridview.pro @@ -10,4 +10,4 @@ include (../shared/util.pri) TESTDATA = data/* CONFIG += parallel_test -QT += core-private gui-private v8-private qml-private quick-private opengl-private testlib widgets +QT += core-private gui-private v8-private qml-private quick-private testlib diff --git a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp index 04bdfc8ac3..7d004915a6 100644 --- a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp +++ b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp @@ -142,6 +142,7 @@ private slots: void displacedTransitions_data(); void multipleTransitions(); void multipleTransitions_data(); + void multipleDisplaced(); private: QList<int> toIntList(const QVariantList &list); @@ -693,8 +694,7 @@ void tst_QQuickGridView::removed() QTRY_VERIFY(gridview->currentItem() != oldCurrent); gridview->setContentY(0); - // let transitions settle. - QTest::qWait(300); + QTRY_COMPARE(QQuickItemPrivate::get(gridview)->polishScheduled, false); // Confirm items positioned correctly itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); @@ -968,7 +968,7 @@ void tst_QQuickGridView::addOrRemoveBeforeVisible() QTRY_COMPARE(gridview->currentIndex(), 24); QTRY_COMPARE(gridview->contentY(), 220.0); - QTest::qWait(100); // wait for refill to complete + QTRY_COMPARE(QQuickItemPrivate::get(gridview)->polishScheduled, false); QTRY_VERIFY(!findItem<QQuickItem>(contentItem, "wrapper", 0)); // 0 shouldn't be visible if (doAdd) { @@ -2809,6 +2809,11 @@ void tst_QQuickGridView::footer() QCOMPARE(footer->height(), 30.); QCOMPARE(QPointF(gridview->contentX(), gridview->contentY()), initialContentPos); + if (flow == QQuickGridView::LeftToRight) + QCOMPARE(gridview->contentHeight(), (model.count()+2) / 3 * 60. + footer->height()); + else + QCOMPARE(gridview->contentWidth(), (model.count()+3) / 5 * 80. + footer->width()); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", 0); QVERIFY(item); QCOMPARE(item->pos(), firstDelegatePos); @@ -2970,6 +2975,11 @@ void tst_QQuickGridView::header() QCOMPARE(header->height(), 30.); QCOMPARE(QPointF(gridview->contentX(), gridview->contentY()), initialContentPos); + if (flow == QQuickGridView::LeftToRight) + QCOMPARE(gridview->contentHeight(), (model.count()+2) / 3 * 60. + header->height()); + else + QCOMPARE(gridview->contentWidth(), (model.count()+3) / 5 * 80. + header->width()); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", 0); QVERIFY(item); QCOMPARE(item->pos(), firstDelegatePos); @@ -3563,22 +3573,22 @@ void tst_QQuickGridView::snapToRow_data() QTest::addColumn<qreal>("startExtent"); QTest::newRow("vertical, left to right") << QQuickGridView::LeftToRight << Qt::LeftToRight << int(QQuickItemView::NoHighlightRange) - << QPoint(20, 200) << QPoint(20, 20) << 60.0 << 1200.0 << 0.0; + << QPoint(20, 200) << QPoint(20, 20) << 60.0 << 800.0 << 0.0; QTest::newRow("horizontal, left to right") << QQuickGridView::TopToBottom << Qt::LeftToRight << int(QQuickItemView::NoHighlightRange) - << QPoint(200, 20) << QPoint(20, 20) << 60.0 << 1200.0 << 0.0; + << QPoint(200, 20) << QPoint(20, 20) << 60.0 << 800.0 << 0.0; QTest::newRow("horizontal, right to left") << QQuickGridView::TopToBottom << Qt::RightToLeft << int(QQuickItemView::NoHighlightRange) - << QPoint(20, 20) << QPoint(200, 20) << -60.0 << -1200.0 - 240.0 << -240.0; + << QPoint(20, 20) << QPoint(200, 20) << -60.0 << -800.0 - 240.0 << -240.0; QTest::newRow("vertical, left to right, enforce range") << QQuickGridView::LeftToRight << Qt::LeftToRight << int(QQuickItemView::StrictlyEnforceRange) - << QPoint(20, 200) << QPoint(20, 20) << 60.0 << 1340.0 << -20.0; + << QPoint(20, 200) << QPoint(20, 20) << 60.0 << 940.0 << -20.0; QTest::newRow("horizontal, left to right, enforce range") << QQuickGridView::TopToBottom << Qt::LeftToRight << int(QQuickItemView::StrictlyEnforceRange) - << QPoint(200, 20) << QPoint(20, 20) << 60.0 << 1340.0 << -20.0; + << QPoint(200, 20) << QPoint(20, 20) << 60.0 << 940.0 << -20.0; QTest::newRow("horizontal, right to left, enforce range") << QQuickGridView::TopToBottom << Qt::RightToLeft << int(QQuickItemView::StrictlyEnforceRange) - << QPoint(20, 20) << QPoint(200, 20) << -60.0 << -1200.0 - 240.0 - 140.0 << -220.0; + << QPoint(20, 20) << QPoint(200, 20) << -60.0 << -800.0 - 240.0 - 140.0 << -220.0; } void tst_QQuickGridView::snapToRow() @@ -3658,22 +3668,22 @@ void tst_QQuickGridView::snapOneRow_data() QTest::addColumn<qreal>("startExtent"); QTest::newRow("vertical, left to right") << QQuickGridView::LeftToRight << Qt::LeftToRight << int(QQuickItemView::NoHighlightRange) - << QPoint(20, 200) << QPoint(20, 20) << 100.0 << 360.0 << 0.0; + << QPoint(20, 200) << QPoint(20, 20) << 100.0 << 240.0 << 0.0; QTest::newRow("horizontal, left to right") << QQuickGridView::TopToBottom << Qt::LeftToRight << int(QQuickItemView::NoHighlightRange) - << QPoint(200, 20) << QPoint(20, 20) << 100.0 << 360.0 << 0.0; + << QPoint(200, 20) << QPoint(20, 20) << 100.0 << 240.0 << 0.0; QTest::newRow("horizontal, right to left") << QQuickGridView::TopToBottom << Qt::RightToLeft << int(QQuickItemView::NoHighlightRange) - << QPoint(20, 20) << QPoint(200, 20) << -340.0 << -360.0 - 240.0 << -240.0; + << QPoint(20, 20) << QPoint(200, 20) << -340.0 << -240.0 - 240.0 << -240.0; QTest::newRow("vertical, left to right, enforce range") << QQuickGridView::LeftToRight << Qt::LeftToRight << int(QQuickItemView::StrictlyEnforceRange) - << QPoint(20, 200) << QPoint(20, 20) << 100.0 << 460.0 << -20.0; + << QPoint(20, 200) << QPoint(20, 20) << 100.0 << 340.0 << -20.0; QTest::newRow("horizontal, left to right, enforce range") << QQuickGridView::TopToBottom << Qt::LeftToRight << int(QQuickItemView::StrictlyEnforceRange) - << QPoint(200, 20) << QPoint(20, 20) << 100.0 << 460.0 << -20.0; + << QPoint(200, 20) << QPoint(20, 20) << 100.0 << 340.0 << -20.0; QTest::newRow("horizontal, right to left, enforce range") << QQuickGridView::TopToBottom << Qt::RightToLeft << int(QQuickItemView::StrictlyEnforceRange) - << QPoint(20, 20) << QPoint(200, 20) << -340.0 << -360.0 - 240.0 - 100.0 << -220.0; + << QPoint(20, 20) << QPoint(200, 20) << -340.0 << -240.0 - 240.0 - 100.0 << -220.0; } void tst_QQuickGridView::snapOneRow() @@ -3728,8 +3738,8 @@ void tst_QQuickGridView::snapOneRow() : layoutDirection == Qt::LeftToRight ? !gridview->isAtXEnd() : !gridview->isAtXBeginning()); if (QQuickItemView::HighlightRangeMode(highlightRangeMode) == QQuickItemView::StrictlyEnforceRange) { - QCOMPARE(gridview->currentIndex(), 8); - QCOMPARE(currentIndexSpy.count(), 4); + QCOMPARE(gridview->currentIndex(), 6); + QCOMPARE(currentIndexSpy.count(), 3); } if (flow == QQuickGridView::LeftToRight) @@ -3752,7 +3762,7 @@ void tst_QQuickGridView::snapOneRow() if (QQuickItemView::HighlightRangeMode(highlightRangeMode) == QQuickItemView::StrictlyEnforceRange) { QCOMPARE(gridview->currentIndex(), 0); - QCOMPARE(currentIndexSpy.count(), 8); + QCOMPARE(currentIndexSpy.count(), 6); } delete canvas; @@ -4975,6 +4985,55 @@ void tst_QQuickGridView::multipleTransitions_data() << true << true << false << false; } +void tst_QQuickGridView::multipleDisplaced() +{ + // multiple move() operations should only restart displace transitions for items that + // moved from previously set positions, and not those that have moved from their current + // item positions (which may e.g. still be changing from easing bounces in the last transition) + + QmlListModel model; + for (int i = 0; i < 30; i++) + model.addItem("Original item" + QString::number(i), ""); + + QQuickView *canvas = createView(); + QQmlContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testModel", &model); + canvas->setSource(testFileUrl("multipleDisplaced.qml")); + canvas->show(); + QTest::qWaitForWindowShown(canvas); + + QQuickGridView *gridview = findItem<QQuickGridView>(canvas->rootObject(), "grid"); + QTRY_VERIFY(gridview != 0); + QQuickItem *contentItem = gridview->contentItem(); + QVERIFY(contentItem != 0); + QTRY_COMPARE(QQuickItemPrivate::get(gridview)->polishScheduled, false); + + model.moveItems(12, 8, 1); + QTest::qWait(canvas->rootObject()->property("duration").toInt() / 2); + model.moveItems(8, 3, 1); + QTRY_VERIFY(gridview->property("displaceTransitionsDone").toBool()); + + QVariantMap transitionsStarted = gridview->property("displaceTransitionsStarted").toMap(); + foreach (const QString &name, transitionsStarted.keys()) { + QVERIFY2(transitionsStarted[name] == 1, + QTest::toString(QString("%1 was displaced %2 times").arg(name).arg(transitionsStarted[name].toInt()))); + } + + // verify all items moved to the correct final positions + QList<QQuickItem*> items = findItems<QQuickItem>(contentItem, "wrapper"); + for (int i=0; i < model.count() && i < items.count(); ++i) { + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); + QVERIFY2(item, QTest::toString(QString("Item %1 not found").arg(i))); + QTRY_COMPARE(item->x(), (i%3)*80.0); + QTRY_COMPARE(item->y(), (i/3)*60.0); + QQuickText *name = findItem<QQuickText>(contentItem, "textName", i); + QVERIFY(name != 0); + QTRY_COMPARE(name->text(), model.name(i)); + } + + delete canvas; +} + void tst_QQuickGridView::cacheBuffer() { QQuickView *canvas = createView(); diff --git a/tests/auto/quick/qquickitem/qquickitem.pro b/tests/auto/quick/qquickitem/qquickitem.pro index cbbd6e586b..ee40be6a2e 100644 --- a/tests/auto/quick/qquickitem/qquickitem.pro +++ b/tests/auto/quick/qquickitem/qquickitem.pro @@ -9,4 +9,4 @@ macx:CONFIG -= app_bundle TESTDATA = data/* CONFIG += parallel_test -QT += core-private gui-private v8-private qml-private quick-private widgets testlib +QT += core-private gui-private v8-private qml-private quick-private testlib diff --git a/tests/auto/quick/qquickitem2/qquickitem2.pro b/tests/auto/quick/qquickitem2/qquickitem2.pro index 887c8796a8..589d1bd568 100644 --- a/tests/auto/quick/qquickitem2/qquickitem2.pro +++ b/tests/auto/quick/qquickitem2/qquickitem2.pro @@ -10,4 +10,4 @@ TESTDATA = data/* CONFIG += parallel_test -QT += core-private gui-private v8-private qml-private quick-private opengl-private testlib +QT += core-private gui-private v8-private qml-private quick-private testlib diff --git a/tests/auto/quick/qquicklistview/data/multipleDisplaced.qml b/tests/auto/quick/qquicklistview/data/multipleDisplaced.qml new file mode 100644 index 0000000000..e315270360 --- /dev/null +++ b/tests/auto/quick/qquicklistview/data/multipleDisplaced.qml @@ -0,0 +1,78 @@ +import QtQuick 2.0 + +Rectangle { + id: root + width: 500 + height: 600 + + property int duration: 10 + property int count: list.count + + Component { + id: myDelegate + Rectangle { + id: wrapper + + property string nameData: name + + objectName: "wrapper" + height: 20 + width: 240 + Text { text: index } + Text { + x: 30 + id: textName + objectName: "textName" + text: name + } + Text { + x: 200 + text: wrapper.y + } + color: ListView.isCurrentItem ? "lightsteelblue" : "white" + } + } + + ListView { + id: list + + property var displaceTransitionsStarted: new Object() + property bool displaceTransitionsDone: false + + objectName: "list" + focus: true + anchors.centerIn: parent + width: 240 + height: 320 + model: testModel + delegate: myDelegate + + displaced: Transition { + id: transition + SequentialAnimation { + ScriptAction { + script: { + var name = transition.ViewTransition.item.nameData + if (list.displaceTransitionsStarted[name] == undefined) + list.displaceTransitionsStarted[name] = 0 + list.displaceTransitionsStarted[name] += 1 + } + } + NumberAnimation { + properties: "x,y" + duration: root.duration + easing.type: Easing.OutBounce + easing.amplitude: 10.0 // longer-lasting bounce to trigger bug + } + PropertyAction { target: list; property: "displaceTransitionsDone"; value: true } + } + } + } + + Rectangle { + anchors.fill: list + color: "lightsteelblue" + opacity: 0.2 + } +} + diff --git a/tests/auto/quick/qquicklistview/data/snapToItem.qml b/tests/auto/quick/qquicklistview/data/snapToItem.qml index 6f201072f0..91d31adfc7 100644 --- a/tests/auto/quick/qquicklistview/data/snapToItem.qml +++ b/tests/auto/quick/qquicklistview/data/snapToItem.qml @@ -37,7 +37,7 @@ Rectangle { layoutDirection: Qt.RightToLeft highlightRangeMode: ListView.StrictlyEnforceRange highlight: Rectangle { width: 80; height: 80; color: "yellow" } - model: 18 + model: 10 delegate: myDelegate } diff --git a/tests/auto/quick/qquicklistview/qquicklistview.pro b/tests/auto/quick/qquicklistview/qquicklistview.pro index d4d97e2106..c1b24baed4 100644 --- a/tests/auto/quick/qquicklistview/qquicklistview.pro +++ b/tests/auto/quick/qquicklistview/qquicklistview.pro @@ -11,4 +11,4 @@ include (../shared/util.pri) TESTDATA = data/* -QT += core-private gui-private qml-private quick-private widgets widgets-private v8-private opengl-private testlib +QT += core-private gui-private qml-private quick-private v8-private testlib diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp index c038faa0f1..1a494183a8 100644 --- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp +++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp @@ -183,6 +183,7 @@ private slots: void displacedTransitions_data(); void multipleTransitions(); void multipleTransitions_data(); + void multipleDisplaced(); void flickBeyondBounds(); @@ -826,7 +827,6 @@ void tst_QQuickListView::removed(const QUrl &source, bool /* animated */) listview->setContentY(20); // That's the top now // let transitions settle. QTRY_COMPARE(QQuickItemPrivate::get(listview)->polishScheduled, false); - QTest::qWait(300); // Confirm items positioned correctly itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); @@ -857,7 +857,6 @@ void tst_QQuickListView::removed(const QUrl &source, bool /* animated */) listview->setContentY(80); QTRY_COMPARE(QQuickItemPrivate::get(listview)->polishScheduled, false); - QTest::qWait(300); // remove all visible items model.removeItems(1, 18); @@ -3056,6 +3055,11 @@ void tst_QQuickListView::header() QCOMPARE(header->pos(), initialHeaderPos); QCOMPARE(QPointF(listview->contentX(), listview->contentY()), initialContentPos); + if (orientation == QQuickListView::Vertical) + QCOMPARE(listview->contentHeight(), model.count() * 30. + header->height()); + else + QCOMPARE(listview->contentWidth(), model.count() * 240. + header->width()); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", 0); QVERIFY(item); QCOMPARE(item->pos(), firstDelegatePos); @@ -3240,6 +3244,11 @@ void tst_QQuickListView::footer() QCOMPARE(footer->height(), 30.); QCOMPARE(QPointF(listview->contentX(), listview->contentY()), initialContentPos); + if (orientation == QQuickListView::Vertical) + QCOMPARE(listview->contentHeight(), model.count() * 20. + footer->height()); + else + QCOMPARE(listview->contentWidth(), model.count() * 40. + footer->width()); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", 0); QVERIFY(item); QCOMPARE(item->pos(), firstDelegatePos); @@ -4240,22 +4249,22 @@ void tst_QQuickListView::snapToItem_data() QTest::addColumn<qreal>("startExtent"); QTest::newRow("vertical, left to right") << QQuickListView::Vertical << Qt::LeftToRight << int(QQuickItemView::NoHighlightRange) - << QPoint(20, 200) << QPoint(20, 20) << 60.0 << 1200.0 << 0.0; + << QPoint(20, 200) << QPoint(20, 20) << 60.0 << 560.0 << 0.0; QTest::newRow("horizontal, left to right") << QQuickListView::Horizontal << Qt::LeftToRight << int(QQuickItemView::NoHighlightRange) - << QPoint(200, 20) << QPoint(20, 20) << 60.0 << 1200.0 << 0.0; + << QPoint(200, 20) << QPoint(20, 20) << 60.0 << 560.0 << 0.0; QTest::newRow("horizontal, right to left") << QQuickListView::Horizontal << Qt::RightToLeft << int(QQuickItemView::NoHighlightRange) - << QPoint(20, 20) << QPoint(200, 20) << -60.0 << -1200.0 - 240.0 << -240.0; + << QPoint(20, 20) << QPoint(200, 20) << -60.0 << -560.0 - 240.0 << -240.0; QTest::newRow("vertical, left to right, enforce range") << QQuickListView::Vertical << Qt::LeftToRight << int(QQuickItemView::StrictlyEnforceRange) - << QPoint(20, 200) << QPoint(20, 20) << 60.0 << 1340.0 << -20.0; + << QPoint(20, 200) << QPoint(20, 20) << 60.0 << 700.0 << -20.0; QTest::newRow("horizontal, left to right, enforce range") << QQuickListView::Horizontal << Qt::LeftToRight << int(QQuickItemView::StrictlyEnforceRange) - << QPoint(200, 20) << QPoint(20, 20) << 60.0 << 1340.0 << -20.0; + << QPoint(200, 20) << QPoint(20, 20) << 60.0 << 700.0 << -20.0; QTest::newRow("horizontal, right to left, enforce range") << QQuickListView::Horizontal << Qt::RightToLeft << int(QQuickItemView::StrictlyEnforceRange) - << QPoint(20, 20) << QPoint(200, 20) << -60.0 << -1200.0 - 240.0 - 140.0 << -220.0; + << QPoint(20, 20) << QPoint(200, 20) << -60.0 << -560.0 - 240.0 - 140.0 << -220.0; } void tst_QQuickListView::snapToItem() @@ -5977,6 +5986,56 @@ void tst_QQuickListView::multipleTransitions_data() << true << true << false << false; } +void tst_QQuickListView::multipleDisplaced() +{ + // multiple move() operations should only restart displace transitions for items that + // moved from previously set positions, and not those that have moved from their current + // item positions (which may e.g. still be changing from easing bounces in the last transition) + + QmlListModel model; + for (int i = 0; i < 30; i++) + model.addItem("Original item" + QString::number(i), ""); + + QQuickView *canvas = createView(); + QQmlContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testModel", &model); + ctxt->setContextProperty("testObject", new TestObject(canvas)); + canvas->setSource(testFileUrl("multipleDisplaced.qml")); + canvas->show(); + QTest::qWaitForWindowShown(canvas); + + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); + QTRY_VERIFY(listview != 0); + QQuickItem *contentItem = listview->contentItem(); + QVERIFY(contentItem != 0); + QTRY_COMPARE(QQuickItemPrivate::get(listview)->polishScheduled, false); + + model.moveItems(12, 8, 1); + QTest::qWait(canvas->rootObject()->property("duration").toInt() / 2); + model.moveItems(8, 3, 1); + QTRY_VERIFY(listview->property("displaceTransitionsDone").toBool()); + + QVariantMap transitionsStarted = listview->property("displaceTransitionsStarted").toMap(); + foreach (const QString &name, transitionsStarted.keys()) { + QVERIFY2(transitionsStarted[name] == 1, + QTest::toString(QString("%1 was displaced %2 times").arg(name).arg(transitionsStarted[name].toInt()))); + } + + // verify all items moved to the correct final positions + QList<QQuickItem*> items = findItems<QQuickItem>(contentItem, "wrapper"); + for (int i=0; i < model.count() && i < items.count(); ++i) { + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); + QVERIFY2(item, QTest::toString(QString("Item %1 not found").arg(i))); + QTRY_COMPARE(item->x(), 0.0); + QTRY_COMPARE(item->y(), i*20.0); + QQuickText *name = findItem<QQuickText>(contentItem, "textName", i); + QVERIFY(name != 0); + QTRY_COMPARE(name->text(), model.name(i)); + } + + delete canvas; +} + QList<int> tst_QQuickListView::toIntList(const QVariantList &list) { QList<int> ret; diff --git a/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp b/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp index 0b4a6fa438..a4b04bb88a 100644 --- a/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp +++ b/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp @@ -47,7 +47,6 @@ #include <QtQuick/qquickview.h> #include <QtQml/qqmlcontext.h> #include <QtQml/qqmlengine.h> -#include <QtOpenGL/QGLShaderProgram> #include "../../shared/util.h" //#define OLDWAY @@ -468,6 +467,8 @@ void tst_QQuickMouseArea::doubleClick() canvas->requestActivateWindow(); QVERIFY(canvas->rootObject() != 0); + // The sequence for a double click is: + // press, release, (click), press, double click, release QMouseEvent pressEvent(QEvent::MouseButtonPress, QPoint(100, 100), Qt::LeftButton, Qt::LeftButton, 0); QGuiApplication::sendEvent(canvas, &pressEvent); @@ -476,9 +477,9 @@ void tst_QQuickMouseArea::doubleClick() QCOMPARE(canvas->rootObject()->property("released").toInt(), 1); + QGuiApplication::sendEvent(canvas, &pressEvent); pressEvent = QMouseEvent(QEvent::MouseButtonDblClick, QPoint(100, 100), Qt::LeftButton, Qt::LeftButton, 0); QGuiApplication::sendEvent(canvas, &pressEvent); - QGuiApplication::sendEvent(canvas, &releaseEvent); QCOMPARE(canvas->rootObject()->property("clicked").toInt(), 1); @@ -507,9 +508,8 @@ void tst_QQuickMouseArea::clickTwice() QCOMPARE(canvas->rootObject()->property("released").toInt(), 1); QCOMPARE(canvas->rootObject()->property("clicked").toInt(), 1); - pressEvent = QMouseEvent(QEvent::MouseButtonDblClick, QPoint(100, 100), Qt::LeftButton, Qt::LeftButton, 0); QGuiApplication::sendEvent(canvas, &pressEvent); - + pressEvent = QMouseEvent(QEvent::MouseButtonDblClick, QPoint(100, 100), Qt::LeftButton, Qt::LeftButton, 0); QGuiApplication::sendEvent(canvas, &pressEvent); QGuiApplication::sendEvent(canvas, &releaseEvent); @@ -787,13 +787,17 @@ void tst_QQuickMouseArea::hoverVisible() QSignalSpy enteredSpy(mouseTracker, SIGNAL(entered())); - QTest::mouseMove(canvas,QPoint(10,32)); + // Note: We need to use a position that is different from the position in the last event + // generated in the previous test case. Otherwise it is not interpreted as a move. + QTest::mouseMove(canvas,QPoint(11,33)); QCOMPARE(mouseTracker->hovered(), false); QCOMPARE(enteredSpy.count(), 0); mouseTracker->setVisible(true); + QTest::mouseMove(canvas,QPoint(10,31)); + QCOMPARE(mouseTracker->hovered(), true); QCOMPARE(enteredSpy.count(), 1); diff --git a/tests/auto/quick/qquickpixmapcache/qquickpixmapcache.pro b/tests/auto/quick/qquickpixmapcache/qquickpixmapcache.pro index a13b0b6f43..a24ea52e11 100644 --- a/tests/auto/quick/qquickpixmapcache/qquickpixmapcache.pro +++ b/tests/auto/quick/qquickpixmapcache/qquickpixmapcache.pro @@ -15,5 +15,6 @@ TESTDATA = data/* # LIBS += -lgcov CONFIG += parallel_test +CONFIG += insignificant_test QT += core-private gui-private qml-private quick-private network testlib concurrent diff --git a/tests/auto/quick/qquickpositioners/qquickpositioners.pro b/tests/auto/quick/qquickpositioners/qquickpositioners.pro index 243d03484a..dbbfae0ebf 100644 --- a/tests/auto/quick/qquickpositioners/qquickpositioners.pro +++ b/tests/auto/quick/qquickpositioners/qquickpositioners.pro @@ -10,4 +10,4 @@ macx:CONFIG -= app_bundle TESTDATA = data/* CONFIG += parallel_test -QT += core-private gui-private v8-private qml-private quick-private opengl-private testlib +QT += core-private gui-private v8-private qml-private quick-private testlib diff --git a/tests/auto/quick/qquickrepeater/data/dynamicmodelcrash.qml b/tests/auto/quick/qquickrepeater/data/dynamicmodelcrash.qml new file mode 100644 index 0000000000..0280df0620 --- /dev/null +++ b/tests/auto/quick/qquickrepeater/data/dynamicmodelcrash.qml @@ -0,0 +1,20 @@ +import QtQuick 2.0 + +Item { + ListModel { + id: lm; + } + + Component.onCompleted: { + lm.append({ subModel: [ {d:0} ] }); + rep.model = lm.get(0).subModel; + rep.model; + lm.remove(0); + rep.model; + } + + Repeater { + objectName: "rep" + id: rep + } +} diff --git a/tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp b/tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp index 1b07a6e9f8..d9cbed093a 100644 --- a/tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp +++ b/tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp @@ -77,6 +77,7 @@ private slots: void properties(); void asynchronous(); void initParent(); + void dynamicModelCrash(); }; class TestObject : public QObject @@ -639,6 +640,20 @@ void tst_QQuickRepeater::initParent() QCOMPARE(qvariant_cast<QQuickItem*>(rootObject->property("parentItem")), rootObject); } +void tst_QQuickRepeater::dynamicModelCrash() +{ + QQmlEngine engine; + QQmlComponent component(&engine, testFileUrl("dynamicmodelcrash.qml")); + + // Don't crash + QQuickItem *rootObject = qobject_cast<QQuickItem*>(component.create()); + QVERIFY(rootObject); + + QQuickRepeater *repeater = findItem<QQuickRepeater>(rootObject, "rep"); + QVERIFY(repeater); + QVERIFY(qvariant_cast<QObject *>(repeater->model()) == 0); +} + QTEST_MAIN(tst_QQuickRepeater) #include "tst_qquickrepeater.moc" diff --git a/tests/auto/quick/qquickshadereffect/qquickshadereffect.pro b/tests/auto/quick/qquickshadereffect/qquickshadereffect.pro index 6ff50a0553..142d368aed 100644 --- a/tests/auto/quick/qquickshadereffect/qquickshadereffect.pro +++ b/tests/auto/quick/qquickshadereffect/qquickshadereffect.pro @@ -5,4 +5,4 @@ SOURCES += tst_qquickshadereffect.cpp macx:CONFIG -= app_bundle CONFIG += parallel_test -QT += core-private gui-private qml-private quick-private widgets testlib +QT += core-private gui-private qml-private quick-private testlib diff --git a/tests/auto/quick/qquickstates/qquickstates.pro b/tests/auto/quick/qquickstates/qquickstates.pro index 5f2b8cd2de..783e1097dd 100644 --- a/tests/auto/quick/qquickstates/qquickstates.pro +++ b/tests/auto/quick/qquickstates/qquickstates.pro @@ -9,4 +9,4 @@ include (../../shared/util.pri) TESTDATA = data/* CONFIG += parallel_test -QT += core-private gui-private v8-private qml-private quick-private opengl-private testlib +QT += core-private gui-private v8-private qml-private quick-private testlib diff --git a/tests/auto/quick/qquicktext/qquicktext.pro b/tests/auto/quick/qquicktext/qquicktext.pro index 53e170a115..8932664fa3 100644 --- a/tests/auto/quick/qquicktext/qquicktext.pro +++ b/tests/auto/quick/qquicktext/qquicktext.pro @@ -14,4 +14,4 @@ TESTDATA = data/* CONFIG += parallel_test -QT += core-private gui-private v8-private qml-private quick-private widgets-private opengl-private network testlib +QT += core-private gui-private v8-private qml-private quick-private network testlib diff --git a/tests/auto/quick/qquicktext/tst_qquicktext.cpp b/tests/auto/quick/qquicktext/tst_qquicktext.cpp index 54b5a04466..92e8528a0d 100644 --- a/tests/auto/quick/qquicktext/tst_qquicktext.cpp +++ b/tests/auto/quick/qquicktext/tst_qquicktext.cpp @@ -47,10 +47,9 @@ #include <private/qquicktext_p_p.h> #include <private/qqmlvaluetype_p.h> #include <QFontMetrics> -#include <QGraphicsSceneMouseEvent> #include <qmath.h> #include <QtQuick/QQuickView> -#include <private/qapplication_p.h> +#include <private/qguiapplication_p.h> #include <limits.h> #include <QtGui/QMouseEvent> #include "../../shared/util.h" diff --git a/tests/auto/quick/qquicktextedit/qquicktextedit.pro b/tests/auto/quick/qquicktextedit/qquicktextedit.pro index 23459f2a91..83250030de 100644 --- a/tests/auto/quick/qquicktextedit/qquicktextedit.pro +++ b/tests/auto/quick/qquicktextedit/qquicktextedit.pro @@ -11,4 +11,4 @@ include (../../shared/util.pri) TESTDATA = data/* -QT += core-private gui-private v8-private qml-private quick-private opengl-private network widgets-private testlib +QT += core-private gui-private v8-private qml-private quick-private network-private testlib diff --git a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp index 85a9033dd7..a90b23dfd7 100644 --- a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp +++ b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp @@ -55,7 +55,6 @@ #include <QFontMetrics> #include <QtQuick/QQuickView> #include <QDir> -#include <QStyle> #include <QInputMethod> #include <QClipboard> #include <QMimeData> @@ -1855,6 +1854,7 @@ void tst_qquicktextedit::cursorDelegate() textEditObject->setSelectByMouse(true); textEditObject->setCursorPosition(0); const QPoint point1 = textEditObject->positionToRectangle(5).center().toPoint(); + QTest::qWait(400); //ensure this isn't treated as a double-click QTest::mouseClick(&view, Qt::LeftButton, 0, point1); QTest::qWait(50); QTRY_VERIFY(textEditObject->cursorPosition() != 0); @@ -1864,6 +1864,7 @@ void tst_qquicktextedit::cursorDelegate() // Test delegate gets moved on mouse drag textEditObject->setCursorPosition(0); const QPoint point2 = textEditObject->positionToRectangle(10).center().toPoint(); + QTest::qWait(400); //ensure this isn't treated as a double-click QTest::mousePress(&view, Qt::LeftButton, 0, point1); QMouseEvent mv(QEvent::MouseMove, point2, Qt::LeftButton, Qt::LeftButton,Qt::NoModifier); QGuiApplication::sendEvent(&view, &mv); @@ -1874,6 +1875,7 @@ void tst_qquicktextedit::cursorDelegate() textEditObject->setReadOnly(true); textEditObject->setCursorPosition(0); + QTest::qWait(400); //ensure this isn't treated as a double-click QTest::mouseClick(&view, Qt::LeftButton, 0, textEditObject->positionToRectangle(5).center().toPoint()); QTest::qWait(50); QTRY_VERIFY(textEditObject->cursorPosition() != 0); @@ -1881,6 +1883,7 @@ void tst_qquicktextedit::cursorDelegate() QCOMPARE(textEditObject->cursorRectangle().y(), delegateObject->y()); textEditObject->setCursorPosition(0); + QTest::qWait(400); //ensure this isn't treated as a double-click QTest::mouseClick(&view, Qt::LeftButton, 0, textEditObject->positionToRectangle(5).center().toPoint()); QTest::qWait(50); QTRY_VERIFY(textEditObject->cursorPosition() != 0); diff --git a/tests/auto/quick/qquicktextinput/qquicktextinput.pro b/tests/auto/quick/qquicktextinput/qquicktextinput.pro index 046e6abcad..13b087eef5 100644 --- a/tests/auto/quick/qquicktextinput/qquicktextinput.pro +++ b/tests/auto/quick/qquicktextinput/qquicktextinput.pro @@ -8,4 +8,4 @@ include (../../shared/util.pri) TESTDATA = data/* -QT += core-private gui-private v8-private qml-private quick-private opengl-private testlib +QT += core-private gui-private v8-private qml-private quick-private testlib diff --git a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp index bdd18d620e..c5db92af45 100644 --- a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp +++ b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp @@ -53,8 +53,6 @@ #include <private/qquicktextinput_p_p.h> #include <QDebug> #include <QDir> -#include <QStyle> -#include <QtOpenGL/QGLShaderProgram> #include <math.h> #ifdef Q_OS_MAC |