diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-05-12 13:31:14 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-05-12 13:31:14 (GMT) |
commit | eb60b6fdb3e7288a92d9febd097e3ab64480c518 (patch) | |
tree | cb7835468d8031839c6c792b9e048fba64ba0f45 /tests/auto | |
parent | 8ade63338f4a0cecf885ec4f4192436b3fdeda9a (diff) | |
download | Qt-eb60b6fdb3e7288a92d9febd097e3ab64480c518.zip Qt-eb60b6fdb3e7288a92d9febd097e3ab64480c518.tar.gz Qt-eb60b6fdb3e7288a92d9febd097e3ab64480c518.tar.bz2 |
More tests
Diffstat (limited to 'tests/auto')
8 files changed, 31 insertions, 1 deletions
diff --git a/tests/auto/declarative/qmlparser/FailingComponent.qml b/tests/auto/declarative/qmlparser/FailingComponent.qml new file mode 100644 index 0000000..b604e0b --- /dev/null +++ b/tests/auto/declarative/qmlparser/FailingComponent.qml @@ -0,0 +1,3 @@ +Object { + a: 10 +} diff --git a/tests/auto/declarative/qmlparser/MyComponent.qml b/tests/auto/declarative/qmlparser/MyComponent.qml index 320a036..8a9f57d 100644 --- a/tests/auto/declarative/qmlparser/MyComponent.qml +++ b/tests/auto/declarative/qmlparser/MyComponent.qml @@ -1,4 +1,4 @@ -Object { +MyQmlObject { property real x; property real y; } diff --git a/tests/auto/declarative/qmlparser/dynamicObject.1.txt b/tests/auto/declarative/qmlparser/dynamicObject.1.txt new file mode 100644 index 0000000..ac892c3 --- /dev/null +++ b/tests/auto/declarative/qmlparser/dynamicObject.1.txt @@ -0,0 +1,6 @@ +SetProperties { + propa: a + 10 + propb: Math.min(a, 10) + propc: MyPropertyValueSource {} + onPropA: a +} diff --git a/tests/auto/declarative/qmlparser/failingComponent.errors.txt b/tests/auto/declarative/qmlparser/failingComponent.errors.txt new file mode 100644 index 0000000..0db1271 --- /dev/null +++ b/tests/auto/declarative/qmlparser/failingComponent.errors.txt @@ -0,0 +1,2 @@ +2:-1:Unknown property "a" +2:-1:Unable to create object of type "FailingComponent" diff --git a/tests/auto/declarative/qmlparser/failingComponent.txt b/tests/auto/declarative/qmlparser/failingComponent.txt new file mode 100644 index 0000000..8c43f84 --- /dev/null +++ b/tests/auto/declarative/qmlparser/failingComponent.txt @@ -0,0 +1,4 @@ +MyContainer { + FailingComponent {} +} + diff --git a/tests/auto/declarative/qmlparser/missingSignal.errors.txt b/tests/auto/declarative/qmlparser/missingSignal.errors.txt new file mode 100644 index 0000000..8ae1bbe4 --- /dev/null +++ b/tests/auto/declarative/qmlparser/missingSignal.errors.txt @@ -0,0 +1 @@ +2:-1:Cannot assign a signal to property "onClicked" diff --git a/tests/auto/declarative/qmlparser/missingSignal.txt b/tests/auto/declarative/qmlparser/missingSignal.txt new file mode 100644 index 0000000..07d1bfa --- /dev/null +++ b/tests/auto/declarative/qmlparser/missingSignal.txt @@ -0,0 +1,3 @@ +Object { + onClicked: print("Hello world!") +} diff --git a/tests/auto/declarative/qmlparser/tst_qmlparser.cpp b/tests/auto/declarative/qmlparser/tst_qmlparser.cpp index 81d044b..1a35d72 100644 --- a/tests/auto/declarative/qmlparser/tst_qmlparser.cpp +++ b/tests/auto/declarative/qmlparser/tst_qmlparser.cpp @@ -397,6 +397,7 @@ private slots: void autoComponentCreation(); void propertyValueSource(); void attachedProperties(); + void dynamicObjects(); // regression tests for crashes void crash1(); @@ -479,6 +480,8 @@ void tst_qmlparser::errors_data() QTest::newRow("unregisteredObject") << "unregisteredObject.txt" << "unregisteredObject.errors.txt" << false; QTest::newRow("empty") << "empty.txt" << "empty.errors.txt" << false; QTest::newRow("missingObject") << "missingObject.txt" << "missingObject.errors.txt" << false; + QTest::newRow("failingComponent") << "failingComponent.txt" << "failingComponent.errors.txt" << true; + QTest::newRow("missingSignal") << "missingSignal.txt" << "missingSignal.errors.txt" << true; } void tst_qmlparser::errors() @@ -729,6 +732,14 @@ void tst_qmlparser::attachedProperties() QCOMPARE(attached->property("value"), QVariant(10)); } +// Tests non-static object properties +void tst_qmlparser::dynamicObjects() +{ + QmlComponent component(&engine, TEST_FILE("dynamicObject.1.txt")); + QObject *object = component.create(); + QVERIFY(object != 0); +} + void tst_qmlparser::crash1() { QmlComponent component(&engine, "Component {}"); |