diff options
Diffstat (limited to 'tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp')
-rw-r--r-- | tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp | 55 |
1 files changed, 49 insertions, 6 deletions
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) |