diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2010-10-25 10:54:16 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2010-10-25 10:54:16 (GMT) |
commit | cb50699b39e016a64a2a06088042622546c428a2 (patch) | |
tree | 77d269a3103a6c140098b9caaafd17a29a81addd /tests/auto/declarative/qdeclarativelanguage | |
parent | 89807f70656b95c1568ef183dd7f28c527fc3eaa (diff) | |
parent | 890c1110ec5e39bb6e63e99fe09c296c1ea824be (diff) | |
download | Qt-cb50699b39e016a64a2a06088042622546c428a2.zip Qt-cb50699b39e016a64a2a06088042622546c428a2.tar.gz Qt-cb50699b39e016a64a2a06088042622546c428a2.tar.bz2 |
Merge remote branch 'origin/4.7' into qt-master-from-4.7
Conflicts:
demos/declarative/snake/snake.qml
qmake/generators/symbian/symbiancommon.cpp
src/network/access/qnetworkaccessmanager.cpp
src/s60installs/s60installs.pro
tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp
tests/auto/qnetworkreply/tst_qnetworkreply.cpp
Diffstat (limited to 'tests/auto/declarative/qdeclarativelanguage')
5 files changed, 90 insertions, 6 deletions
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/AliasPropertyChangeSignalsType.qml b/tests/auto/declarative/qdeclarativelanguage/data/AliasPropertyChangeSignalsType.qml new file mode 100644 index 0000000..0bc2025 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/AliasPropertyChangeSignalsType.qml @@ -0,0 +1,20 @@ +import QtQuick 1.0 + +QtObject { + id: root + + signal sig1 + signal sig2 + signal sig3 + signal sig4 + + property alias aliasProperty: root.realProperty + + property int realProperty: 0 + + property bool test: false + + Component.onCompleted: { + root.realProperty = 10; + } +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.2.qml new file mode 100644 index 0000000..a15a718 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.2.qml @@ -0,0 +1,10 @@ +import QtQuick 1.0 + +AliasPropertyChangeSignalsType { + id: root + onAliasPropertyChanged: root.test = true + + function blah() {} + property int a +} + diff --git a/tests/auto/declarative/qdeclarativelanguage/data/insertedSemicolon.1.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/insertedSemicolon.1.errors.txt new file mode 100644 index 0000000..651009c --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/insertedSemicolon.1.errors.txt @@ -0,0 +1 @@ +9:5:Expected a qualified name id diff --git a/tests/auto/declarative/qdeclarativelanguage/data/insertedSemicolon.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/insertedSemicolon.1.qml new file mode 100644 index 0000000..4e561b4 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/insertedSemicolon.1.qml @@ -0,0 +1,10 @@ +import Test 1.0 + +MyQmlObject { + function foo() + { + return + } + + 1223 +} diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index 061ac48..50463b7 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -86,6 +86,9 @@ private slots: void errors_data(); void errors(); + void insertedSemicolon_data(); + void insertedSemicolon(); + void simpleObject(); void simpleContainer(); void interfaceProperty(); @@ -211,6 +214,31 @@ void tst_qdeclarativelanguage::cleanupTestCase() QVERIFY(QFile::remove(TEST_FILE(QString::fromUtf8("I18nType\303\201\303\242\303\243\303\244\303\245.qml")).toLocalFile())); } +void tst_qdeclarativelanguage::insertedSemicolon_data() +{ + QTest::addColumn<QString>("file"); + QTest::addColumn<QString>("errorFile"); + QTest::addColumn<bool>("create"); + + QTest::newRow("insertedSemicolon.1") << "insertedSemicolon.1.qml" << "insertedSemicolon.1.errors.txt" << false; +} + +void tst_qdeclarativelanguage::insertedSemicolon() +{ + QFETCH(QString, file); + QFETCH(QString, errorFile); + QFETCH(bool, create); + + QDeclarativeComponent component(&engine, TEST_FILE(file)); + + if(create) { + QObject *object = component.create(); + QVERIFY(object == 0); + } + + VERIFY_ERRORS(errorFile.toLatin1().constData()); +} + void tst_qdeclarativelanguage::errors_data() { QTest::addColumn<QString>("file"); @@ -1890,15 +1918,30 @@ void tst_qdeclarativelanguage::initTestCase() void tst_qdeclarativelanguage::aliasPropertyChangeSignals() { - QDeclarativeComponent component(&engine, TEST_FILE("aliasPropertyChangeSignals.qml")); + { + QDeclarativeComponent component(&engine, TEST_FILE("aliasPropertyChangeSignals.qml")); - VERIFY_ERRORS(0); - QObject *o = component.create(); - QVERIFY(o != 0); + VERIFY_ERRORS(0); + QObject *o = component.create(); + QVERIFY(o != 0); - QCOMPARE(o->property("test").toBool(), true); + QCOMPARE(o->property("test").toBool(), true); - delete o; + delete o; + } + + // QTCREATORBUG-2769 + { + QDeclarativeComponent component(&engine, TEST_FILE("aliasPropertyChangeSignals.2.qml")); + + VERIFY_ERRORS(0); + QObject *o = component.create(); + QVERIFY(o != 0); + + QCOMPARE(o->property("test").toBool(), true); + + delete o; + } } QTEST_MAIN(tst_qdeclarativelanguage) |