diff options
author | Martin Jones <martin.jones@nokia.com> | 2011-01-27 06:52:54 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2011-01-27 06:52:54 (GMT) |
commit | ab71df83ba4eb9d749efc0f3a2d4a0fe5486023f (patch) | |
tree | 4605ab304db27aeec693a154418f2fbffbdebfc2 /tests/auto/declarative/qdeclarativetext | |
parent | 5d2817cd668a705729df1727de49adf00713ac97 (diff) | |
download | Qt-ab71df83ba4eb9d749efc0f3a2d4a0fe5486023f.zip Qt-ab71df83ba4eb9d749efc0f3a2d4a0fe5486023f.tar.gz Qt-ab71df83ba4eb9d749efc0f3a2d4a0fe5486023f.tar.bz2 |
Add missing revisions for QtQuick 1.1 additions
Task-number: QTBUG-15279
Reviewed-by: Michael Brasser
Diffstat (limited to 'tests/auto/declarative/qdeclarativetext')
-rw-r--r-- | tests/auto/declarative/qdeclarativetext/data/lineCount.qml | 2 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp | 41 |
2 files changed, 42 insertions, 1 deletions
diff --git a/tests/auto/declarative/qdeclarativetext/data/lineCount.qml b/tests/auto/declarative/qdeclarativetext/data/lineCount.qml index b3d7bc1..63817f6 100644 --- a/tests/auto/declarative/qdeclarativetext/data/lineCount.qml +++ b/tests/auto/declarative/qdeclarativetext/data/lineCount.qml @@ -1,4 +1,4 @@ -import QtQuick 1.0 +import QtQuick 1.1 Item { width: 200 diff --git a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp index faea448..fabae18 100644 --- a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp +++ b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp @@ -103,6 +103,8 @@ private slots: void QTBUG_12291(); void implicitSize_data(); void implicitSize(); + void testQtQuick11Attributes(); + void testQtQuick11Attributes_data(); private: QStringList standard; @@ -1079,6 +1081,45 @@ void tst_qdeclarativetext::implicitSize() QVERIFY(textObject->height() == textObject->implicitHeight()); } +void tst_qdeclarativetext::testQtQuick11Attributes() +{ + QFETCH(QString, code); + QFETCH(QString, warning); + QFETCH(QString, error); + + QDeclarativeEngine engine; + QObject *obj; + + QDeclarativeComponent valid(&engine); + valid.setData("import QtQuick 1.1; Text { " + code.toUtf8() + " }", QUrl("")); + obj = valid.create(); + QVERIFY(obj); + QVERIFY(valid.errorString().isEmpty()); + delete obj; + + QDeclarativeComponent invalid(&engine); + invalid.setData("import QtQuick 1.0; Text { " + code.toUtf8() + " }", QUrl("")); + QTest::ignoreMessage(QtWarningMsg, warning.toUtf8()); + obj = invalid.create(); + QCOMPARE(invalid.errorString(), error); + delete obj; +} + +void tst_qdeclarativetext::testQtQuick11Attributes_data() +{ + QTest::addColumn<QString>("code"); + QTest::addColumn<QString>("warning"); + QTest::addColumn<QString>("error"); + + QTest::newRow("maximumLineCount") << "maximumLineCount: 4" + << "QDeclarativeComponent: Component is not ready" + << ":1 \"Text.maximumLineCount\" is not available in QtQuick 1.0.\n"; + + QTest::newRow("truncated") << "property int foo: lineCount" + << "<Unknown File>:1: ReferenceError: Can't find variable: lineCount" + << ""; +} + QTEST_MAIN(tst_qdeclarativetext) #include "tst_qdeclarativetext.moc" |