summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-10-12 04:15:08 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-10-12 04:15:08 (GMT)
commit24653fc546fe8150ebca1c44c36fe17c36527cc7 (patch)
treea5946ba6011396a543694de475537fe3abc2ced1 /tests/auto
parent1ea93870fce7ff032053775fb19d42e950dd5ccb (diff)
downloadQt-24653fc546fe8150ebca1c44c36fe17c36527cc7.zip
Qt-24653fc546fe8150ebca1c44c36fe17c36527cc7.tar.gz
Qt-24653fc546fe8150ebca1c44c36fe17c36527cc7.tar.bz2
Test that Component {} is allowed as the root element
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/declarative/qmllanguage/data/ComponentComposite.qml5
-rw-r--r--tests/auto/declarative/qmllanguage/data/componentCompositeType.qml8
-rw-r--r--tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp10
3 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmllanguage/data/ComponentComposite.qml b/tests/auto/declarative/qmllanguage/data/ComponentComposite.qml
new file mode 100644
index 0000000..f8726ef
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/ComponentComposite.qml
@@ -0,0 +1,5 @@
+import Qt 4.6
+
+Component {
+ Object {}
+}
diff --git a/tests/auto/declarative/qmllanguage/data/componentCompositeType.qml b/tests/auto/declarative/qmllanguage/data/componentCompositeType.qml
new file mode 100644
index 0000000..3a1b191
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/componentCompositeType.qml
@@ -0,0 +1,8 @@
+import Qt 4.6
+
+Object {
+ property var test
+
+ test: ComponentComposite {}
+}
+
diff --git a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
index 94998c7..a991144 100644
--- a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
+++ b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
@@ -57,6 +57,7 @@ private slots:
void valueTypes();
void cppnamespace();
void aliasProperties();
+ void componentCompositeType();
void importsBuiltin_data();
void importsBuiltin();
@@ -657,6 +658,15 @@ void tst_qmllanguage::aliasProperties()
}
}
+// Test that the root element in a composite type can be a Component
+void tst_qmllanguage::componentCompositeType()
+{
+ QmlComponent component(&engine, TEST_FILE("componentCompositeType.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+}
+
class TestType : public QObject {
Q_OBJECT
public: